存根设备

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