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 和/或其关联公司的注册商标。
Last updated 2023-01-10 UTC.
[]
[]