存根設備

public class StubDevice
extends Object implements IDevice

java.lang.Object
com.android.tradefed.device.StubDevice


IDevice的存根佔位符實作。

概括

公共構造函數

StubDevice (String serial)
StubDevice (String serial, boolean isEmulator)

公共方法

boolean arePropertiesSet ()

void createForward (int localPort, String remoteSocketName, IDevice.DeviceUnixSocketNamespace namespace)

void createForward (int localPort, int remotePort)

void createReverse (int remotePort, int localPort)

void executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeToOutputResponse, TimeUnit maxTimeUnits)

void executeShellCommand (String command, IShellOutputReceiver receiver)

void executeShellCommand (String command, IShellOutputReceiver receiver, int maxTimeToOutputResponse)

此方法已被棄用。使用executeShellCommand(String, com.android.ddmlib.IShellOutputReceiver, long, TimeUnit)

void executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeout, long maxTimeToOutputResponse, TimeUnit maxTimeUnits)

getAbis ()

String getAvdName ()

String getAvdPath ()

getBattery (long freshnessTime, TimeUnit timeUnit)

getBattery ()

Integer getBatteryLevel (long freshnessMs)

此方法已被棄用。使用getBattery(long, TimeUnit)代替。

Integer getBatteryLevel ()

此方法已被棄用。使用getBattery()代替。

Client getClient (String applicationName)

String getClientName (int pid)

Client[] getClients ()

int getDensity ()

FileListingService getFileListingService ()

String getLanguage ()

String getMountPoint (String name)

String getName ()

getProperties ()

此方法已被棄用。請改用getSystemProperty(String)

String getProperty (String name)

String getPropertyCacheOrSync (String name)

此方法已被棄用。使用getProperty(String)代替。

int getPropertyCount ()

此方法已被棄用。在 ddmlib 中已棄用,原因是「實作細節」。

String getPropertySync (String name)

此方法已被棄用。使用getProperty(String)代替。

String getRegion ()

RawImage getScreenshot ()

RawImage getScreenshot (long timeout, TimeUnit unit)
String getSerialNumber ()

IDevice.DeviceState getState ()

SyncService getSyncService ()

ListenableFuture<String> getSystemProperty (String name)

AndroidVersion getVersion ()

boolean hasClients ()

void installPackage (String packageFilePath, boolean reinstall, InstallReceiver receiver, long maxTimeout, long maxTimeToOutputResponse, TimeUnit maxTimeUnits, String... extraArgs)

void installPackage (String packageFilePath, boolean reinstall, InstallReceiver receiver, String... extraArgs)

void installPackage (String packageFilePath, boolean reinstall, String... extraArgs)

void installPackages ( apkFilePaths, boolean reinstall, extraArgs, long timeOutInMs, TimeUnit timeunit) installPackages ( apkFilePaths, boolean reinstall, extraArgs, long timeOutInMs, TimeUnit timeunit) installPackages ( apkFilePaths, boolean reinstall, extraArgs, long timeOutInMs, TimeUnit timeunit)

void installRemotePackage (String remoteFilePath, boolean reinstall, InstallReceiver receiver, String... extraArgs)

void installRemotePackage (String remoteFilePath, boolean reinstall, String... extraArgs)

void installRemotePackage (String remoteFilePath, boolean reinstall, InstallReceiver receiver, long maxTimeout, long maxTimeToOutputResponse, TimeUnit maxTimeUnits, String... extraArgs)

boolean isBootLoader ()

boolean isEmulator ()

boolean isOffline ()

boolean isOnline ()

boolean isRoot ()

void pullFile (String remote, String local)

void pushFile (String local, String remote)

void reboot (String into)

void removeForward (int localPort)

void removeForward (int localPort, int remotePort)

void removeForward (int localPort, String remoteSocketName, IDevice.DeviceUnixSocketNamespace namespace)

void removeRemotePackage (String remoteFilePath)

void removeReverse (int remotePort)

boolean root ()

void runEventLogService (LogReceiver receiver)

void runLogService (String logname, LogReceiver receiver)

void setSerial (String serial)
void startScreenRecorder (String remoteFilePath, ScreenRecorderOptions options, IShellOutputReceiver receiver)

boolean supportsFeature (IDevice.HardwareFeature arg0)
boolean supportsFeature (IDevice.Feature feature)

String syncPackageToDevice (String localFilePath)

String uninstallApp (String applicationID, String... extraArgs)

String uninstallPackage (String packageName)

公共構造函數

存根設備

public StubDevice (String serial)

參數
serial String

存根設備

public StubDevice (String serial, 
                boolean isEmulator)

參數
serial String

isEmulator boolean

公共方法

是屬性集

public boolean arePropertiesSet ()

退貨
boolean

建立轉發

public void createForward (int localPort, 
                String remoteSocketName, 
                IDevice.DeviceUnixSocketNamespace namespace)

參數
localPort int

remoteSocketName String

