[null,null,["最后更新时间 (UTC):2025-04-04。"],[],[],null,["# Change a flag's value at runtime\n\nAfter building Android, ensure that you can change the aconfig flag's value.\n| **Note:** Only the value for an aconfig read-write flag can be changed at runtime.\n\nTo change an aconfig flag value at runtime:\n\n1. Ensure your device is running and connected to your development machine.\n2. Check to see the flag's current setting:\n\n adb shell aflags list | grep package.flagname\n\n3. If the flag is enabled and your code is executing, continue with step 4 to\n disable the flag. If the flag is disabled, skip to step 6 to enable your code.\n\n4. Disable your code. From the command line, run:\n\n adb shell aflags disable \u003cvar translate=\"no\"\u003eyour.full.flag.name\u003c/var\u003e\n\n For example, to disable the `append_injected_content` flag, run: \n\n adb shell aflags disable com.example.android.aconfig.demo.flags.append_injected_content\n\n5. Skip to step 7.\n\n6. Enable your code. From the command line, run:\n\n adb shell aflags enable \u003cvar translate=\"no\"\u003eyour.full.flag.name\u003c/var\u003e\n\n For example, enable the `append_injected_content` flag, run: \n\n adb shell aflags enable com.example.android.aconfig.demo.flags.append_injected_content\n\n7. Reboot the device:\n\n adb reboot\n\n8. Check the status your code either by attempting to execute it on the device\n or by rerunning the `aflags list` command again:\n\n adb shell aflags list | grep package.flagname\n\n If your code was enabled, it should be disabled. Conversely, if your code was\n disabled, it should be enabled."]]