StubDevice
public
class
StubDevice
extends Object
implements
IDevice
java.lang.Object | |
↳ | com.android.tradefed.device.StubDevice |
Stub placeholder implementation of a IDevice
.
Summary
Public constructors | |
---|---|
StubDevice(String serial)
|
|
StubDevice(String serial, boolean isEmulator)
|
Public methods | |
---|---|
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)
This method is deprecated.
use |
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)
This method is deprecated.
use |
Integer
|
getBatteryLevel()
This method is deprecated.
use |
Client
|
getClient(String applicationName)
|
String
|
getClientName(int pid)
|
Client[]
|
getClients()
|
int
|
getDensity()
|
FileListingService
|
getFileListingService()
|
String
|
getLanguage()
|
String
|
getMountPoint(String name)
|
String
|
getName()
|
|
getProperties()
This method is deprecated.
use |
String
|
getProperty(String name)
|
String
|
getPropertyCacheOrSync(String name)
This method is deprecated.
use |
int
|
getPropertyCount()
This method is deprecated. deprecated in ddmlib with "implementation detail" as reason. |
String
|
getPropertySync(String name)
This method is deprecated.
use |
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(
|
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 constructors
StubDevice
public StubDevice (String serial)
Parameters | |
---|---|
serial |
String |
StubDevice
public StubDevice (String serial, boolean isEmulator)
Parameters | |
---|---|
serial |
String |
isEmulator |
boolean |
Public methods
arePropertiesSet
public boolean arePropertiesSet ()
Returns | |
---|---|
boolean |
createForward
public void createForward (int localPort, String remoteSocketName, IDevice.DeviceUnixSocketNamespace namespace)
Parameters | |
---|---|
localPort |
int |
remoteSocketName |
String |
namespace |
IDevice.DeviceUnixSocketNamespace |
Throws | |
---|---|
AdbCommandRejectedException |
|
TimeoutException |
createForward
public void createForward (int localPort, int remotePort)
Parameters | |
---|---|
localPort |
int |
remotePort |
int |
Throws | |
---|---|
AdbCommandRejectedException |
|
TimeoutException |
createReverse
public void createReverse (int remotePort, int localPort)
Parameters | |
---|---|
remotePort |
int |
localPort |
int |
Throws | |
---|---|
AdbCommandRejectedException |
|
TimeoutException |
executeShellCommand
public void executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeToOutputResponse, TimeUnit maxTimeUnits)
Parameters | |
---|---|
command |
String |
receiver |
IShellOutputReceiver |
maxTimeToOutputResponse |
long |
maxTimeUnits |
TimeUnit |
Throws | |
---|---|
AdbCommandRejectedException |
|
ShellCommandUnresponsiveException |
|
TimeoutException |
executeShellCommand
public void executeShellCommand (String command, IShellOutputReceiver receiver)
Parameters | |
---|---|
command |
String |
receiver |
IShellOutputReceiver |
Throws | |
---|---|
AdbCommandRejectedException |
|
ShellCommandUnresponsiveException |
|
TimeoutException |
executeShellCommand
public void executeShellCommand (String command, IShellOutputReceiver receiver, int maxTimeToOutputResponse)
This method is deprecated.
use executeShellCommand(String, com.android.ddmlib.IShellOutputReceiver, long, TimeUnit)
.
Parameters | |
---|---|
command |
String |
receiver |
IShellOutputReceiver |
maxTimeToOutputResponse |
int |
Throws | |
---|---|
AdbCommandRejectedException |
|
ShellCommandUnresponsiveException |
|
TimeoutException |
executeShellCommand
public void executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeout, long maxTimeToOutputResponse, TimeUnit maxTimeUnits)
Parameters | |
---|---|
command |
String |
receiver |
IShellOutputReceiver |
maxTimeout |
long |
maxTimeToOutputResponse |
long |
maxTimeUnits |
TimeUnit |
Throws | |
---|---|
AdbCommandRejectedException |
|
ShellCommandUnresponsiveException |
|
TimeoutException |
getAbis
publicgetAbis ()
Returns | |
---|---|
|
getAvdName
public String getAvdName ()
Returns | |
---|---|
String |
getAvdPath
public String getAvdPath ()
Returns | |
---|---|
String |
getBattery
publicgetBattery (long freshnessTime, TimeUnit timeUnit)
Parameters | |
---|---|
freshnessTime |
long |
timeUnit |
TimeUnit |
Returns | |
---|---|
|
getBattery
publicgetBattery ()
Returns | |
---|---|
|
getBatteryLevel
public Integer getBatteryLevel (long freshnessMs)
This method is deprecated.
use getBattery(long, TimeUnit)
instead.
Parameters | |
---|---|
freshnessMs |
long |
Returns | |
---|---|
Integer |
Throws | |
---|---|
AdbCommandRejectedException |
|
ShellCommandUnresponsiveException |
|
TimeoutException |
getBatteryLevel
public Integer getBatteryLevel ()
This method is deprecated.
use getBattery()
instead.
Returns | |
---|---|
Integer |
Throws | |
---|---|
AdbCommandRejectedException |
|
ShellCommandUnresponsiveException |
|
TimeoutException |
getClient
public Client getClient (String applicationName)
Parameters | |
---|---|
applicationName |
String |
Returns | |
---|---|
Client |
getClientName
public String getClientName (int pid)
Parameters | |
---|---|
pid |
int |
Returns | |
---|---|
String |
getClients
public Client[] getClients ()
Returns | |
---|---|
Client[] |
getDensity
public int getDensity ()
Returns | |
---|---|
int |
getFileListingService
public FileListingService getFileListingService ()
Returns | |
---|---|
FileListingService |
getLanguage
public String getLanguage ()
Returns | |
---|---|
String |
getMountPoint
public String getMountPoint (String name)
Parameters | |
---|---|
name |
String |
Returns | |
---|---|
String |
getName
public String getName ()
Returns | |
---|---|
String |
getProperties
publicgetProperties ()
This method is deprecated.
use getSystemProperty(String)
instead.
Returns | |
---|---|
|
getProperty
public String getProperty (String name)
Parameters | |
---|---|
name |
String |
Returns | |
---|---|
String |
getPropertyCacheOrSync
public String getPropertyCacheOrSync (String name)
This method is deprecated.
use getProperty(String)
instead.
Parameters | |
---|---|
name |
String |
Returns | |
---|---|
String |
Throws | |
---|---|
AdbCommandRejectedException |
|
ShellCommandUnresponsiveException |
|
TimeoutException |
getPropertyCount
public int getPropertyCount ()
This method is deprecated.
deprecated in ddmlib with "implementation detail" as reason.
Returns | |
---|---|
int |
getPropertySync
public String getPropertySync (String name)
This method is deprecated.
use getProperty(String)
instead.
Parameters | |
---|---|
name |
String |
Returns | |
---|---|
String |
Throws | |
---|---|
AdbCommandRejectedException |
|
ShellCommandUnresponsiveException |
|
TimeoutException |
getRegion
public String getRegion ()
Returns | |
---|---|
String |
getScreenshot
public RawImage getScreenshot ()
Returns | |
---|---|
RawImage |
Throws | |
---|---|
AdbCommandRejectedException |
|
TimeoutException |
getScreenshot
public RawImage getScreenshot (long timeout, TimeUnit unit)
Parameters | |
---|---|
timeout |
long |
unit |
TimeUnit |
Returns | |
---|---|
RawImage |
Throws | |
---|---|
AdbCommandRejectedException |
|
TimeoutException |
getSerialNumber
public String getSerialNumber ()
Returns | |
---|---|
String |
getState
public IDevice.DeviceState getState ()
Returns | |
---|---|
IDevice.DeviceState |
getSyncService
public SyncService getSyncService ()
Returns | |
---|---|
SyncService |
Throws | |
---|---|
AdbCommandRejectedException |
|
TimeoutException |
getSystemProperty
public ListenableFuture<String> getSystemProperty (String name)
Parameters | |
---|---|
name |
String |
Returns | |
---|---|
ListenableFuture<String> |
getVersion
public AndroidVersion getVersion ()
Returns | |
---|---|
AndroidVersion |
hasClients
public boolean hasClients ()
Returns | |
---|---|
boolean |
installPackage
public void installPackage (String packageFilePath, boolean reinstall, InstallReceiver receiver, long maxTimeout, long maxTimeToOutputResponse, TimeUnit maxTimeUnits, String... extraArgs)
Parameters | |
---|---|
packageFilePath |
String |
reinstall |
boolean |
receiver |
InstallReceiver |
maxTimeout |
long |
maxTimeToOutputResponse |
long |
maxTimeUnits |
TimeUnit |
extraArgs |
String |
Throws | |
---|---|
InstallException |
installPackage
public void installPackage (String packageFilePath, boolean reinstall, InstallReceiver receiver, String... extraArgs)
Parameters | |
---|---|
packageFilePath |
String |
reinstall |
boolean |
receiver |
InstallReceiver |
extraArgs |
String |
Throws | |
---|---|
InstallException |
installPackage
public void installPackage (String packageFilePath, boolean reinstall, String... extraArgs)
Parameters | |
---|---|
packageFilePath |
String |
reinstall |
boolean |
extraArgs |
String |
Throws | |
---|---|
InstallException |
installPackages
public void installPackages (apkFilePaths, boolean reinstall, extraArgs, long timeOutInMs, TimeUnit timeunit)
Parameters | |
---|---|
apkFilePaths |
|
reinstall |
boolean |
extraArgs |
|
timeOutInMs |
long |
timeunit |
TimeUnit |
Throws | |
---|---|
InstallException |
installRemotePackage
public void installRemotePackage (String remoteFilePath, boolean reinstall, InstallReceiver receiver, String... extraArgs)
Parameters | |
---|---|
remoteFilePath |
String |
reinstall |
boolean |
receiver |
InstallReceiver |
extraArgs |
String |
Throws | |
---|---|
InstallException |
installRemotePackage
public void installRemotePackage (String remoteFilePath, boolean reinstall, String... extraArgs)
Parameters | |
---|---|
remoteFilePath |
String |
reinstall |
boolean |
extraArgs |
String |
Throws | |
---|---|
InstallException |
installRemotePackage
public void installRemotePackage (String remoteFilePath, boolean reinstall, InstallReceiver receiver, long maxTimeout, long maxTimeToOutputResponse, TimeUnit maxTimeUnits, String... extraArgs)
Parameters | |
---|---|
remoteFilePath |
String |
reinstall |
boolean |
receiver |
InstallReceiver |
maxTimeout |
long |
maxTimeToOutputResponse |
long |
maxTimeUnits |
TimeUnit |
extraArgs |
String |
Throws | |
---|---|
InstallException |
isBootLoader
public boolean isBootLoader ()
Returns | |
---|---|
boolean |
isEmulator
public boolean isEmulator ()
Returns | |
---|---|
boolean |
isOffline
public boolean isOffline ()
Returns | |
---|---|
boolean |
isOnline
public boolean isOnline ()
Returns | |
---|---|
boolean |
isRoot
public boolean isRoot ()
Returns | |
---|---|
boolean |
Throws | |
---|---|
AdbCommandRejectedException |
|
ShellCommandUnresponsiveException |
|
TimeoutException |
pullFile
public void pullFile (String remote, String local)
Parameters | |
---|---|
remote |
String |
local |
String |
Throws | |
---|---|
AdbCommandRejectedException |
|
SyncException |
|
TimeoutException |
pushFile
public void pushFile (String local, String remote)
Parameters | |
---|---|
local |
String |
remote |
String |
Throws | |
---|---|
AdbCommandRejectedException |
|
SyncException |
|
TimeoutException |
reboot
public void reboot (String into)
Parameters | |
---|---|
into |
String |
Throws | |
---|---|
AdbCommandRejectedException |
|
TimeoutException |
removeForward
public void removeForward (int localPort)
Parameters | |
---|---|
localPort |
int |
Throws | |
---|---|
AdbCommandRejectedException |
|
TimeoutException |
removeForward
public void removeForward (int localPort, int remotePort)
Parameters | |
---|---|
localPort |
int |
remotePort |
int |
Throws | |
---|---|
AdbCommandRejectedException |
|
TimeoutException |
removeForward
public void removeForward (int localPort, String remoteSocketName, IDevice.DeviceUnixSocketNamespace namespace)
Parameters | |
---|---|
localPort |
int |
remoteSocketName |
String |
namespace |
IDevice.DeviceUnixSocketNamespace |
Throws | |
---|---|
AdbCommandRejectedException |
|
TimeoutException |
removeRemotePackage
public void removeRemotePackage (String remoteFilePath)
Parameters | |
---|---|
remoteFilePath |
String |
Throws | |
---|---|
InstallException |
removeReverse
public void removeReverse (int remotePort)
Parameters | |
---|---|
remotePort |
int |
Throws | |
---|---|
AdbCommandRejectedException |
|
TimeoutException |
root
public boolean root ()
Returns | |
---|---|
boolean |
Throws | |
---|---|
AdbCommandRejectedException |
|
ShellCommandUnresponsiveException |
|
TimeoutException |
runEventLogService
public void runEventLogService (LogReceiver receiver)
Parameters | |
---|---|
receiver |
LogReceiver |
Throws | |
---|---|
AdbCommandRejectedException |
|
TimeoutException |
runLogService
public void runLogService (String logname, LogReceiver receiver)
Parameters | |
---|---|
logname |
String |
receiver |
LogReceiver |
Throws | |
---|---|
AdbCommandRejectedException |
|
TimeoutException |
setSerial
public void setSerial (String serial)
Parameters | |
---|---|
serial |
String |
startScreenRecorder
public void startScreenRecorder (String remoteFilePath, ScreenRecorderOptions options, IShellOutputReceiver receiver)
Parameters | |
---|---|
remoteFilePath |
String |
options |
ScreenRecorderOptions |
receiver |
IShellOutputReceiver |
Throws | |
---|---|
AdbCommandRejectedException |
|
ShellCommandUnresponsiveException |
|
TimeoutException |
supportsFeature
public boolean supportsFeature (IDevice.HardwareFeature arg0)
Parameters | |
---|---|
arg0 |
IDevice.HardwareFeature |
Returns | |
---|---|
boolean |
supportsFeature
public boolean supportsFeature (IDevice.Feature feature)
Parameters | |
---|---|
feature |
IDevice.Feature |
Returns | |
---|---|
boolean |
syncPackageToDevice
public String syncPackageToDevice (String localFilePath)
Parameters | |
---|---|
localFilePath |
String |
Returns | |
---|---|
String |
Throws | |
---|---|
AdbCommandRejectedException |
|
SyncException |
|
TimeoutException |
uninstallApp
public String uninstallApp (String applicationID, String... extraArgs)
Parameters | |
---|---|
applicationID |
String |
extraArgs |
String |
Returns | |
---|---|
String |
Throws | |
---|---|
InstallException |
uninstallPackage
public String uninstallPackage (String packageName)
Parameters | |
---|---|
packageName |
String |
Returns | |
---|---|
String |
Throws | |
---|---|
InstallException |