<檢測>

語法:
<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;如果剖析在物件執行全程持續進行,則設為 falsetrue 值可讓物件對一組特定作業進行剖析作業。預設值為 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