[null,null,["最后更新时间 (UTC):2024-08-22。"],[],[],null,["# Dynamic System Updates (DSU) is a system feature introduced in Android 10 that\ndoes the following:\n\n- Downloads a new GSI (or other Android system image) onto your device.\n- Creates a new dynamic partition.\n- Loads the downloaded GSI onto the new partition.\n- Boots the GSI as a guest OS on the device.\n\nDSU also enables you to easily switch between the current system image and the\nGSI so you can try GSI without risking corruption of the current system image.\n\nDSU requirements\n----------------\n\nDSU depends on the *Android Dynamic Partition* feature and requires the GSIs to\nbe signed by Google or your OEMs as a trusted system image.\n\nDSU is a feature provided by your device's manufacturer. Refer to your device\nmanufacturer's support page for availability. Google has enabled DSU on Pixel\n3 and newer devices since the Android 10 Beta 4 release.\n\nInstall GSIs using DSU and the command line\n-------------------------------------------\n\nThis section describes how to install a GSI using DSU and the command line.\n\n### Launch DSU\n\nLaunch DSU using the `adb` tool.\n\n1. Download a GSI from the [GSI release page](/topic/generic-system-image/releases)\n or another GSI image server.\n\n | **Note:** If you build your own GSI from source, or if you download a GSI from another image server, your GSI might not be unsparsed. Use the following command inside your build tree to convert the image to an unsparsed image: `simg2img system.img system_raw.img`\n2. gzip the GSI.\n\n ```\n gzip -c system_raw.img \u003e system_raw.gz\n ```\n3. Push the GSI to the device.\n\n ```\n adb push system_raw.gz /storage/emulated/0/Download/\n ```\n4. Launch DSU using `adb`.\n\n ```\n adb shell am start-activity \\\n -n com.android.dynsystem/com.android.dynsystem.VerificationActivity \\\n -a android.os.image.action.START_INSTALL \\\n -d file:///storage/emulated/0/Download/system_raw.gz \\\n --el KEY_SYSTEM_SIZE $(du -b system_raw.img|cut -f1) \\\n --el KEY_USERDATA_SIZE 8589934592\n ```\n\n A notification like this one shows the status of the installation.\n\n### Boot into the GSI\n\n**Figure 1**. A persistent notification that you can use to control DSU.\n\nAfter DSU installs the GSI, a DSU menu appears as a persistent notification\ninside the system notification drawer (see figure 1).\n\nAt this point, you can do one of the following:\n\n- Boot into the GSI by tapping **Restart**.\n- Clean up the GSI by tapping **Discard**.\n\n### Switch back to the device's original system image\n\nAfter you are done testing your app using the GSI, you can perform a cold reboot\nto boot the system back into its original system image.\n\nWhen setting the next reboot to use a GSI, you can have the GSI stay installed\nthrough multiple boot cycles (until discarded) by enabling sticky mode, or have\nit used for only one boot cycle by disabling sticky mode.\n\nThe following command enables sticky mode: \n\n```\nadb shell gsi_tool enable\n```\n\nThe following commands disable sticky mode: \n\n adb shell gsi_tool disable\n adb shell gsi_tool enable -s\n adb shell gsi_tool disable\n\nInstall GSIs using DSU and the DSU Loader\n-----------------------------------------\n\nAndroid 11 introduced the DSU Loader, a tool available in the device's developer\noptions that lets you download, install, and manage GSIs entirely through the\nsystem's UI.\n\nTo install a GSI using the DSU Loader, follow these steps on a device running\nAndroid 11 or higher:\n\n1. [Enable developer options](/studio/debug/dev-options#enable) on your device.\n2. Open your device's Settings app, then tap **Developer options \\\u003e DSU Loader**.\n3. Choose the GSI that you want to install on your device.\n\n4. Agree to the GSI terms and conditions.\n\n After you agree to the terms and conditions, the GSI that you selected starts\n downloading. You can check the status of the download through the DSU\n notification.\n5. After the download has finished, tap **Restart** to boot the GSI.\n\n6. When you want to switch back to your device's original system image, tap\n **Restart** from the DSU system notification.\n\nProvide feedback\n----------------\n\nYour feedback helps us improve DSU and other GSI features. Share your thoughts\nand report GSI issues by filing [GSI\nbugs](https://issuetracker.google.com/issues?q=componentid:470386%2B)\nand discussing [topics on Stack Overflow](https://stackoverflow.com/questions/55841972/getting-started-with-gsi)."]]