GceAvdInfo
public class GceAvdInfo
extends Object
java.lang.Object | |
↳ | com.android.tradefed.device.cloud.GceAvdInfo |
用於保存給定 GCE AVD 實例的相關數據的結構。
概括
嵌套類 | |
---|---|
enum | GceAvdInfo.GceStatus |
class | GceAvdInfo.LogFileEntry
|
領域 | |
---|---|
public static final | BUILD_VARS
|
公共構造函數 | |
---|---|
GceAvdInfo (String instanceName, HostAndPort hostAndPort) | |
GceAvdInfo (String instanceName, HostAndPort hostAndPort, ErrorIdentifier errorType, String errors, GceAvdInfo.GceStatus status) |
公共方法 | |
---|---|
getBuildVars () 返回 GCE AVD 設備的構建變量信息哈希。 | |
Integer | getDeviceOffset () |
ErrorIdentifier | getErrorType () |
String | getErrors () |
String | getInstanceUser () |
getLogs () 將映射從本地或遠程日誌路徑返回到類型。 | |
GceAvdInfo.GceStatus | getStatus () |
HostAndPort | hostAndPort () |
String | instanceName () |
boolean | isIpPreconfigured () |
static GceAvdInfo | parseGceInfoFromFile (File f, DeviceDescriptor descriptor, int remoteAdbPort) 解析給定文件以獲取 GCE AVD 設備信息。 |
static | parseGceInfoFromOxygenClientOutput ( CommandResult oxygenRes, int remoteAdbPort) 解析 Oxygen 客戶端二進製文件的給定命令行輸出以獲取租用的 AVD 信息。 |
static GceAvdInfo | parseGceInfoFromString (String data, DeviceDescriptor descriptor, int remoteAdbPort) 解析給定的字符串以獲取 GCE AVD 設備信息。 |
void | setDeviceOffset (Integer deviceOffset) |
void | setInstanceUser (String instanceUser) |
void | setIpPreconfigured (boolean isIpPreconfigured) |
void | setStatus ( GceAvdInfo.GceStatus status) |
String | toString ()
|
領域
構建變量
public static finalBUILD_VARS
公共構造函數
GceAvdInfo
public GceAvdInfo (String instanceName, HostAndPort hostAndPort)
參數 | |
---|---|
instanceName | String |
hostAndPort | HostAndPort |
GceAvdInfo
public GceAvdInfo (String instanceName, HostAndPort hostAndPort, ErrorIdentifier errorType, String errors, GceAvdInfo.GceStatus status)
參數 | |
---|---|
instanceName | String |
hostAndPort | HostAndPort |
errorType | ErrorIdentifier |
errors | String |
status | GceAvdInfo.GceStatus |
公共方法
getBuildVars
publicgetBuildVars ()
返回 GCE AVD 設備的構建變量信息哈希。
BUILD_VARS 中描述了可能的構建變量鍵,例如:build_id、build_target、branch、kernel_build_id、kernel_build_target、kernel_branch、system_build_id、system_build_target、system_branch、emulator_build_id、emulator_build_target、emulator_branch。
退貨 | |
---|---|
獲取設備偏移量
public Integer getDeviceOffset ()
退貨 | |
---|---|
Integer |
得到錯誤
public String getErrors ()
退貨 | |
---|---|
String |
獲取實例用戶
public String getInstanceUser ()
退貨 | |
---|---|
String |
獲取日誌
publicgetLogs ()
將映射從本地或遠程日誌路徑返回到類型。
退貨 | |
---|---|
主機和端口
public HostAndPort hostAndPort ()
退貨 | |
---|---|
HostAndPort |
實例名稱
public String instanceName ()
退貨 | |
---|---|
String |
isIpPreconfigured
public boolean isIpPreconfigured ()
退貨 | |
---|---|
boolean |
解析GceInfoFromFile
public static GceAvdInfo parseGceInfoFromFile (File f, DeviceDescriptor descriptor, int remoteAdbPort)
解析給定文件以獲取 GCE AVD 設備信息。
參數 | |
---|---|
f | File : ERROR(/File) 文件,用於從 GCE 驅動程序讀取 JSON 輸出。 |
descriptor | DeviceDescriptor :需要信息的設備的描述符。 |
remoteAdbPort | int :應該用於 adb 連接的遠程端口 |
退貨 | |
---|---|
GceAvdInfo | 如果找到設備的GceAvdInfo ,如果有錯誤則為 null。 |
投擲 | |
---|---|
TargetSetupError |
parseGceInfoFromOxygenClientOutput
public staticparseGceInfoFromOxygenClientOutput (CommandResult oxygenRes, int remoteAdbPort)
解析 Oxygen 客戶端二進製文件的給定命令行輸出以獲取租用的 AVD 信息。
參數 | |
---|---|
oxygenRes | CommandResult :來自 Oxygen 客戶端命令執行的CommandResult 。 |
remoteAdbPort | int :應該用於 adb 連接的遠程端口 |
退貨 | |
---|---|
成功租用設備的ERROR(/List) 。如果租用設備失敗,將拋出TargetSetupError 。 |
投擲 | |
---|---|
TargetSetupError |
parseGceInfoFromString
public static GceAvdInfo parseGceInfoFromString (String data, DeviceDescriptor descriptor, int remoteAdbPort)
解析給定的字符串以獲取 GCE AVD 設備信息。
參數 | |
---|---|
data | String :JSON 字符串。 |
descriptor | DeviceDescriptor :需要信息的設備的描述符。 |
remoteAdbPort | int :應該用於 adb 連接的遠程端口 |
退貨 | |
---|---|
GceAvdInfo | 如果找到設備的GceAvdInfo ,如果有錯誤則為 null。 |
投擲 | |
---|---|
TargetSetupError |
設置設備偏移量
public void setDeviceOffset (Integer deviceOffset)
參數 | |
---|---|
deviceOffset | Integer |
設置實例用戶
public void setInstanceUser (String instanceUser)
參數 | |
---|---|
instanceUser | String |
setIpPreconfigured
public void setIpPreconfigured (boolean isIpPreconfigured)
參數 | |
---|---|
isIpPreconfigured | boolean |
到字符串
public String toString ()
退貨 | |
---|---|
String |
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2023-01-10 (世界標準時間)。
[]
[]