Skip to main content

Tutorial on running full Visual Studio Code on Android phone (Termux)

Categories   Smartphone APP Review
Tags   Termux Android Ubuntu
Table of Contents

中文版

This article describes how to run the code editor Visual Studio Code (VSCode) on Android system without root permissions.

Developed by Microsoft, VSCode is a multifunctional code editor which supports a variety of programming languages ​​through many extensions. This could turning it into a small IDE.

What we are gonna installed here is not the code-server, but the full code main program, which can install almost all extensions.

So you can manage git projects and develop web programs

Or creating a Anaconda envrinonment to write a Python program

Or even modify the Linux kernel source code of Android

We will install the ARM64 version of Ubuntu environment through Termux, and then install VSCode in it.

1. Set up Linux environment
#

It is recommended to use the phone or tablet that has RAM >= 8GB, storage space > 10 GB, and a processor of Qualcomm Snapdragon 845 or above. Ideally having an external keyboard and mouse connceted would be better.

  1. Install Termux

  2. Set up Termux X11

Then install a Linux distribution:

2. Install Visual Studio Code
#

  1. Go to Visual Studio Code official website to download the deb file of the ARM64 version.

  2. Use the apt command to install the deb file, followed by the path to the deb file. If you download it using the browser on Android, the path will become /sdcard/Download/code*.deb

sudo apt install ~/Downloads/code*.deb
  1. After that, use vim to edit the Desktop Entry of VSCode
vim /usr/share/applications/code.desktop
  1. Add --no-sandbox after the Exec= line
Exec=/usr/bin/code --unity-launch %F --no-sandbox
  1. Click VSCode in the application list and try to start the program.

  2. If you want to see the error message, you can start it from the terminal:

code --verbose

3. Setting up the developing environment
#

I won’t go into details about the setup of developing environment here. There are many Ubuntu + VSCode tutorials on the Internet. Note that you should search for “Develop with VSCode on Ubuntu” rather than “Connect VSCode to remote Ubuntu for developing”

You could directly open terminal in the VSCode panel and execute commands there.

For example, if you want to compile C language programs, install GCC:

sudo apt install build-essential

If you want to have a Python Anaconda environment, you can refer to this article: Termux install Anaconda environment (miniforge)

Related

[Root] Install Ubuntu in chroot on Android without Linux Deploy
Categories   Smartphone Termux Tutorial
Tags   Linux Android Ubuntu Termux
How to install proot Ubuntu in Termux on Android phone (Desktop + Audio + One-click starter)
Categories   Smartphone Termux Tutorial
Tags   Termux Ubuntu
How to run Stable Diffusion on Termux on Android phone
Categories   Smartphone Termux Tutorial
Tags   Stable Diffusion AI Android Termux

Leave a comment

Choose the comment system you like. Giscus for codes, Disqus for anonymous comments.

Please login to your Github account to leave a comment. You can post codes here for discussion. For images, please upload to Imgur and copy links. Your comments would be visible to everyone on Github Discussions.

This comment system is provided by Disqus, you may see forcing Disqus ADs on this page. Sometimes your comment may need to be reviewed, resulting in delayed display. Thank you for your understanding.