快照
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
「快照」是 Android 虛擬裝置 (AVD) 的已儲存映像檔,可保留裝置在儲存時的完整狀態,包括 OS 設定、應用程式狀態和使用者資料。您可以透過載入快照返回已儲存的系統狀態,節省等待虛擬裝置上的作業系統和應用程式重新啟動的時間,輕鬆讓應用程式回到您要恢復測試的狀態。藉由載入快照來啟動虛擬裝置,就如同喚醒休眠狀態的實體裝置,而不是從關機狀態啟動裝置。
您可以為每個 AVD 設定一個「Quick Boot」快照以及不限數量的一般快照。
如要充分運用快照,最簡單的方法是使用 Quick Boot 快照。根據預設,每個 AVD 都會設為在結束時自動儲存 Quick Boot 快照,並在啟動時載入 Quick Boot 快照。
AVD 首次啟動時,必須執行「冷啟動」(就像啟動裝置一樣)。如果您啟用了 Quick Boot,後續的每次啟動都會從指定快照載入,而系統也會還原成該快照中儲存的狀態。
相較於冷啟動,AVD 的啟動速度最多可快 10 倍。因此,建議您在 AVD 初次啟動後,盡可能使用快速啟動功能 (如果可行)。
快照功能適用於快照儲存時一併納入的系統映像檔、AVD 設定和模擬器功能。當您對上述任一適用範圍進行變更時,受影響 AVD 的所有快照都會失效。只要對 Android Emulator、系統映像檔或 AVD 設定進行更新,都會一併重設 AVD 的儲存狀態,因此 AVD 必須在您下次啟動時執行冷啟動。
用於儲存、載入及管理快照的多數控制項都位於「Snapshots」窗格的「Snapshots」和「Settings」分頁中。如果您是在 Android Studio 的工具視窗中執行模擬器,「Snapshots」窗格按鈕位於模擬器工具列中。如果您是在 Android Studio 以外的獨立視窗中執行模擬器,則「Snapshots」窗格位於「Extended controls」視窗中。

當您透過指令列啟動模擬器時,也能控管 Quick Boot 選項。
儲存 Quick Boot 快照
您可以指定是否要讓模擬器在關閉時自動儲存快照。如要控制這項行為,請按照下列步驟操作:
- 開啟快照設定。如果模擬器內嵌在 Android Studio 中,請按一下工具列中的「Snapshots」。如果模擬器是在獨立視窗中執行,請開啟「Extended controls」視窗。
- 前往控制項「Snapshots」類別中的「Settings」分頁。
使用「Auto-save current state to Quickboot」選單選取下列任一選項:
您選取的設定只會套用至開啟的 AVD。在 ADB 離線的情況下 (例如 AVD 仍在啟動中),您無法儲存快照。
儲存一般快照
雖然每個 AVD 只能設定一個 Quick Boot 快照,卻可以設定多個一般快照。
如要儲存一般快照,請開啟「Snapshots」窗格,然後按一下窗格右下角的「Take snapshot」按鈕。
如要編輯所選快照的名稱和說明,請按一下窗格底部的「Edit」按鈕
。
刪除快照
如要手動刪除快照,請開啟「Snapshots」窗格,選取快照並按一下窗格底部的「Delete」按鈕
。
您也可以指定是否在快照失效時 (例如 AVD 設定或模擬器版本變更時),要求模擬器自動刪除快照。根據預設,模擬器會詢問您是否要刪除無效快照。如要變更這項設定,請在「Snapshots」窗格的「Settings」分頁中使用「Delete invalid snapshots」選單。
載入快照
每次要載入快照時,請開啟模擬器的「Snapshots」窗格,選取「Snapshots」類別,然後選擇快照並按一下窗格底部的「Load」按鈕
。
在 Android Studio 3.2 以上版本中,每項裝置設定都含有「Boot option」控制項。這個控制項位於「Virtual Device Configuration」對話方塊的進階設定中。您可以使用這個控制項,指定啟動 AVD 時要載入哪一個快照。
停用 Quick Boot
如要停用 Quick Boot,讓 AVD 一律執行冷啟動,請按照下列步驟操作:
- 依序選取「Tools」>「Device Manager」,然後按一下「Edit this AVD」圖示
。
- 按一下「Show Advanced Settings」,然後向下捲動至「Emulated Performance」。
- 選取「Cold boot」。
單次冷啟動
在「Device Manager」中點選 AVD 選單中的「Cold Boot」,不必完全停用 Quick Boot。

