系統工具
public class SystemUtil
extends Object
java.lang.Object | |
↳ | com.android.tradefed.util.SystemUtil |
用於進行系統呼叫的實用程式類別。
概括
嵌套類 | |
---|---|
enum | SystemUtil.EnvVariable
|
領域 | |
---|---|
public static final | ENV_VARIABLE_PATHS_IN_TESTS_DIR 追蹤變數到測試目錄中所採用的子路徑的對應。 |
public static final String | REMOTE_VM_VARIABLE
|
公共構造函數 | |
---|---|
SystemUtil () |
公共方法 | |
---|---|
static File | getExternalTestCasesDir ( SystemUtil.EnvVariable envVariable) 取得與 env 關聯的文件。 |
static | getExternalTestCasesDirs () 取得指向 Tradefed 外部測試目錄的 |
static File | getProductOutputDir () 從 Android 建置樹取得產品特定的輸出目錄。 |
static File | getRunningJavaBinaryPath () 傳回目前測試工具正在運行的 Java 二進位檔案的路徑 |
static | getTestCasesDirs (IBuildInfo buildInfo) 取得測試用例目錄的 |
static boolean | isRemoteEnvironment () 如果我們目前正在遠端環境中運行,則傳回 true。 |
領域
ENV_VARIABLE_PATHS_IN_TESTS_DIR
public static finalENV_VARIABLE_PATHS_IN_TESTS_DIR
追蹤變數到測試目錄中所採用的子路徑的對應。
遠端虛擬機器變數
public static final String REMOTE_VM_VARIABLE
公共構造函數
系統工具
public SystemUtil ()
公共方法
取得外部測試用例目錄
public static File getExternalTestCasesDir (SystemUtil.EnvVariable envVariable)
取得與 env 關聯的文件。多變的。
參數 | |
---|---|
envVariable | SystemUtil.EnvVariable :ANDROID_TARGET_OUT_TESTCASES 或 ANDROID_HOST_OUT_TESTCASES |
退貨 | |
---|---|
File | 關聯的目錄。 |
取得產品輸出目錄
public static File getProductOutputDir ()
從 Android 建置樹取得產品特定的輸出目錄。通常,此位置包含各種裝置分割區、開機載入程式、無線電等的映像。
注意:該方法不保證該路徑存在。
退貨 | |
---|---|
File | 輸出目錄的位置,如果目前版本不是,則為null |
取得RunningJavaBinaryPath
public static File getRunningJavaBinaryPath ()
傳回目前測試工具正在運行的 Java 二進位檔案的路徑
退貨 | |
---|---|
File |
取得測試用例目錄
public staticgetTestCasesDirs (IBuildInfo buildInfo)
取得測試用例目錄的ERROR(/File)
列表
參數 | |
---|---|
buildInfo | IBuildInfo :建置工件資訊。如果建置資訊不可用或不需要從建置資訊取得測試案例目錄,則將其設為 null。 |
退貨 | |
---|---|
基於環境變數的值和給定的建置訊息,建構輸出的測試案例資料夾的目錄ERROR(/File) 列表。 |
是遠端環境
public static boolean isRemoteEnvironment ()
如果我們目前正在遠端環境中運行,則傳回 true。
退貨 | |
---|---|
boolean |
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2023-12-01 (世界標準時間)。
[{
"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":"其他"
}]