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返回 |
AbstractTunnelMonitor | getGceTunnelMonitor () 返回設備的 |
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 | snapshotGce (String user, Integer offset, String snapshotId) 嘗試對 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 |
公共方法
取得GceTunnelMonitor
public AbstractTunnelMonitor getGceTunnelMonitor ()
返回設備的AbstractTunnelMonitor
。
退貨 | |
---|---|
AbstractTunnelMonitor |
取得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 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 |
拆解連接
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 |