1 of 34

Dual booting for testing and curiosity with Dynamic System Updates

Droidcon London 2025

Niall Scott

Bluesky: niallscott.bsky.social

2 of 34

Outcomes

I will cover…

  • What Generic System Images (GSIs) are, as prerequisite knowledge for…
  • Dynamic System Updates (DSUs)
  • With a walkthrough on how to apply DSUs
  • And examples on how they could be useful in your development workflow

3 of 34

Who has heard of Dynamic System Updates (DSUs)?

4 of 34

5 of 34

6 of 34

TIL = “Today I learned” (https://dictionary.cambridge.org/dictionary/english/til)

7 of 34

So, what are Dynamic System Updates?

We’ll get there!

Firstly, we need to talk about Generic System Images (GSIs)...

8 of 34

So, what are Generic System Images (GSI)s?

9 of 34

“A Generic System Image (GSI) is a pure Android implementation with unmodified Android Open Source Project (AOSP) code, runnable on a variety of Android devices.”

10 of 34

Why are GSIs useful?

  • Allows you to test your code with a pure-Android image on a real device
  • Allows you to test hardware features which the emulator cannot replicate
  • If the device supports it, you can switch Android versions with ease
  • Combined with Dynamic System Updates, it’s even easier to apply GSIs and switch versions

11 of 34

GSI pre-requisites

  • Bootloader is unlocked - so probably not suitable for your daily driver
  • Device is Project Treble compliant
    • `adb shell getprop ro.treble.enabled` returns `true`
  • The device launched with Android 9 (API level 28) or higher
  • The GSI image CPU architecture must match the device CPU architecture
    • `adb shell getprop ro.product.cpu.abi`; for example: arm64-v8a

Flashing to a device which does not meet the requirements may result in the device becoming non-bootable (soft or hard bricked)

12 of 34

Device recommendations

  • Google Pixel 3 and above has the best support
  • Look at Pixel ‘a’ series phones for cost-effectiveness (e.g. Pixel 7a)
  • Other OEMs do have support, but refer back to pre-requisites and check online before trying on a device

13 of 34

How to obtain a GSI

14 of 34

Flashing a GSI (the non-DSU way)

This method will most likely erase any data on the user partition. Also, there is the possibility of soft or hard bricking the device if you are not careful

15 of 34

And now, for DSUs…

16 of 34

What is a Dynamic System Update (DSU)?

  • Creates a new dynamic partition on the device
  • Installs a GSI (or another Android system image) onto the new dynamic partition
  • Reboots the device in to the new system image as a guest operating system on the device
  • You can switch between the primary install and the DSU managed install without risking corruption to the data on the primary install*

*It’s best to backup data first, or better, do this on a specifically assigned test device!

17 of 34

DSU prerequisites

  • DSUs were introduced in Android 10 (API level 29)
  • Mostly the same prerequisites as GSIs (device must be Project Treble compliant and image and device CPU arch must match)
  • If the guest image passes Android Verified Boot (AVB) then you may not have to unlock the bootloader
  • The guest system image must have a newer security patch timestamp than the host OS system image

18 of 34

DSU installation methods

DSU Loader

Pro: easier installation

Con: less choice of images

Command line (CLI)

Pro: ability to install wider range of images and to fix any issues more easily

Con: more faff, more opportunity to make mistakes

19 of 34

Prepare the device - Google Pixel�(other devices may vary)

20 of 34

DSU Loader - initiate installation

  1. Settings app -> Developer options -> DSU Loader
  2. Choose an image (usually GSI and GSI+GMS for different build numbers)
  3. Agree to terms
  4. Wait on the download to finish

21 of 34

DSU Loader - installation complete

Once the installation is complete, hit the “Restart” button on the notification

22 of 34

DSU Loader - success (hopefully)

  • If the boot was successful, you will see your guest image
  • If not, you should *hopefully* return to your main installation
  • And if that doesn’t happen, you may need to think about disaster recovery

23 of 34

Install DSU from CLI - prepare image

24 of 34

Install DSU from CLI - installation

25 of 34

Install DSU from CLI - installation

26 of 34

Install DSU from CLI - installation complete

Hopefully successful!

27 of 34

Making the DSU guest image sticky

  • By default, if you reboot from the guest image, it will reboot back to the host image
  • However, you can enable sticky mode

28 of 34

Disabling sticky mode

It is possible to disable sticky mode to make the main installation the default booted image.

29 of 34

Disaster recovery

  • The easiest way to recover from disaster is backups, or preferably, do this on a dedicated test device
  • Failed boots *should* recover by booting back into the main installation
  • Google provide factory images for Pixel devices at https://developers.google.com/android/images
  • Other OEMs should have their own recovery methods
  • Disclaimer: in the worst case scenario, you could hard-brick the device. You have been warned

30 of 34

Tips

  • Because of rollback protection, make the default installation an older version of Android
  • Do not use DSU on your daily driver
  • DSU Loader will show Android build numbers - see what they map to here: https://source.android.com/docs/setup/reference/build-numbers
  • Sometimes the instructions don’t result in success, so you may need to use your own intuition to solve issues, or give up

31 of 34

Possible use-case #1: testing across platform versions on real hardware

  • DSUs (usually) make it relatively easy to install new platform versions
  • Guest images have access to real hardware which the emulator does not
  • If you use AOSP images, you’re testing against the gold-standard of the Android platform
  • Money can be saved as you don’t need a full test lab

32 of 34

Possible use case #2: running userdebug builds on real hardware

  • Production builds are user builds signed by private vendor signing keys and are locked down - non-rooted
  • Testing and debugging builds are userdebug or eng builds - usually signed by AOSP-provided test-keys key and are not locked down as much - rooted
  • To access some hidden or restricted APIs, you need to be signed with the same key as the system and/or be a privileged app (e.g. your APK is installed in /system_ext/priv-app/)

33 of 34

Possible use case #2: running userdebug builds on real hardware (continued)

  • The test-keys are publicly available, so you can easily sign your APK with the same key in a userdebug system
  • In a userdebug built system, you can `adb root && adb remount` to push your APK to the normally read-only system with `adb push` then restart
  • Why do this? Curiosity, fun, learning how Android works internally!
  • Also, if you’re writing system services, it gives you a route to testing them if you’re still waiting on your test hardware to arrive

34 of 34

Thank you!

Bluesky: niallscott.bsky.social