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返回GceAvdInfo

GceSshTunnelMonitor getGceSshMonitor ()

返回設備的GceSshTunnelMonitor

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)

嘗試對 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

公共方法

獲取AVD信息

public GceAvdInfo getAvdInfo ()

從創建的遠程VM返回GceAvdInfo 。無論狀態如何都會返回,以便我們可以檢查信息。

退貨
GceAvdInfo

獲取GceSshMonitor

public GceSshTunnelMonitor getGceSshMonitor ()

返回設備的GceSshTunnelMonitor

退貨
GceSshTunnelMonitor

獲取Ssh錯誤報告

public void getSshBugreport ()

通過直接 ssh 連接到設備來捕獲遠程錯誤報告。

獲取墓碑

public  getTombstones ()

Cuttlefish 有一個特殊功能,可以將墓碑帶到遠程主機,我們可以直接獲取它們。

退貨

初始化連接

public void initializeConnection ()

初始化設備的連接。

投擲
DeviceNotAvailableException
TargetSetupError

通知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)

嘗試對 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