How to run Visual Studio Code on Android

    Visual Studio Code is a product of Microsoft. It is a Source code editor built for the Windows, Linux, Mac Operating Systems.


Visual Studio includes features such as debugging, syntax highlighting, intelligent code completion, snippets, code refactoring, and embedded Git. It is Very good application for developers to build any software, website or application.

The Problem is that Microsoft has not developed Visual Studio app for android and many features are not available in the Source editiing apps which are present in Playstore.

But I have a solution for that you can the Visual Studio code in Android using Termux.

You will couple of commands and to execute and open the Visual studio code in Anrdroid, So let's get Into it.


Requirements:

  • Termux.(Download)
  • Chrome or Any Browser.(Available in Playstore)


Method:


Installation of Required apps:

  • Install the required apps for this tutorial.


Configuration Inside Termux:

  • First Setup the Storage and Update the Termux by using below commands:
  • Command:
termux-setup-storage

  • Command:
pkg update && pkg upgrade -y

  • Enter the below commands to download the installation script for ubuntu.
  • Command:
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


Installation of VS Code inside Ubuntu:

  • After downloading and executing the ubuntu script, Now its time to launch ubuntu.
  • Type the below command to launch ubuntu in termux.
  • Command:
./start-ubuntu.sh
  • After giving enter, you will be directed to root@localhost Directory and its is the directory for ubuntu.
  • First update and upgrade the ubuntu by below command
  • Command:
apt update && apt upgrade -y
  • Now you need to download the VS Code executable file from the below command.
  • Command:
wget https://github.com/cdr/code-server/releases/download/2.1698/code-server2.1698-vsc1.41.1-linux-arm64.tar.gz

  • After Downloading the executable file, extract the file with this command.
  • Command:
tar -xvf ./code-server2.1698-vsc1.41.1-linux-arm64.tar.gz
The file will be extracted within few minutes, after extracting, you can optionally delete the downloaded tar file free up some space or you can just leave it there.

  • The files are no loger executable so they need to be placed inside /bin folder for easy access for caling the file whenever required.
  • To do this, type the below command.
  • Command:
cp ./code-server2.1698-vsc1.41.1-linux-arm64/code-server /bin


Opening Visual Studio Code:

  • Now its time to open the editor application in android by using the below command.
  • Command:
code-server

  • After entering the above command, you will get a server address as http://localhost:8080 and a random password.
  • Copy the server address and paste it in your browser.
  • It will ask to enter the password, paste the given password from the termux to the browser.
  • And Visual code on android, you can get all the pc featured application in android by using this method.

  •  You can install any code editing software like flutter, dart etc. in Visual Studio code.
  • While Creating new instance or opening the Visual Studio Code again, you have to paste a new password again and again which is very annoying.
  • To solve this problem, Copy and paste the below command in ubuntu termux.
  • Command:
export PASSWORD="your password"
  • After this step, It will directly open the Visual code without asking for the Password.

Conculsion:

  • Here you go Visual Studio code in android, By using some commands in termux you can run pc version of Visual code in android.
  • If you want to learn more about termux, you can view this post here
  • If you want to learn the useful websites which might be helpful for then you visit this post from here.
  • Thanks for being here, Good luck, and Be curious.