namespace IDevice.DeviceUnixSocketNamespace

投擲
AdbCommandRejectedException
TimeoutException

建立轉發

public void createForward (int localPort, 
                int remotePort)

參數
localPort int

remotePort int

投擲
AdbCommandRejectedException
TimeoutException

建立反向

public void createReverse (int remotePort, 
                int localPort)

參數
remotePort int

localPort int

投擲
AdbCommandRejectedException
TimeoutException

執行Shell命令

public void executeShellCommand (String command, 
                IShellOutputReceiver receiver, 
                long maxTimeToOutputResponse, 
                TimeUnit maxTimeUnits)

參數
command String

receiver IShellOutputReceiver

maxTimeToOutputResponse long

maxTimeUnits TimeUnit

投擲
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

執行Shell命令

public void executeShellCommand (String command, 
                IShellOutputReceiver receiver)

參數
command String

receiver IShellOutputReceiver

投擲
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

執行Shell命令

public void executeShellCommand (String command, 
                IShellOutputReceiver receiver, 
                int maxTimeToOutputResponse)

此方法已被棄用。
使用executeShellCommand(String, com.android.ddmlib.IShellOutputReceiver, long, TimeUnit)

參數
command String

receiver IShellOutputReceiver

maxTimeToOutputResponse int

投擲
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

執行Shell命令

public void executeShellCommand (String command, 
                IShellOutputReceiver receiver, 
                long maxTimeout, 
                long maxTimeToOutputResponse, 
                TimeUnit maxTimeUnits)

參數
command String

receiver IShellOutputReceiver

maxTimeout long

maxTimeToOutputResponse long

maxTimeUnits TimeUnit

投擲
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

取得阿比斯

public  getAbis ()

退貨

取得AVD名稱

public String getAvdName ()

退貨
String

取得AVD路徑

public String getAvdPath ()

退貨
String

取得電池

public  getBattery (long freshnessTime, 
                TimeUnit timeUnit)

參數
freshnessTime long

timeUnit TimeUnit

退貨

取得電池

public  getBattery ()

退貨

取得電池電量

public Integer getBatteryLevel (long freshnessMs)

此方法已被棄用。
使用getBattery(long, TimeUnit)代替。

參數
freshnessMs long

退貨
Integer

投擲
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

取得電池電量

public Integer getBatteryLevel ()

此方法已被棄用。
使用getBattery()代替。

退貨
Integer

投擲
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

獲取客戶端

public Client getClient (String applicationName)

參數
applicationName String

退貨
Client

取得客戶端名稱

public String getClientName (int pid)

參數
pid int

退貨
String

獲取客戶

public Client[] getClients ()

退貨
Client[]

取得密度

public int getDensity ()

退貨
int

取得文件列表服務

public FileListingService getFileListingService ()

退貨
FileListingService

獲取言語

public String getLanguage ()

退貨
String

取得掛載點

public String getMountPoint (String name)

參數
name String

退貨
String

取得名稱

public String getName ()

退貨
String

取得屬性

public  getProperties ()

此方法已被棄用。
請改用getSystemProperty(String)

退貨

取得屬性

public String getProperty (String name)

參數
name String

退貨
String

取得屬性快取或同步

public String getPropertyCacheOrSync (String name)

此方法已被棄用。
使用getProperty(String)代替。

參數
name String

退貨
String

投擲
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

取得屬性計數

public int getPropertyCount ()

此方法已被棄用。
在 ddmlib 中已棄用,原因是「實作細節」。

退貨
int

取得屬性同步

public String getPropertySync (String name)

此方法已被棄用。
使用getProperty(String)代替。

參數
name String

退貨
String

投擲
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

取得區域

public String getRegion ()

退貨
String

取得螢幕截圖

public RawImage getScreenshot ()

退貨
RawImage

投擲
AdbCommandRejectedException
TimeoutException

取得螢幕截圖

public RawImage getScreenshot (long timeout, 
                TimeUnit unit)

參數
timeout long

unit TimeUnit

退貨
RawImage

投擲
AdbCommandRejectedException
TimeoutException

取得序號

public String getSerialNumber ()

退貨
String

獲取狀態

public IDevice.DeviceState getState ()

退貨
IDevice.DeviceState

取得同步服務

public SyncService getSyncService ()

退貨
SyncService

投擲
AdbCommandRejectedException
TimeoutException

取得系統屬性

public ListenableFuture<String> getSystemProperty (String name)

參數
name String

退貨
ListenableFuture<String>

取得版本號

public AndroidVersion getVersion ()

退貨
AndroidVersion

有客戶

public boolean hasClients ()

退貨
boolean

安裝包

public void installPackage (String packageFilePath, 
                boolean reinstall, 
                InstallReceiver receiver, 
                long maxTimeout, 
                long maxTimeToOutputResponse, 
                TimeUnit maxTimeUnits, 
                String... extraArgs)

參數
packageFilePath String

reinstall boolean

receiver InstallReceiver

