Code-Server: Run VS Code on Android and Use from iPad or Computer (Same Network/Different Networks)

Setting up your android device:

1. Install Termux
2. Open Termux and run all these commands (each line shows separate command)
apt update && apt upgrade
apt install build-essential python git nodejs yarn
yarn global add code-server

 3. In termux again, run command code-server and go to localhost:8080 in your browser to see if it works

4. Now you might need to configure your IP address so that others can access it over the same network. If you want to access through a different network, skip the following steps. 

5. Using Termux, run command: 

pkg install nano

cd ~/.config/code-server/

6. Edit the config.yaml file by running the command:

nano config.yaml

7. Change the bind addr to your device's IP address (Note: do not change the second line)

bind-addr: <IP-ADDRESS>:8080

auth: password

password: 6231as0a9a123c01b8e7e10f4111

cert: false

8. Save the file

9.  Now in termux, run command: code-server

10. Open <IP-ADDRESS>:8080 on any device connected to the same network to access VSCode.

Accessing over different network

Just tunnel your localhost using localhost.run (Note: if you're getting an error that says permission denied (public key), check this out) or ngrok. Since you're using an android device, ngrok might behave weirdly. Consider localhost.run which I've tested and it works fine.

Post a Comment

0 Comments