パフォーマンスを検査する
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
パフォーマンスを検査することで、アプリで何が起こっているかを理解し、想定どおりであることを確認できます。
Android には、アプリのパフォーマンスを検査するために使用できるツールがいくつか用意されています。最初は、検査の際には一度に一つの領域に集中することをおすすめします。たとえば、次のような領域です。
- アプリの起動
- 遅いレンダリング(ジャンク)
- 画面遷移とナビゲーション イベント
- 長時間の実行
- I/O やネットワーキングなどのバックグラウンド処理
あるいは、アプリのワークフローのクリティカル ユーザー ジャーニーを検査することもできます。これにより、パフォーマンスが期待どおりでない領域を総合的に把握できます。
パフォーマンスの検査には、主に手動と自動の 2 つの方法があります。新しい領域を検査する際は、通常、手動デバッグから始めます。
手動検査
アプリのどの領域を検査するかが決まれば、さまざまなツールを使用して何が起こっているかを正確に特定できます。
Android 9 以降を搭載したデバイスでパフォーマンスを検査するための最も包括的なツールは、Perfetto です。Perfetto では、可能な限り詳細なトレース情報が提供されます。強力なフィルタを使用することで、必要に応じて詳細レベルを調整できます。Android デバイスからトレースをキャプチャする方法について詳しくは、クイックスタート: Android でトレースを記録するのガイドをご覧ください。
Android Studio に組み込まれている Android プロファイラを使用してもアプリのパフォーマンスに関する有用な分析情報を取得できます。その際、詳細レベルをご利用のアプリに限定することもできますし、バージョン 9 より前の Android を搭載したデバイスで実行することも可能です。
詳細については、システム トレースの概要、またはパフォーマンス デバッグに関する詳細な動画シリーズをご覧ください。
自動テスト
手動検査に加えて、自動テストをセットアップし、パフォーマンス データを収集して集計できます。これは、ユーザーに実際に何が表示されているかを理解し、いつ回帰が発生する可能性があるかを特定することに役立ちます。アプリの自動パフォーマンス テストのセットアップについて詳しくは、アプリのベンチマークを行うをご覧ください。
パフォーマンスを検査およびモニタリングしてアプリの改善をサポートするツールが複数用意されています。
Benchmark ライブラリを使用してローカルでパフォーマンスを把握する
本番環境のパフォーマンスを把握する
- Android Vitals は、各種のパフォーマンス指標が所定のしきい値を超えたときに通知するため、アプリのパフォーマンス改善に役立ちます。
- Firebase Performance SDK は、アプリのパフォーマンスに関するさまざまな指標を収集します。たとえば、この SDK を使用すると、ユーザーがアプリを開いてからアプリが応答可能になるまでの時間を測定して、起動時の潜在的なボトルネックを特定できます。
Android Studio を使用してローカルでプロファイルする
- Android Studio では、システム トレースまたはスタック サンプリング トレースの記録と確認が可能です。
- Android Studio を使用してトレースを記録できます。詳細は、パフォーマンス デバッグの動画シリーズをご覧ください。
- Android 用のネイティブ スタック サンプリング ツールである Simpleperf を使用して、Android アプリおよび Android 上で実行されているネイティブ プロセスをプロファイリングします。Android 上の Java コードと C++ コードの両方をプロファイリングできます。
高度なプロファイリング ツール: Perfetto のトレース
参考情報
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-07-27 UTC。
[[["わかりやすい","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 UTC。"],[],[],null,["# Inspect performance to help you understand what is happening in your app and\nensure it meets your expectations.\n\nAndroid provides several tools you can use to inspect your app's performance.\nWhen getting started, we recommend you focus on one area at a time during\ninspection. These areas can include the following:\n\n- App startup\n- Slow rendering (jank)\n- Screen transitions and navigation events\n- Long running work\n- Operations in the background, such as I/O and networking\n\nAlternatively, you can inspect critical user journeys of your app's workflow.\nThis can help you gain a holistic understanding of where performance and\nexpectations don't align.\n\nThere are two main approaches when inspecting performance, manual and automated.\nIt's likely that you start with manual debugging when inspecting a new area.\n\nManual inspection\n-----------------\n\nAfter deciding which area of your app to inspect, you can use a variety of tools\nto identify what exactly is happening.\n\nThe most comprehensive tool to inspect performance on devices running Android 9\nand higher is [Perfetto](https://perfetto.dev/). Perfetto provides the highest possible\ndetail of tracing information. By using powerful filters, you can adjust the\nlevel of detail for your needs. For more information about how to capture traces\nfrom Android devices, see the [Quickstart: Record traces on\nAndroid](https://perfetto.dev/docs/quickstart/android-tracing) guide.\n\nThe [Android profilers](/studio/profile) built into Android Studio can also provide valuable\ninsights into your app's performance, where you can limit the level of detail to\nyour app, or when running on devices earlier than Android\n9.\n\nFor more information, see [Overview of system tracing](/topic/performance/tracing) or watch the in-depth\nseries on [performance debugging](https://www.youtube.com/playlist?list=PLWz5rJ2EKKc-xjSI-rWn9SViXivBhQUnp).\n\nAutomated testing\n-----------------\n\nIn addition to manual inspection, you can set up automated tests to collect and\naggregate performance data. This helps you understand what users are actually\nseeing and identify when regressions might occur. For more information about\nsetting up automated performance tests for your app, see [Benchmark your\napp](/topic/performance/benchmarking/benchmarking-overview).\n\nApp startup performance\n-----------------------\n\nThere are multiple tools you can use to inspect and monitor performance to help\nimprove your app.\n\n### Understand performance locally with Benchmark libraries\n\n- The [Macrobenchmark library](/topic/performance/benchmarking/macrobenchmark-overview) helps you measure larger end-user interactions, such as startup, interacting with the UI, and animations.\n- The [Microbenchmark library](/topic/performance/benchmarking/microbenchmark-overview) helps analyze performance of more granular, app-specific situations.\n\n### Understand performance in production\n\n- [Android vitals](/topic/performance/vitals) can help improve your app's performance by alerting you when various performance metrics exceed predetermined thresholds.\n- The [Firebase performance SDK](https://firebase.google.com/docs/perf-mon/get-started-android) collects various metrics about your app's performance. For example, you can use the SDK to measure the time between when the user opens the app and when the app becomes responsive, helping identify potential startup bottlenecks.\n\n### Profile locally with Android Studio\n\n- Use [Android Studio](/studio/profile) to record and view system traces or stack sampling traces.\n- [Record traces](/studio/profile/record-traces) using Android Studio. For additional information, see the [Performance Debugging video series](https://www.youtube.com/playlist?list=PLWz5rJ2EKKc-xjSI-rWn9SViXivBhQUnp).\n- Use [Simpleperf](https://android.googlesource.com/platform/system/extras/+/master/simpleperf/doc/README.md), a native stack sampling tool for Android, to profile both Android apps and native processes running on Android. It can profile both Java and C++ code on Android.\n\n### Advanced profiling tools: Perfetto tracing\n\n- [Perfetto](https://perfetto.dev/): a platform-wide tracing tool available on Android 10 (API level 29) and higher. For more information, see the [overview of Perfetto traces](https://perfetto.dev/docs/).\n- [Run Perfetto using `adb`](/studio/command-line/perfetto): describes how to run the `perfetto` command-line tool to capture traces.\n- [Recording a trace through the cmdline](https://perfetto.dev/docs/quickstart/android-tracing#recording-a-trace-through-the-cmdline): describes how to build and run the `perfetto` command-line tool to capture traces.\n- [Perfetto web-based trace viewer](https://perfetto.dev/docs/quickstart/android-tracing#recording-a-trace-through-the-perfetto-ui): opens Perfetto traces and displays a complete report. You can also open [Systrace](/topic/performance/tracing) traces in this viewer using the legacy UI option.\n\nAdditional resources\n--------------------\n\n- [Performance debugging - MAD skills series](https://www.youtube.com/playlist?list=PLWz5rJ2EKKc-xjSI-rWn9SViXivBhQUnp)\n- [Profile your app performance](/studio/profile)\n- [Write a Macrobenchmark](/topic/performance/benchmarking/macrobenchmark-overview)\n- [Microbenchmark](/topic/performance/benchmarking/microbenchmark-overview)"]]