StubDevice

public class StubDevice
extends Object implements IDevice

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


IDevice 的 Stub 預留位置實作項目。

摘要

公用建構函式

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)

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)

公用建構函式

StubDevice

public StubDevice (String serial)

參數
serial String

StubDevice

public StubDevice (String serial, 
                boolean isEmulator)

參數
serial String

isEmulator boolean

公用方法

arePropertiesSet

public boolean arePropertiesSet ()

傳回
boolean

createForward

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

參數
localPort int

remoteSocketName String

namespace IDevice.DeviceUnixSocketNamespace

擲回
AdbCommandRejectedException
TimeoutException

createForward

public void createForward (int localPort, 
                int remotePort)

參數
localPort int

remotePort int

擲回
AdbCommandRejectedException
TimeoutException

createReverse

public void createReverse (int remotePort, 
                int localPort)

參數
remotePort int

localPort int

擲回
AdbCommandRejectedException
TimeoutException

executeShellCommand

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

參數
command String

receiver IShellOutputReceiver

maxTimeToOutputResponse long

maxTimeUnits TimeUnit

擲回
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

executeShellCommand

public void executeShellCommand (String command, 
                IShellOutputReceiver receiver)

參數
command String

receiver IShellOutputReceiver

擲回
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

executeShellCommand

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

This method is deprecated.
使用 executeShellCommand(String, com.android.ddmlib.IShellOutputReceiver, long, TimeUnit)

參數
command String

receiver IShellOutputReceiver

maxTimeToOutputResponse int

擲回
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

executeShellCommand

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

getAbis

public  getAbis ()

傳回

getAvdName

public String getAvdName ()

傳回
String

getAvdPath

public String getAvdPath ()

傳回
String

getBattery

public  getBattery (long freshnessTime, 
                TimeUnit timeUnit)

參數
freshnessTime long

timeUnit TimeUnit

傳回

getBattery

public  getBattery ()

傳回

getBatteryLevel

public Integer getBatteryLevel (long freshnessMs)

This method is deprecated.
請改用 getBattery(long, TimeUnit)

參數
freshnessMs long

傳回
Integer

擲回
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

getBatteryLevel

public Integer getBatteryLevel ()

This method is deprecated.
請改用 getBattery()

傳回
Integer

擲回
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

getClient

public Client getClient (String applicationName)

參數
applicationName String

傳回
Client

getClientName

public String getClientName (int pid)

參數
pid int

傳回
String

getClients

public Client[] getClients ()

傳回
Client[]

getDensity

public int getDensity ()

傳回
int

getFileListingService

public FileListingService getFileListingService ()

傳回
FileListingService

getLanguage

public String getLanguage ()

傳回
String

getMountPoint

public String getMountPoint (String name)

參數
name String

傳回
String

getName

public String getName ()

傳回
String

getProperties

public  getProperties ()

This method is deprecated.
請改用 getSystemProperty(String)

傳回

getProperty

public String getProperty (String name)

參數
name String

傳回
String

getPropertyCacheOrSync

public String getPropertyCacheOrSync (String name)

This method is deprecated.
請改用 getProperty(String)

參數
name String

傳回
String

擲回
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

getPropertyCount

public int getPropertyCount ()

This method is deprecated.
已在 ddmlib 中淘汰,原因是「實作細節」。

傳回
int

getPropertySync

public String getPropertySync (String name)

This method is deprecated.
請改用 getProperty(String)

參數
name String

傳回
String

擲回
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

getRegion

public String getRegion ()

傳回
String

getScreenshot

public RawImage getScreenshot ()

傳回
RawImage

擲回
AdbCommandRejectedException
TimeoutException

getScreenshot

public RawImage getScreenshot (long timeout, 
                TimeUnit unit)

參數
timeout long

unit TimeUnit

傳回
RawImage

擲回
AdbCommandRejectedException
TimeoutException

getSerialNumber

public String getSerialNumber ()

傳回
String

getState

