Install VS Code on an Android Phone
Termux is an app that provides a Unix/Linux-like environment on your Android device. But getting a familiar IDE like Visual Studio Code previous required several steps. Recently this seems to have been streamlined by the various package maintainers and now can be done in fewer steps.
First is that we will be installing the open-source version of Visual Studio Code (VS Code), called code-server.
Step 1 - Install termux
To install VS code, you will have to install termux using this link. The official release available on the play store doesn't seem to get the packages updated for some reason.
If the upgrade command doesn't work on your termux, try to change the default repo by using the command below:
code-server is an Electron app and needs support from the nodejs environment.
In Termux run the following commands:
termux-change-repo
Step 2 - Install ubuntu using termux
Enter the following command on termux and ubuntu will start to install on your Android phone
pkg install wget openssl-tool proot -y && hash -r && wget https://raw.githubusercontent.com/EXALAB/AnLinux-Resources/master/Scripts/Installer/Ubuntu/ubuntu.sh && bash ubuntu.sh
start ubuntu by firing the following command:
./start-ubuntu.sh
OR
ls
cd ubuntu-in-termux
ls
chmod + x *
ls
./ubuntu.sh -y
./startubuntu.sh
After install Ubuntu
install these commands
apt instill nodejs
apt install yarn
Per the Termux NodeJS wiki also install:
apt install build-essential
apt install python
apt install git
As they are needed for building native extensions.
And finally, install the code-server itself.
yarn global add code-server
Note: Installing code-server will take a while
code-server is now installed and will be the back-end server to your front-end client, a Chromium browser, like Chrome for Android or Microsoft Edge.
After installing These commands
Follows the steps
Step 3 - Downloading code server
We will now download the latest release of code server from Github using the following command:
wget https://github.com/cdr/code-server/releases/download/v3.10.2/code-server-3.10.2-linux-arm64.tar.gz
Extract the tarball using the following command:
tar -xvf ./code-server-3.10.2-linux-arm64.tar.gz
enter the /bin folder of your code-server installation on Ubuntu (running on your phone)
cd code-server-3.10.2-linux-arm64
cd bin
Step 4 - Set up a password and start using VS Code
Setup a password for your VS Code instance using the following command:
export PASSWORD="password"
Launch the code server using the following command:
code-server
Now enjoy vs code in termux
Open up a browser, as I was using Samsung DeX as a desktop, I used Samsung Internet, connected to 127.0.0.1:8080, and entered the password.
0 Comments: