- 語法:
<profileable android:shell=["true" | "false"] android:enabled=["true" | "false"] />
- 包含於:
<application>
- 說明:
- 指定分析器如何存取這個應用程式。
- 屬性:
android:shell
- 指定裝置使用者是否能透過本機偵錯工具剖析這個應用程式。工具包括
android.os.Trace
追蹤 API (Android 11 以下版本)simpleperf
am profile
指令perfetto profilers
(原生記憶體、Java 記憶體、CPU)。
false
,這些工具和 API 就只會在應用程式處於debuggable
狀態時運作。可進行偵錯的應用程式會造成各種效能明顯降低的問題,對準確評估時間並無幫助。強烈建議您使用此元素進行本機效能評估,以獲得準確結果。
android:enabled
- 指定系統服務或殼層工具 (如果是後者,您還必須設定
android:shell
) 是否能剖析應用程式。如果設為 false,就完全無法剖析應用程式。預設值為 true。這項屬性於 API 級別 30 中新增。
- 導入版本:
- API 級別 29
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2022-05-04 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"Translation issue"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]