Breaking the Rules

Cinderella is so kind and obedient, she never cracks, rages or loses her cool. When she’s told that she will not be able to attend the King’s ball because she needs to help her stepsisters get all…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Web Development on a Phone. Updated for Linux on DeX.

Full desktop Linux on the phone.

Last year I wrote about how you can use a phone for web development using an Android Linux Terminal and a simple editor I’d made as a Progressive Web App. It worked pretty well but had some drawbacks, for example you couldn’t debug Samsung Internet on the DeX you had to use an external laptop.

Since then Samsung has released Linux on DeX as a beta which addresses many of the issues I had previously. I was lucky enough to borrow a Note 9 from work to test out how well I can port my work flow to only need the DeX.

The first thing which is really pleasant with the Note 9 is that you no longer need the specialised DeX dock, any USB-C dongle with HDMI, USB and Charging will work. I have one which I got a while ago for the VJ-OTG demo so I used that.

I plugged in a USB charger and mouse and keyboard to the dongle and DeX started straight away! The phone screen still works whilst DeX is running, so you can use it as a secondary screen for Android apps.

Linux on DeX running in terminal mode on the phone.

The terminal only mode is a great way to run commands when you are on the move.

When you run it from the DeX you get full desktop Linux you’d inspect.

Linux on DeX running desktop mode in DeX

Linux on DeX is so performant because it’s not running in a virtual machine, it’s a container which takes advantage of the device’s resources. So software written for it needs to be made for the device’s ARM architecture.

Linux for ARM devices is widely used because of the popularity of Linux powered SoC ARM devices such as the raspberry pi. As a result there is a lot of linux software compiled for ARM architecture ready to install using APT.

For example you can install node with:

This will prompt you for the root password which is ‘secret’ out the box but you should probably change it.

The default script couldn’t install automatically for security reasons so I had to run ‘apt-get install code-oss’ after running the script from the site which added the repos.

If you’re like me you probably want to configure the Linux desktop to your liking. All the command line tools I like to use such as zsh and tmux. Worked really well. I copied my configuration for these from my personal laptop to the phone and they worked out the box.

zsh is a terminal shell, like bash, which provides nice features for autocompletion. I use oh-my-zsh with the powerlevel9k theme to make it really useful.

Configuring the window manager unfortunately was not as easy.

Linux on DeX uses Gnome 2 out the box. Unfortunately Gnome Tweak Tools doesn’t work on Linux on DeX right now. Gnome Desktop also appears to have some issues wrt changing windows.

It can be changed to Mate which may be familiar to those of you who use Linux Mint on your laptops. Mate works well and it also can be tweaked. I haven’t looked into using it on Linux on DeX yet but that is probably the route I will take.

One really powerful feature of Linux on DeX is that it is runs great alongside the standard DeX experience. It starts extremely quickly, pressing the keys win+return can be used to quickly minimise it and holding the mouse at the bottom of the screen shows the DeX taskbar for taking screenshots and showing notifications.

The clipboard is shared between both systems allowing you to copy text between Linux and Android desktop.

DeX gets paused when it’s minimised which is really handy for saving power but not very useful when you want to run a long running task or a web server in Linux and then go do something else. I’m hoping it’s going to be possible to keep it running in the background in the future.

The Note 9 has loads of RAM and a really powerful CPU, so lots of things were really fast. Unfortunately Linux on DeX cannot yet access the graphics capabilities of the device. Which means that things which would take advantage of this are slow or don’t work at all.

WebGL and Blender run pretty slow. Especially when comparing WebGL in Samsung Internet on DeX to Chrome in the Linux on DeX container.

This is the functionality I was most looking forward to and it works really well, with a small caveat.

It does require an ADB command on an external laptop to enable it but it lasts until the device is restarted.

Here are the steps to do it:

It works really well with Samsung Internet running on the small phone screen and debugging it via Linux on DeX. It’s a great experience to do responsive design for both mobile and desktop at the same time on one device!!

Add a comment

Related posts:

Business Schools Are Ushering In a New Era of Sustainability

MBA programs are a breeding ground for future business leaders, so analyzing the trends that pop up in business schools across the country can give us a window into the direction the corporate world…