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.flagnameIf 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.nameFor example, to disable the
append_injected_contentflag, run:adb shell aflags disable com.example.android.aconfig.demo.flags.append_injected_contentSkip to step 7.
Enable your code. From the command line, run:
adb shell aflags enable your.full.flag.nameFor example, enable the
append_injected_contentflag, run:adb shell aflags enable com.example.android.aconfig.demo.flags.append_injected_contentReboot the device:
adb rebootCheck the status your code either by attempting to execute it on the device or by rerunning the
aflags listcommand again:adb shell aflags list | grep package.flagnameIf your code was enabled, it should be disabled. Conversely, if your code was disabled, it should be enabled.