A way to help the development of Ubuntu Touch. Runs a fully functioning Ubuntu Touch virtual machine. It allows you to build, install and test system components as well as testing apps.
- Make debugging platform components easy
- Use as a device replacement for app development
- Don't worry about porting
- Lower barrier to entry for contributors
- Linux with Snap:
sudo snap install ubports-pdksudo snap connect ubports-pdk:kvmsudo snap connect ubports-pdk:network-control
- macOS & other Linux: Clone this repository or download a copy of it from GitHub
On Linux, make sure that your user account is in the kvm group:
- Ubuntu 18.04 and earlier:
sudo groupadd kvmsudo usermod -aG kvm $USER
- Ubuntu 20.04 and up:
sudo usermod -aG kvm $USER
For the snap version, use the command ubports-pdk.pdk instead of ubuntu-touch-pdk.
ubuntu-touch-pdk setup: Sets up the environment and mounting capabilities for your development needsubuntu-touch-pdk pull: Download the freshest development image (based on focal)ubuntu-touch-pdk run: Run the development VM instance
Changes within a VM are persistent until you run the pull command again. You can have separate VMs
by adding --name=my_custom_vm to the pull and run commands.
To fetch a build based on 24.04, run the pull command with --release=24.04-1.x.
The PDK supports spawning both GTK as well as SDL windows. Use the --gui=sdl option during run to select SDL.
For more options, please run the command with the -h flag.
When logged into the VM instance (user: root, password: root) you're able to clone UBports repositories using ubports-clone. Let's try that with repowerd.
root@linux:~# ubports-clone repowerd
This will download the sources from Git and make them available in your PDK workspace (configured during the ubuntu-touch-pdk setup step).
Within the VM instance you're able to access those files in /pdk/sources.
Still logged into the VM instance, you're able to trigger a build of your cloned sources using ubports-build, ie for repowerd:
root@linux:~# ubports-build repowerd
This will copy your sources over to the VM, build the source code and publish Debian packages easily accessible from within your PDK workspace. For repowerd those files will be located in $PDK_WORKSPACE/sources/repowerd
The same Debian packages generated by the ubports-build command can be installed into the VM, like: sudo apt install /pdk/sources/repowerd/*.deb
The PDK automatically spawns an ADB daemon which you can use as a test device for application development.
Run the PDK and restart your host's adb:
adb kill-server
adb devices
Once adb devices finds the emulator, you can use clickable install to install apps into the VM.
Running on distributions other than Ubuntu is possible, but not guaranteed yet.
To reset the PDK completely, remove the environment directory you chose on setup as well as your configuration file, which is located in one of the following:
- Linux with Snap:
$SNAP_USER_COMMON/config.sh(e.g.$HOME/snap/ubports-pdk/common/config.sh) - Other Linux:
$HOME/.config/UbuntuTouchPdk/config.sh - Mac:
$HOME/Library/Caches/UbuntuTouchPdk/config.sh
There are currently known issues with NVIDIA GPUs. If the QEMU window remains black after starting the PDK and logging into the VM instance, this may be the case.
In order to check which video card you are using, you can run the following command on host side:
glxinfo | egrep "OpenGL vendor|OpenGL renderer"
And if a discrete Nvidia graphics card is used, and there is onboard Intel and PRIME is supported, executing sudo prime-select intel to switch and then rebooting may help.
- Preconfigured QEMU with OpenGL support
- Focus on Linux and macOS as host systems first
- Intel images on Intel hardware, ARM64 on ARM64 hardware (Mac M1)
- 20.04 & 24.04 off-the-shelf kernels
- Rootfs builds taken straight from Debos
- Utilities that wrap around Git and make it easier to pull sources
- Utilities around building and testing UT components
