[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-27 (世界標準時間)。"],[],[],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."]]