public IDevice.DeviceState getState ()

傳回
IDevice.DeviceState

getSyncService

public SyncService getSyncService ()

傳回
SyncService

擲回
AdbCommandRejectedException
TimeoutException

getSystemProperty

public ListenableFuture<String> getSystemProperty (String name)

參數
name String

傳回
ListenableFuture<String>

getVersion

public AndroidVersion getVersion ()

傳回
AndroidVersion

hasClients

public boolean hasClients ()

傳回
boolean

installPackage

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

installPackage

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

參數
packageFilePath String

reinstall boolean

receiver InstallReceiver

extraArgs String

擲回
InstallException

installPackage

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

參數
packageFilePath String

reinstall boolean

extraArgs String

擲回
InstallException

installPackages

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

參數
apkFilePaths

reinstall boolean

extraArgs

timeOutInMs long

timeunit TimeUnit

擲回
InstallException

installRemotePackage

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

參數
remoteFilePath String

reinstall boolean

receiver InstallReceiver

extraArgs String

擲回
InstallException

installRemotePackage

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

參數
remoteFilePath String

reinstall boolean

extraArgs String

擲回
InstallException

installRemotePackage

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

isBootLoader

public boolean isBootLoader ()

傳回
boolean

isEmulator

public boolean isEmulator ()

傳回
boolean

isOffline

public boolean isOffline ()

傳回
boolean

isOnline

public boolean isOnline ()

傳回
boolean

isRoot

public boolean isRoot ()

傳回
boolean

擲回
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

pullFile

public void pullFile (String remote, 
                String local)

參數
remote String

local String

擲回
AdbCommandRejectedException
SyncException
TimeoutException

pushFile

public void pushFile (String local, 
                String remote)

參數
local String

remote String

擲回
AdbCommandRejectedException
SyncException
TimeoutException

重開。

public void reboot (String into)

參數
into String

擲回
AdbCommandRejectedException
TimeoutException

removeForward

public void removeForward (int localPort)

參數
localPort int

擲回
AdbCommandRejectedException
TimeoutException

removeForward

public void removeForward (int localPort, 
                int remotePort)

參數
localPort int

remotePort int

擲回
AdbCommandRejectedException
TimeoutException

removeForward

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

參數
localPort int

remoteSocketName String

namespace IDevice.DeviceUnixSocketNamespace

擲回
AdbCommandRejectedException
TimeoutException

removeRemotePackage

public void removeRemotePackage (String remoteFilePath)

參數
remoteFilePath String

擲回
InstallException

removeReverse

public void removeReverse (int remotePort)

參數
remotePort int

擲回
AdbCommandRejectedException
TimeoutException

root

public boolean root ()

傳回
boolean

擲回
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

runEventLogService

public void runEventLogService (LogReceiver receiver)

參數
receiver LogReceiver

擲回
AdbCommandRejectedException
TimeoutException

runLogService

public void runLogService (String logname, 
                LogReceiver receiver)

參數
logname String

receiver LogReceiver

擲回
AdbCommandRejectedException
TimeoutException

setSerial

public void setSerial (String serial)

參數
serial String

startScreenRecorder

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

參數
remoteFilePath String

options ScreenRecorderOptions

receiver IShellOutputReceiver

擲回
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

supportsFeature

public boolean supportsFeature (IDevice.HardwareFeature arg0)

參數
arg0 IDevice.HardwareFeature

傳回
boolean

supportsFeature

public boolean supportsFeature (IDevice.Feature feature)

參數
feature IDevice.Feature

傳回
boolean

syncPackageToDevice

public String syncPackageToDevice (String localFilePath)

參數
localFilePath String

傳回
String

擲回
AdbCommandRejectedException
SyncException
TimeoutException

uninstallApp

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

參數
applicationID String

extraArgs String

傳回
String

擲回
InstallException

uninstallPackage

public String uninstallPackage (String packageName)

參數
packageName String

傳回
String

擲回
InstallException