DEV Community

Junaid
Junaid

Posted on

Install Official VS Code on Android

How to Install Official VS Code on Android

  1. Install Termux:

  2. Setup Termux:

    • Update Termux packages and install neofetch:

      apt update -y && apt upgrade -y && neofetch 

      Follow the prompts and say Y to all.

  3. Install Ubuntu 22:

    • Install Linux VM (OS: Ubuntu 22):

      pkg update -y && pkg install wget curl proot tar -y wget https://raw.githubusercontent.com/AndronixApp/AndronixOrigin/master/Installer/Ubuntu22/ubuntu22.sh -O ubuntu22.sh chmod +x ubuntu22.sh && bash ubuntu22.sh 
  4. Set Root Password and Install Packages:

    • In the Ubuntu 22 VM, set a password for root:

      passwd 

      (Keep it as root for now.)

    • Install necessary packages:

      apt update -y && apt upgrade -y apt install nano curl wget python3 python3-pip neofetch dpkg sudo && neofetch 
  5. Create User:

    • Create a new user and grant sudo privileges:

      useradd -m "<username>" passwd "<username>" usermod -aG sudo "<username>" 
  6. Update Packages:

    • Update Ubuntu packages:

      sudo apt update -y && sudo apt upgrade -y && sudo apt --fix-broken install 
  7. Exit VM:

    • Exit the Ubuntu VM:

      exit 
  8. Connect Local Storage:

    • Connect your local mobile storage to Termux:

      termux-setup-storage 

      Say Y to allow if prompted.

  9. Check Architecture:

    • Check the architecture of Termux/Android:

      neofetch 

      Look for aarch64 or arm64 for 64-bit architecture, and aarch32orarmhf for 32-bit.

  10. Download VS Code:

  11. Copy and Install VS Code:

    • Copy the downloaded .deb file to the Ubuntu VM:

      ls storage/downloads cp "storage/downloads/<filename>" "code.deb" mv "code.deb" "ubuntu22-fs/root/code.deb" 
  12. Start Ubuntu VM:

    • Start the Ubuntu VM:

      bash start-ubuntu22.sh 
  13. Install VS Code:

    • Install VS Code using the .deb file:

      apt install ./code.deb 
  14. Login and Run VS Code:

    • Login with your username:

      login "<username>" 

      Enter your password.

    • Run VS Code in the browser:

      code serve-web 

      Wait for a URL to appear, then copy and paste it into your browser.

Bonus

  • Run VS Code Server:

    • Run VS Code server on Android:

      code tunnel 

Enjoy using VS Code on your Android !

Double Verified by Junaid.

Author : Junaid

Top comments (3)

Collapse
 
junaid_dev profile image
Junaid • Edited

Hey guys , now it is easy in different method.

  1. Install termux.
  2. apt update && apt upgrade && apt full-upgrade && apt clean
  3. Install proot-distro : apt install proot-distro , use proot-distro help to help.
  4. Install Ubuntu roofs (or) Install Ubuntu vm, by default it installs ubuntu 24/latest then rename it : proot-distro install Ubuntu && proot-distro rename Ubuntu vscode-vm.
  5. Login in your vm : proot-distro login vscode-vm
  6. Use nano to write basic setup script or use this:
apt update apt upgrade apt clean apt full-upgrade apt update apt clean apt install nano curl wget git neofetch apt install sudo # Your packages here apt install python3 python3-pip apt update && apt clean clear echo "VM SETUP COMPLETE!" 
Enter fullscreen mode Exit fullscreen mode

Note: this server does not support FLATPACK or SNAP

  1. Download the vscode with these architectures : arm64 or armhf or arm32 via in your android. now we need it tomove from Downloads to root of vm: Downloads > termux > /data/data/com.termux/files/usr/var/lib/proot-distro/ /root/code.deb
  2. Create an user env for vscode to run :
useradd -m "<username>" passwd "<username>" usermod -aG sudo "<username>" 
Enter fullscreen mode Exit fullscreen mode
  1. login in user env then repeat setup process from 6th to 7th.
  2. Install in root dir : dpkg -i ./code.deb and run it code-server
Collapse
 
junaid_dev profile image
Junaid

Hi

Collapse
 
hackdev07_6ecc1fd1e21e99a profile image
HackDev07

Screenhshoot please