Install Official VS Code on Android
Tags: vscode, termux
Published: 2024-04-03 12:07:40

## How to Install Official VS Code on Android

1. **Install Termux:**
    - Install Termux from the [F-droid](https://f-droid.org) or [F-droid/termux](https://f-droid.org/en/packages/com.termux/).

2. **Setup Termux:**
    - Update Termux packages and install `neofetch`:
        ```bash
        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):
        ```bash
        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:
        ```bash
        passwd 
        ```
        (Keep it as `root` for now.)
    - Install necessary packages:
        ```bash
       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:
        ```bash
        useradd -m "<username>"
        passwd "<username>"
        usermod -aG sudo "<username>"
        ```

6. **Update Packages:**
    - Update Ubuntu packages:
        ```bash
        sudo apt update -y && sudo apt upgrade -y && sudo apt --fix-broken install
        ```

7. **Exit VM:**
    - Exit the Ubuntu VM:
        ```bash
        exit
        ```

8. **Connect Local Storage:**
    - Connect your local mobile storage to Termux:
        ```bash
        termux-setup-storage
        ```
        Say `Y` to allow if prompted.

9. **Check Architecture:**
    - Check the architecture of Termux/Android:
        ```bash
        neofetch
        ```
        Look for `aarch64` or `arm64` for 64-bit architecture, and `aarch32`or`armhf` for 32-bit.

10. **Download VS Code:**
    - Go to the official VS Code website (https://code.visualstudio.com/download) and download the `.deb` package for Arm64 or Arm32 based on your architecture.

11. **Copy and Install VS Code:**
    - Copy the downloaded `.deb` file to the Ubuntu VM:
        ```bash
        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
        bash start-ubuntu22.sh
        ```

13. **Install VS Code:**
    - Install VS Code using the `.deb` file:
        ```bash
        apt install ./code.deb
        ```

14. **Login and Run VS Code:**
    - Login with your username:
        ```bash
        login "<username>"
        ```
        Enter your password.
    - Run VS Code in the browser:
        ```bash
        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:
        ```bash
        code tunnel
        ```

Enjoy using VS Code on your Android !
_*Double Verified*_ by [Junaid](https://abujuni.dev).
---

Author : [Junaid](https://abujuni.dev)