Appendix A, work with RROs

Runtime resource overlays (RROs) can either be pushed to the /vendor/overlays folder (which is automatically read during boot) or can be installed by running adb install. The latter allows faster iteration. However, this can cause the same RRO to reside in two locations (/vendor/overlays and /data/app).

For pushing and rebooting, run:

$ adb root
$ adb remount
$ adb shell mkdir /vendor/overlay/<overlay-name>
$ adb push <path-to-overlay.apk-file> /vendor/overlay/<overlay-name>
$ adb reboot

For installation, run:

$ adb install <path-to-overlay.apk-file>

To confirm the RRO is available, run:

$ adb shell cmd overlay list --user current
    android
    [ ] com.android.sample_rro
    com.android.sample.targetapp
    [ ] com.android.sample.targetapp_rro

When --- is displayed next to the newly installed RRO, this indicates that the target APK was either not found (double-check the targetPackage declaration on your AndroidManifest.xml) or some of the resources defined in the RRO don't match any resources in the target.

Enable and disable RROs

To enable or disable a RRO, respectively, run the desired command:

  • Enable:
    adb shell cmd overlay enable --user current <rro-package-name>

  • Disable:
    adb shell cmd overlay disable --user current <rro-package-name>