快照的系統需求與疑難排解
- 快照功能不適用於 Android 4.0.4 (API 級別 15) 以下版本。
- 快照功能不適用於 Android 8.0 (API 級別 26) 的 ARM 系統映像檔。
- 如果模擬器無法透過快照啟動,請在裝置管理工具中為 AVD 選取「Cold Boot」,然後提交錯誤報告。
- 啟用軟體轉譯功能時,可能會無法使用快照功能。如果快照功能無法運作,請按一下「Device Manager」中的「Edit this AVD」圖示
,然後將「Graphics」變更為「Hardware」或「Automatic」。
- 載入或儲存快照容易佔用大量記憶體。載入或儲存作業啟動後,如果可用 RAM 不足,作業系統可能會將 RAM 內容遷移至硬碟,因而大幅降低運作速度。如果您發現快照載入或儲存速度非常緩慢,可以釋出 RAM 加快運作速度。關閉作業時非必要的應用程式,是釋出 RAM 的好方法。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[[["容易理解","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,["# Snapshots\n\nA *snapshot* is a stored image of an Android Virtual Device (AVD) that preserves\nthe entire state of the device at the time that it was saved -- including OS\nsettings, application state, and user data. You can return to a saved system\nstate by loading a snapshot, saving you the time of waiting\nfor the operating system and applications on the virtual device to restart, as\nwell as saving you the effort of bringing your app back to the state at which\nyou want to resume your testing. Starting a virtual device by loading a snapshot\nis much like waking a physical device from a sleep state, as opposed to booting\nit from a powered-off state.\n\nFor each AVD, you can have one *Quick Boot* snapshot and any number of general\nsnapshots.\n\nThe simplest way to take advantage of snapshots is to use a Quick Boot snapshot.\nBy default, each AVD is set to automatically save a Quick Boot snapshot on exit\nand load from a Quick Boot snapshot on start.\n\nThe first time that an AVD starts, it must perform a *cold boot*, just like\npowering on a device. If Quick Boot is enabled, all subsequent starts load from\nthe specified snapshot, and the system is restored to the state saved in that\nsnapshot.\n\nAn AVD can boot up to 10 times faster using a *Quick Boot* snapshot\nthan a Cold boot. That's why we would recommend to use\nQuick Boot (when possible) after the initial boot on your AVD.\n\nSnapshots are valid for the system image, AVD configuration, and emulator\nfeatures they are saved with. When you make a change in any of these\nareas, all snapshots of the affected AVD become invalid. Any update to the\nAndroid Emulator, system image, or AVD settings resets the AVD's saved state, so\nthe next time you start the AVD, it must perform a cold boot.\n\nMost controls for saving, loading, and managing snapshots are in the\n**Snapshots** and **Settings** tabs in the **Snapshots** pane. If you're\nrunning the emulator in a tool window in Android Studio, the **Snapshots**\npane button is in the emulator toolbar. If you're running the emulator in\na standalone window outside of Android Studio, the **Snapshots** pane is in\nthe [Extended controls](#extended) window.\n\nYou can also control the Quick Boot options when [starting the emulator from the\ncommand line](/studio/run/emulator-commandline#startup-options).\n\nSave Quick Boot snapshots\n-------------------------\n\nYou can specify whether the emulator automatically saves\na snapshot when you close. To control this behavior, proceed as follows:\n\n1. Open the snapshots settings. If the emulator is embedded in Android Studio, click on **Snapshots** in the toolbar. If the emulator is in a separate window, open the [Extended controls](#extended) window.\n2. In the **Snapshots** category of controls, navigate to the **Settings** tab.\n3. Use the **Auto-save current state to Quickboot** menu to select\n one of the following options:\n\n - **Yes**: Always save an AVD snapshot when you close the emulator. This is\n the default.\n\n | **Note:** When automatic Quick Boot snapshots are enabled, you can skip saving a Quick Boot snapshot by holding the \u003ckbd\u003eShift\u003c/kbd\u003e key down when you close the emulator.\n - **No**: Don't save an AVD snapshot when you close the emulator.\n\nYour selection applies only to the AVD that is open. You can't save\nsnapshots while ADB is offline (such as while the AVD is still booting).\n\nSave general snapshots\n----------------------\n\nWhereas you can only have one Quick Boot snapshot for each AVD, you can have\nmultiple general snapshots for each AVD.\n\nTo save a general snapshot, open the **Snapshots** pane and click the\n**Take snapshot** button in its lower-right corner.\n\nTo edit the name and description of the selected snapshot, click the edit\n\nbutton at the bottom of the pane.\n\nDelete a snapshot\n-----------------\n\nTo manually delete a snapshot, open the **Snapshots** pane, select the\nsnapshot, and click the delete\n\nbutton at the bottom of the pane.\n\nYou can also specify whether you would like the emulator to automatically delete\nsnapshots when they become invalid, such as when the AVD settings or emulator\nversion change. By default, the emulator asks you whether you want it to\ndelete invalid snapshots. You can change this setting with the\n**Delete invalid snapshots** menu in the **Settings** tab of the **Snapshots**\npane.\n\nLoad a snapshot\n---------------\n\nTo load a snapshot at any time, open the emulator's **Snapshots** pane, select\nthe **Snapshots** category, choose a snapshot, and click the\nload\nbutton at the bottom of the pane.\n\nIn Android Studio 3.2 and higher, each device configuration includes a\n**Boot option** control in the advanced settings in the\n[Virtual Device Configuration](/studio/run/managing-avds) dialog.\nYou can use the control to specify which snapshot to load when starting that AVD.\n\n### Disable Quick Boot\n\nIf you want to disable Quick Boot so your AVD always performs a cold boot, do\nthe following:\n\n1. Select **Tools \\\u003e Device Manager** and click **Edit this AVD** .\n2. Click **Show Advanced Settings** and scroll down to **Emulated Performance**.\n3. Select **Cold boot**.\n\nCold boot once\n--------------\n\nInstead of disabling Quick Boot completely, you can cold boot by\nclicking **Cold Boot** from the AVD's menu in the\n**Device Manager**.\n\nSnapshot requirements and troubleshooting\n-----------------------------------------\n\n- Snapshots don't work with Android 4.0.4 (API level 15) or lower.\n- Snapshots don't work with ARM system images for Android 8.0 (API level 26).\n- If the emulator fails to boot from a snapshot, select **Cold Boot** for the AVD in the Device Manager and [submit a bug report](/studio/report-bugs).\n- Snapshots are not reliable when software rendering is enabled. If snapshots don't work, click **Edit this AVD** in the **Device Manager** and change **Graphics** to either **Hardware** or **Automatic**.\n- Loading or saving a snapshot is a memory-intensive operation. If you don't have enough RAM free when a load or save operation begins, the operating system may swap the contents of RAM to the hard disk, which can greatly slow the operation. If you experience very slow snapshot loads or saves, you may be able to speed these operations by freeing RAM. Closing applications that are not essential for your work is a good way to free RAM."]]