maxTimeout long

maxTimeToOutputResponse long

maxTimeUnits TimeUnit

extraArgs String

投擲
InstallException

安裝包

public void installPackage (String packageFilePath, 
                boolean reinstall, 
                InstallReceiver receiver, 
                String... extraArgs)

參數
packageFilePath String

reinstall boolean

receiver InstallReceiver

extraArgs String

投擲
InstallException

安裝包

public void installPackage (String packageFilePath, 
                boolean reinstall, 
                String... extraArgs)

參數
packageFilePath String

reinstall boolean

extraArgs String

投擲
InstallException

安裝包

public void installPackages ( apkFilePaths, 
                boolean reinstall, 
                 extraArgs, 
                long timeOutInMs, 
                TimeUnit timeunit)

參數
apkFilePaths

reinstall boolean

extraArgs

timeOutInMs long

timeunit TimeUnit

投擲
InstallException

安裝遠端包

public void installRemotePackage (String remoteFilePath, 
                boolean reinstall, 
                InstallReceiver receiver, 
                String... extraArgs)

參數
remoteFilePath String

reinstall boolean

receiver InstallReceiver

extraArgs String

投擲
InstallException

安裝遠端包

public void installRemotePackage (String remoteFilePath, 
                boolean reinstall, 
                String... extraArgs)

參數
remoteFilePath String

reinstall boolean

extraArgs String

投擲
InstallException

安裝遠端包

public void installRemotePackage (String remoteFilePath, 
                boolean reinstall, 
                InstallReceiver receiver, 
                long maxTimeout, 
                long maxTimeToOutputResponse, 
                TimeUnit maxTimeUnits, 
                String... extraArgs)

參數
remoteFilePath String

reinstall boolean

receiver InstallReceiver

maxTimeout long

maxTimeToOutputResponse long

maxTimeUnits TimeUnit

extraArgs String

投擲
InstallException

是引導程式

public boolean isBootLoader ()

退貨
boolean

是模擬器

public boolean isEmulator ()

退貨
boolean

離線

public boolean isOffline ()

退貨
boolean

網路

public boolean isOnline ()

退貨
boolean

是根

public boolean isRoot ()

退貨
boolean

投擲
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

拉文件

public void pullFile (String remote, 
                String local)

參數
remote String

local String

投擲
AdbCommandRejectedException
SyncException
TimeoutException

推播檔案

public void pushFile (String local, 
                String remote)

參數
local String

remote String

投擲
AdbCommandRejectedException
SyncException
TimeoutException

重啟

public void reboot (String into)

參數
into String

投擲
AdbCommandRejectedException
TimeoutException

刪除轉發

public void removeForward (int localPort)

參數
localPort int

投擲
AdbCommandRejectedException
TimeoutException

刪除轉發

public void removeForward (int localPort, 
                int remotePort)

參數
localPort int

remotePort int

投擲
AdbCommandRejectedException
TimeoutException

刪除轉發

public void removeForward (int localPort, 
                String remoteSocketName, 
                IDevice.DeviceUnixSocketNamespace namespace)

參數
localPort int

remoteSocketName String

namespace IDevice.DeviceUnixSocketNamespace

投擲
AdbCommandRejectedException
TimeoutException

刪除遠端包

public void removeRemotePackage (String remoteFilePath)

參數
remoteFilePath String

投擲
InstallException

刪除反向

public void removeReverse (int remotePort)

參數
remotePort int

投擲
AdbCommandRejectedException
TimeoutException

public boolean root ()

退貨
boolean

投擲
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

運行事件日誌服務

public void runEventLogService (LogReceiver receiver)

參數
receiver LogReceiver

投擲
AdbCommandRejectedException
TimeoutException

運行日誌服務

public void runLogService (String logname, 
                LogReceiver receiver)

參數
logname String

receiver LogReceiver

投擲
AdbCommandRejectedException
TimeoutException

設定串口

public void setSerial (String serial)

參數
serial String

啟動螢幕錄影機

public void startScreenRecorder (String remoteFilePath, 
                ScreenRecorderOptions options, 
                IShellOutputReceiver receiver)

參數
remoteFilePath String

options ScreenRecorderOptions

receiver IShellOutputReceiver

投擲
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

支援功能

public boolean supportsFeature (IDevice.HardwareFeature arg0)

參數
arg0 IDevice.HardwareFeature

退貨
boolean

支援功能

public boolean supportsFeature (IDevice.Feature feature)

參數
feature IDevice.Feature

退貨
boolean

同步包到設備

public String syncPackageToDevice (String localFilePath)

參數
localFilePath String

退貨
String

投擲
AdbCommandRejectedException
SyncException
TimeoutException

解除安裝應用程式

public String uninstallApp (String applicationID, 
                String... extraArgs)

參數
applicationID String

extraArgs String

退貨
String

投擲
InstallException

解除安裝包

public String uninstallPackage (String packageName)

參數
packageName String

退貨
String

投擲
InstallException