AdbSSH连接
public class AdbSshConnection
extends AdbTcpConnection
java.lang.Object | ||||
↳ | com.android.tradefed.device.connection.AbstractConnection | |||
↳ | com.android.tradefed.device.connection.DefaultConnection | |||
↳ | com.android.tradefed.device.connection.AdbTcpConnection | |||
↳ | com.android.tradefed.device.connection.AdbSshConnection |
通过 ssh 桥的 Adb 连接。
概括
公共构造函数 | |
---|---|
AdbSshConnection ( DefaultConnection.ConnectionBuilder builder) |
公共方法 | |
---|---|
GceAvdInfo | getAvdInfo () 从创建的远程VM返回 |
GceSshTunnelMonitor | getGceSshMonitor () 返回设备的 |
void | getSshBugreport () 通过直接 ssh 连接到设备来捕获远程错误报告。 |
getTombstones () Cuttlefish 有一个特殊功能,可以将墓碑带到远程主机,我们可以直接获取它们。 | |
void | initializeConnection () 初始化设备的连接。 |
void | notifyAdbRebootCalled () 调用 doAdbReboot 时发出通知。 |
CommandResult | powerwash () 尝试对 GCE 实例进行 Powerwash |
CommandResult | powerwashGce (String user, Integer offset) 尝试对 GCE 实例进行 Powerwash |
void | reconnect (String serial) 重新连接到设备。 |
void | reconnectForRecovery (String serial) 重新连接到设备以进行恢复例程。 |
CommandResult | restoreSnapshotGce (String user, Integer offset, String snapshotId) 尝试恢复 Cuttlefish 实例的快照 |
CommandResult | resumeGce (String user, Integer offset) 尝试恢复 Cuttlefish 实例 |
CommandResult | snapshotGce (String user, Integer offset, String snapshotId) 尝试对 Cuttlefish 实例进行快照 |
CommandResult | stopGce (String user, Integer offset) 尝试停止 Cuttlefish 实例 |
CommandResult | suspendGce (String user, Integer offset) 尝试暂停 Cuttlefish 实例 |
void | tearDownConnection () 清理连接。 |
受保护的方法 | |
---|---|
long | getCurrentTime () 返回当前系统时间。 |
void | launchGce ( IBuildInfo buildInfo, MultiMap <String, String> attributes) 根据构建信息启动实际的 gce 设备。 |
void | waitForTunnelOnline (long waitTime) 检查隧道监视器是否正在运行。 |
公共构造函数
AdbSSH连接
public AdbSshConnection (DefaultConnection.ConnectionBuilder builder)
参数 | |
---|---|
builder | DefaultConnection.ConnectionBuilder |
公共方法
获取GceSshMonitor
public GceSshTunnelMonitor getGceSshMonitor ()
返回设备的GceSshTunnelMonitor
。
退货 | |
---|---|
GceSshTunnelMonitor |
获取Ssh错误报告
public void getSshBugreport ()
通过直接 ssh 连接到设备来捕获远程错误报告。
获取墓碑
publicgetTombstones ()
Cuttlefish 有一个特殊功能,可以将墓碑带到远程主机,我们可以直接获取它们。
退货 | |
---|---|
通知AdbRebootCalled
public void notifyAdbRebootCalled ()
调用 doAdbReboot 时发出通知。
强力清洗
public CommandResult powerwash ()
尝试对 GCE 实例进行 Powerwash
退货 | |
---|---|
CommandResult | 返回 powerwash 尝试的 CommandResult |
投掷 | |
---|---|
| com.android.tradefed.targetprep.TargetSetupError |
TargetSetupError |
强力清洗Gce
public CommandResult powerwashGce (String user, Integer offset)
尝试对 GCE 实例进行 Powerwash
参数 | |
---|---|
user | String : AVD的主机运行用户,如果不适用则为null 。 |
offset | Integer : AVD 在主机中的设备编号偏移量,如果不适用则为null |
退货 | |
---|---|
CommandResult | 返回 powerwash 尝试的 CommandResult |
投掷 | |
---|---|
| com.android.tradefed.targetprep.TargetSetupError |
TargetSetupError |
重新连接
public void reconnect (String serial)
重新连接到设备。
参数 | |
---|---|
serial | String :设备序列号。 |
投掷 | |
---|---|
DeviceNotAvailableException |
重新连接以恢复
public void reconnectForRecovery (String serial)
重新连接到设备以进行恢复例程。
参数 | |
---|---|
serial | String :设备序列号。 |
投掷 | |
---|---|
DeviceNotAvailableException |
恢复快照Gce
public CommandResult restoreSnapshotGce (String user, Integer offset, String snapshotId)
尝试恢复 Cuttlefish 实例的快照
参数 | |
---|---|
user | String : AVD的主机运行用户,如果不适用则为null 。 |
offset | Integer : AVD 在主机中的设备编号偏移量,如果不适用则为null |
snapshotId | String : 快照 ID |
退货 | |
---|---|
CommandResult | 返回恢复快照尝试的 CommandResult |
投掷 | |
---|---|
| com.android.tradefed.targetprep.TargetSetupError |
TargetSetupError |
简历Gce
public CommandResult resumeGce (String user, Integer offset)
尝试恢复 Cuttlefish 实例
参数 | |
---|---|
user | String : AVD的主机运行用户,如果不适用则为null 。 |
offset | Integer : AVD 在主机中的设备编号偏移量,如果不适用则为null |
退货 | |
---|---|
CommandResult | 返回恢复尝试的 CommandResult |
投掷 | |
---|---|
| com.android.tradefed.targetprep.TargetSetupError |
TargetSetupError |
快照Gce
public CommandResult snapshotGce (String user, Integer offset, String snapshotId)
尝试对 Cuttlefish 实例进行快照
参数 | |
---|---|
user | String : AVD的主机运行用户,如果不适用则为null 。 |
offset | Integer : AVD 在主机中的设备编号偏移量,如果不适用则为null |
snapshotId | String |
退货 | |
---|---|
CommandResult | 返回快照尝试的 CommandResult |
投掷 | |
---|---|
| com.android.tradefed.targetprep.TargetSetupError |
TargetSetupError |
停止Gce
public CommandResult stopGce (String user, Integer offset)
尝试停止 Cuttlefish 实例
参数 | |
---|---|
user | String : AVD的主机运行用户,如果不适用则为null 。 |
offset | Integer : AVD 在主机中的设备编号偏移量,如果不适用则为null |
退货 | |
---|---|
CommandResult | 返回停止尝试的 CommandResult |
投掷 | |
---|---|
| com.android.tradefed.targetprep.TargetSetupError |
TargetSetupError |
暂停Gce
public CommandResult suspendGce (String user, Integer offset)
尝试暂停 Cuttlefish 实例
参数 | |
---|---|
user | String : AVD的主机运行用户,如果不适用则为null 。 |
offset | Integer : AVD 在主机中的设备编号偏移量,如果不适用则为null |
退货 | |
---|---|
CommandResult | 返回暂停尝试的 CommandResult |
投掷 | |
---|---|
| com.android.tradefed.targetprep.TargetSetupError |
TargetSetupError |
拆解连接
public void tearDownConnection ()
清理连接。
受保护的方法
获取当前时间
protected long getCurrentTime ()
返回当前系统时间。暴露进行测试。
退货 | |
---|---|
long |
启动Gce
protected void launchGce (IBuildInfo buildInfo, MultiMap<String, String> attributes)
根据构建信息启动实际的 gce 设备。
参数 | |
---|---|
buildInfo | IBuildInfo |
attributes | MultiMap |
投掷 | |
---|---|
TargetSetupError |
等待隧道在线
protected void waitForTunnelOnline (long waitTime)
检查隧道监视器是否正在运行。
参数 | |
---|---|
waitTime | long |
投掷 | |
---|---|
DeviceNotAvailableException |