Using Android phone as a development machine
Tags: productivity, linux, android, javascript
Published: 2020-05-05 11:42:33

So recently I was wondering if I could use my phone as a development machine. So I give it a try and I am sharing my experience below. If you are using any Desktop mode supported devices then thats more better e.g Samsung DeX, Huawei Desktop mode.
You can go to PlayStore and find many applications that lets you install Linux without root however, I personally found two to be more easy to use i.e [UserLand](https://play.google.com/store/apps/details?id=tech.ula) and [AndroNix](https://play.google.com/store/apps/details?id=studio.com.techriz.andronix). But I choosed AndroNix due to their [ModdedOS](https://andronix.app/modded-os/) option which comes with pre-installed **VS Code** and other useful tools.
Once i downloaded the application, I purchased the Ubuntu XFCE environment (there are free options as well). They have plenty of options/videos on how to install this, its pretty straight forward.  
![AndronNix Modded OS](https://dev-to-uploads.s3.amazonaws.com/i/2hxvqb15q7ww7jjgmbln.PNG)
And here modded OS options:

![All Modded OS](https://dev-to-uploads.s3.amazonaws.com/i/22944j4i5b2xld3y6hbx.PNG)

After installation (please follow their instructions. It is clear enough), I connected Bluetooth mouse and keyboard to my Galaxy S20 Ultra and went to Samsung DeX mode. Then I opened the [Termux](https://play.google.com/store/apps/details?id=com.termux) (if already closed) and ran the `./start-andronix.sh`. You can learn more by checking their [FAQ](https://andronix.app/faq-frequently-asked-questions/).

![Termux command](https://dev-to-uploads.s3.amazonaws.com/i/ndr7jge0zffy4puf028j.PNG)

Next, I just ran the `vncserver` command and it was up and running. Do not forget to note the port i.e in my case `:1`. 

![VNC Server](https://dev-to-uploads.s3.amazonaws.com/i/84p3wnvyqpo688l8901n.PNG)

Next, I downloaded [VNC Viewer](https://play.google.com/store/apps/details?id=com.realvnc.viewer.android) and entered the `localhost:1` in address (as shown below) and thats it. I was then able to connect my running Linux environment😍. 
![VNC Viewer](https://dev-to-uploads.s3.amazonaws.com/i/bw54tqciin6za7ndo9l0.PNG)

Next I downloaded Node.js by following [this](https://www.linuxuprising.com/2018/04/how-to-install-and-configure-nodejs-and.html) blog using following command. I am adding commands below for reference.
`curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -`
`sudo apt install nodejs`
 
![Node.js Installation](https://dev-to-uploads.s3.amazonaws.com/i/8hdpqrnfwxrajsw6ehxd.PNG)
Now that I had Node.js, I installed Ionic, Angular and other required tools that I needed. Then ran my project in Ionic successfully. 
![VS Code](https://dev-to-uploads.s3.amazonaws.com/i/jpuyl0kyty6rk63s1rx1.PNG)

# Final Thoughts
I was really surprised about this as this was my first experience after Samsung stopped Linux on DeX (LoD) support on Android 10. Its really great alternative to LoD and I can clearly see many use cases of this e.g in case when traveling or unreachable to your PC. If you wanna add more addition to this then definitely checkout [NexDock 2](http://nexdock.com/).
Let me know if this setup sounds useful to you. Be kind as this is my first post 😁.