- 構文:
<profileable android:shell=["true" | "false"] android:enabled=["true" | "false"] />
- 上位の要素:
<application>
- 説明:
- プロファイラがこのアプリにアクセスする方法を指定します。
- 属性:
android:shell
-
デバイスのユーザーが、次のようなローカル デバッグツールでこのアプリをプロファイリングできるかどうかを指定します。
android.os.Trace
トレース API(Android 11 以前)simpleperf
am profile
コマンドperfetto
プロファイラ(ネイティブ メモリ、Java メモリ、CPU)
false
に設定されている場合、こうしたツールや API は、アプリがdebuggable
である場合にのみ機能します。デバッグ可能なアプリはパフォーマンスを著しく低下させるため、タイミングを正確に測定するうえで有用ではありません。正確な結果を得るために、この要素はローカルのパフォーマンス測定に使用することを強くおすすめします。この要素は、リリースビルドや製品版ビルドでローカル プロファイリングを可能にするために設計されています。ホスト プロファイリング ツールやシェルプロセスでメモリデータを読み取ることができないため、データ漏洩のリスクを低減できます。読み取りできるのはスタック トレースのみですが、これは通常、リリースビルドで難読化されているかシンボルが欠落しています。
android:enabled
-
アプリをシステム サービスまたはシェルツールでプロファイリングできるかどうかを指定します。シェルツールの場合は
android:shell
も設定します。false の場合、アプリのプロファイリングは一切できません。デフォルトは true です。 この属性は API レベル 30 で追加されました。
- 導入時の API レベル:
- API レベル 29
<profileable>
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。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,["# <profileable\u003e\n\nsyntax:\n:\n\n ```xml\n \u003cprofileable android:shell=[\"true\" | \"false\"] android:enabled=[\"true\" | \"false\"] /\u003e\n ```\n\ncontained in:\n: [\u003capplication\u003e](/guide/topics/manifest/application-element)\n\ndescription:\n: Specifies how profilers can access this application.\n\nattributes:\n:\n\n `android:shell`\n :\n Specifies whether the user of the device can profile this application through local debugging\n tools such as the following:\n\n - [android.os.Trace](/reference/kotlin/android/os/Trace) tracing APIs (Android 11 and lower)\n - [simpleperf](/ndk/guides/simpleperf)\n - [am profile](/studio/command-line/adb#am) commands\n - [`perfetto` profilers](/studio/command-line/perfetto) (native memory, Java memory, CPU)\n\n\n If this isn't set, or is set to `false`, these tools and APIs work only when an app is\n [debuggable](/guide/topics/manifest/application-element#debug).\n Debuggable apps incur significant and varied performance degradation and aren't useful for\n measuring timing accurately. This element is strongly recommended for local performance\n measurements, to capture accurate results.\n\n This element is designed to be usable in release, or production, builds to enable local profiling.\n It incurs minimal risk of data exposure: no memory data is readable by the host profiling tools\n and the shell process. Only stack traces are readable, which are typically obfuscated or lacking symbols\n in release builds.\n\n:\n\n `android:enabled`\n :\n Specifies whether the application can be profiled by system services or shell tools.\n For the latter, you also set [`android:shell`](#shell).\n If false, the application can't be profiled at all. The default is true.\n\n This attribute was added in API level 30.\n\nintroduced in:\n: API Level 29"]]