將遊戲最佳化的工具
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
如要讓您的環境適合針對 Android 遊戲進行偵錯及最佳化調整,請運用下列有助分析 CPU 使用情形和圖像呼叫的工具。
CPU
請使用下列工具評估及改善遊戲的 CPU 效能:
記憶體
- Meminfo:收集記憶體統計資料,顯示 PSS 記憶體的分配情形,以及使用的記憶體類別。使用
adb shell dumpsys meminfo package-name
指令或 MemoryInfo
呼叫。
- Perfetto:收集裝置上的效能和記憶體資訊,並在網頁式 UI 中顯示。Perfetto 支援任意長度的追蹤記錄,因此您可以查看 RSS 隨著時間的變化情形。透過系統追蹤應用程式啟用長期追蹤記錄。
- bugreport:顯示遊戲是否因記憶體不足而當機,或是因 LMK 而終止。使用
adb bugreport bugreport-name
指令,或依序前往「開發人員選項」>「錯誤報告」。
圖像
請使用下列工具評估及改善遊戲的顯示管道:
其他資源
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[null,null,["上次更新時間:2025-07-27 (世界標準時間)。"],[],[],null,["# Tools for optimizing your game\n\nTo prepare your environment for debugging and optimizing Android games, get\naccess to the following tools that help you analyze CPU usage and graphics\ncalls.\n\nCPU\n---\n\nUse the following tools to evaluate and improve your game's CPU performance:\n\n- **Systrace:** Records CPU and disk activity over a short period of time. [Access this tool from the command line](/topic/performance/tracing/command-line), or [use the on-device tool](/topic/performance/tracing/on-device) that's available when running Android 9 (API level 28) or higher. Also see the [overview of system tracing](/topic/performance/tracing).\n- **CPU Profiler:** Inspect your game's CPU usage and thread activity, either in real time or from recorded traces. See documentation on [how to access and use the CPU Profiler](/studio/profile) within Android Studio. A [standalone version of this profiler](/studio/profile#standalone-profilers) that doesn't require a Gradle project at launch is installed with both [Android Studio](/studio) and the [Android Game Development Extension](/games/agde).\n\nMemory\n------\n\n- **Meminfo:** Collects memory statistics to show how much [PSS memory](/topic/performance/memory-management#calculating_memory_footprint) was allocated and the categories for which it was used. Use the command `adb shell dumpsys meminfo `\u003cvar translate=\"no\"\u003epackage-name\u003c/var\u003e or the [`MemoryInfo`](/reference/android/os/Debug.MemoryInfo) call.\n- **Perfetto:** Collects performance and memory information on a device and displays it in a web-based UI. [Perfetto](https://docs.perfetto.dev) supports arbitrarily long traces so you can view how RSS changes over time. Enable long traces from the [System Tracing app](/topic/performance/tracing/on-device).\n- **bugreport:** Shows if your game crashed because it ran out of memory or if it was killed by the [LMK](/topic/performance/memory-management#low-memory_killer). Use the command `adb bugreport `\u003cvar translate=\"no\"\u003ebugreport-name\u003c/var\u003e or go to **Developer Options \\\u003e Bug report**.\n\nGraphics\n--------\n\nUse the following tools to evaluate and improve your game's display pipeline:\n\n- **Android Frame Pacing API:** Helps synchronize your game engine's rendering process with Android's display pipeline. [Download from the Android Open Source Project (AOSP)](https://android.googlesource.com/platform/frameworks/opt/gamesdk/), or [access the plugin from Unity 2019.2.0 Alpha 6](https://unity3d.com/unity/whats-new) or higher. Also [see documentation for the Android Frame Pacing API](/topic/performance/frame-pacing).\n- **Android GPU Inspector (AGI):** A GPU profiling tool. You can take traces of your games and find interesting performance insights to help you make graphics optimization decisions. [Learn more\n here.](/agi)\n\nAdditional resources\n--------------------\n\n- [Improve your game's performance](/games/optimize)\n- [GAPID](https://gapid.dev)"]]