Tutorial: Mobile App Development with GNOME Builder
06 August 2021

In my previous post, I described Builder’s new support for mobile device development. Here I’ll explain how to set it up on your favorite mobile Linux device.

On the device

You’ll need to install deviced, which is responsible for communicating with Builder and running your apps. You can get it here. You’ll need to build it from source–that’s just meson _build and ninja -C _build.

To enable network discovery, first run nmcli connection show and copy the UUID of your network. Then, run _build/src/tools/devicectl and enter enable-network <UUID from above> at the prompt.

Finally, run _build/src/daemon/deviced to start the deviced daemon.

deviced depends on avahi-daemon, so make sure that’s installed and running. It also requires flatpak to run apps.

In Builder

On your development machine, you’ll need to install qemu-user-static to enable cross-compiling.

Builder should detect your device automatically–the headerbar will say “Discovered device…” when you start deviced. Click the dropdown to the left of that message and select your device from the list. Accept the connection on the phone, then wait for Builder to configure everything and install the flatpak SDK for the target architecture.

If Builder detects the device but can’t connect to it, make sure the firewall on the device isn’t blocking a connection.

Then click Run! It may take a while to compile under emulation, but when it’s done, the app will run on the phone. Happy hacking!


Edit 29 September 2021: Added missing instructions to enable network discovery.


Previous

Finishing GNOME Builder's Mobile Device Support

Recently I've been working on libshumate, the new maps library for GTK 4. I used my PinePhone to test the feature, so I needed a way to quickly build libshumate and run it on the phone.