AdbSshConnection
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)
|
公用方法 | |
---|---|
CommandResult
|
deleteSnapshotGce(String user, String snapshotId)
嘗試刪除 Cuttlefish 執行個體的快照 |
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)
檢查通道監控器是否正在執行。 |
公用建構函式
AdbSshConnection
public AdbSshConnection (DefaultConnection.ConnectionBuilder builder)
參數 | |
---|---|
builder |
DefaultConnection.ConnectionBuilder |
公用方法
deleteSnapshotGce
public CommandResult deleteSnapshotGce (String user, String snapshotId)
嘗試刪除 Cuttlefish 執行個體的快照
參數 | |
---|---|
user |
String :AVD 的執行中主機使用者,如果不適用,則為 null 。 |
snapshotId |
String |
傳回 | |
---|---|
CommandResult |
傳回刪除快照嘗試的 CommandResult |
擲回 | |
---|---|
|
com.android.tradefed.targetprep.TargetSetupError |
TargetSetupError |
getAvdInfo
public GceAvdInfo getAvdInfo ()
傳回已建立的遠端 VM 中的 GceAvdInfo
。無論狀態為何,都能傳回,以便我們檢查資訊。
傳回 | |
---|---|
GceAvdInfo |
getGceTunnelMonitor
public AbstractTunnelMonitor getGceTunnelMonitor ()
傳回裝置的 AbstractTunnelMonitor
。
傳回 | |
---|---|
AbstractTunnelMonitor |
getSshBugreport
public void getSshBugreport ()
直接透過 SSH 連線至裝置,擷取遠端錯誤報告。
getTombstones
publicgetTombstones ()
Cuttlefish 有特殊功能,可將墓碑符號帶到遠端主機,讓我們直接取得這些符號。
傳回 | |
---|---|
|
initializeConnection
public void initializeConnection ()
初始化裝置的連線。
擲回 | |
---|---|
DeviceNotAvailableException |
|
TargetSetupError |
notifyAdbRebootCalled
public void notifyAdbRebootCalled ()
在呼叫 doAdbReboot 時通知。
恢復原廠設定
public CommandResult powerwash ()
嘗試執行 GCE 執行個體的 Powerwash
傳回 | |
---|---|
CommandResult |
傳回 Powerwash 嘗試的 CommandResult |
擲回 | |
---|---|
|
com.android.tradefed.targetprep.TargetSetupError |
TargetSetupError |
powerwashGce
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 |
reconnect
public void reconnect (String serial)
重新連結裝置。
參數 | |
---|---|
serial |
String :裝置序號。 |
擲回 | |
---|---|
DeviceNotAvailableException |
reconnectForRecovery
public void reconnectForRecovery (String serial)
重新連線至裝置,執行復原例行程。
參數 | |
---|---|
serial |
String :裝置序號。 |
擲回 | |
---|---|
DeviceNotAvailableException |
restoreSnapshotGce
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 |
snapshotGce
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 |
tearDownConnection
public void tearDownConnection ()
清理連線。
受保護的方法
getCurrentTime
protected long getCurrentTime ()
傳回目前的系統時間。公開測試。
傳回 | |
---|---|
long |
launchGce
protected void launchGce (IBuildInfo buildInfo, MultiMap<String, String> attributes)
根據建構資訊啟動實際的 gce 裝置。
參數 | |
---|---|
buildInfo |
IBuildInfo |
attributes |
MultiMap |
擲回 | |
---|---|
TargetSetupError |
waitForTunnelOnline
protected void waitForTunnelOnline (long waitTime)
檢查通道監控器是否正在執行。
參數 | |
---|---|
waitTime |
long |
擲回 | |
---|---|
DeviceNotAvailableException |