- 語法:
<instrumentation android:functionalTest=["true" | "false"] android:handleProfiling=["true" | "false"] android:icon="drawable resource" android:label="string resource" android:name="string" android:targetPackage="string" android:targetProcesses="string" />
- 包含於:
<manifest>
- 說明:
- 宣告
Instrumentation
類別,您可以透過此類別監控應用程式與系統互動的情況。Instrumentation
物件會在應用程式的任何元件之前例項化。 - 屬性:
android:functionalTest
- 指出
Instrumentation
類別是否會做為功能測試執行。如果是,則為true
;如果不是,則為false
。預設值為false
。 android:handleProfiling
- 指定
Instrumentation
物件是否會開啟及關閉剖析功能。如果物件能判定剖析的開始和停止時間,則設為true
;如果剖析在物件執行全程持續進行,則設為false
。true
值可讓物件對一組特定作業進行剖析作業。預設值為false
。 android:icon
- 代表
Instrumentation
類別的圖示。此屬性必須設為對某可繪製資源的參照。 android:label
- 使用者可理解的
Instrumentation
類別標籤。標籤可設為原始字串或對字串資源的參照。 android:name
Instrumentation
子類別的名稱。請使用完整的類別名稱,例如com.example.project.StringInstrumentation
。不過為了精簡起見,如果名稱的第一個字元是半形句號,則會加到<manifest>
元素中所指定套件名稱的後方。這項屬性沒有預設值。您必須指定名稱。
android:targetPackage
- 指定
Instrumentation
物件將針對哪個應用程式執行。標識應用程式時,請以資訊清單檔案中<manifest>
元素指派的套件名稱做為依據。 android:targetProcesses
指定
Instrumentation
物件將針對哪些程序執行。逗號分隔清單表示將針對這些具體程序執行執行檢測作業。"*"
值表示將針對應用程式 (於android:targetPackage
中定義) 的所有程序執行檢測作業。如果資訊清單中未提供這個值,則系統只會針對
android:targetPackage
中定義的應用程式,執行主要程序的檢測作業。這是在 API 級別 26 中新增的屬性。
- 導入版本:
- API 級別 1
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2023-03-31 (世界標準時間)。
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"缺少我需要的資訊"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"過於複雜/步驟過多"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"過時"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻譯問題"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"示例/程式碼問題"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"容易理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"確實解決了我的問題"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]