DEV Community

Cover image for Setting VSCode in Tablet/Phones
Ansari
Ansari

Posted on

Setting VSCode in Tablet/Phones

Here’s how the story begins. I was working in a well reputed product based company as an fullstack developer. One day when i took WFH cause I was so tired that morning, my bed never allowed me out. But, my bad time within few hours the server crashed and my manager told to check the issue as soon as possible. So i turned on my laptop, then this happened…

laptop low battery

My Laptop battery was about to die. On top of this, It was electricity maintenance hour. Even though the issue might be so simple to fix and update the server. I couldn’t do it. I thought I was screwed.

Suddenly an idea popped. I thought why can’t I setup my tablet as temporary machine for small bug fixes like this. So this what i did..

idea

I pulled my tablet out. Searched whether anything up on internet to setup a vscode in tablet/phones. Then i came across code-server which was open source tool for setting up vscode in your phone. As am also familiar with termux i followed the instructions and then got access to vscode and fixed the issued and updated. All this setup took was about 15 mins and I was ready to go.

If you love watching video instead following through article checkout it here and don’t forget to subscribe 😁

These were the steps I followed:

  1. Install the termux app directly from github since playstore app was outdated and stopped the updates.
  2. Then use this command to update the repositories and install proot-distro pkg update -y && pkg install proot-distro -y
  3. Now lets install debian distribution with this command and login to it proot-distro install debian && proot-distro login debian
  4. If error occurs while updating the packages try switching the repo with this command termux-changer-repo
  5. Once the debian os is set after that we should update the repo and install nvm from the source and install node from it and then install the code-server from the respective site. It was annoying to follow these right ?
  6. So I wrote simple bash script so that it will do everything with single command curl https://raw.githubusercontent.com/The-Robin-Hood/Useful-Python-Script/main/code-server.sh | bash
  7. That's it, everything is set. We ready to up the server code-server will up the server
  8. Initially it will create config file ~/.config/code-server/config.yaml
  9. Change , Copy or Delete the authentication from there.
  10. To Delete the authentication, set the auth to none and remove the password line
  11. To make available across devices on same network, set the bind-addr as follow

terminal

  1. Now restart the server and visit the localhost:8080 to enter the vscode

  2. Add the site to Home screen for easier access.

Well now no worries when your laptop died or while traveling without your laptop. You could code from your tablet/phone.

If you like the article and wish to read more like this. Don’t hesitate to hit the follow button and a like would be much appreciated 😅

Top comments (0)