After building Android, ensure that you can change the aconfig flag's value.
To change an aconfig flag value at runtime:
- Ensure your device is running and connected to your development machine.
Check to see the flag's current setting:
adb shell aflags list | grep package.flagname
If the flag is enabled and your code is executing, continue with step 4 to disable the flag. If the flag is disabled, skip to step 6 to enable your code.
Disable your code. From the command line, run:
adb shell aflags disable your.full.flag.name
For example, to disable the
append_injected_content
flag, run:adb shell aflags disable com.example.android.aconfig.demo.flags.append_injected_content
Skip to step 7.
Enable your code. From the command line, run:
adb shell aflags enable your.full.flag.name
For example, enable the
append_injected_content
flag, run:adb shell aflags enable com.example.android.aconfig.demo.flags.append_injected_content
Reboot the device:
adb reboot
Check the status your code either by attempting to execute it on the device or by rerunning the
aflags list
command again:adb shell aflags list | grep package.flagname
If your code was enabled, it should be disabled. Conversely, if your code was disabled, it should be enabled.