虛設常式裝置

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 中淘汰,並包含「implementation details」。

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)

公用建構函式

虛設常式裝置

public StubDevice (String serial)

參數
serial String

虛設常式裝置

public StubDevice (String serial, 
                boolean isEmulator)

參數
serial String

isEmulator boolean

公用方法

isPropertiesSet

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

執行 ShellCommand

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

參數
command String

receiver IShellOutputReceiver

maxTimeToOutputResponse long

maxTimeUnits TimeUnit

擲回
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

執行 ShellCommand

public void executeShellCommand (String command, 
                IShellOutputReceiver receiver)

參數
command String

receiver IShellOutputReceiver

擲回
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

執行 ShellCommand

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

執行 ShellCommand

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)

此方法已淘汰。
請改用 getBattery(long, TimeUnit)

參數
freshnessMs long

傳回
Integer

擲回
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

getBatteryLevel

public Integer getBatteryLevel ()

此方法已淘汰。
請改用 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 ()

此方法已淘汰。
請改用 getSystemProperty(String)

傳回

getProperty

public String getProperty (String name)

參數
name String

傳回
String

getPropertyCacheOrSync

public String getPropertyCacheOrSync (String name)

此方法已淘汰。
請改用 getProperty(String)

參數
name String

傳回
String

擲回
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

getPropertyCount

public int getPropertyCount ()

此方法已淘汰。
已在 ddmlib 中淘汰,並包含「implementation details」。

傳回
int

getPropertySync

public String getPropertySync (String name)

此方法已淘汰。
請改用 getProperty(String)

參數
name String

傳回
String

擲回
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

getRegion

public String getRegion ()

傳回
String

取得螢幕截圖

public RawImage getScreenshot ()

傳回
RawImage

擲回
AdbCommandRejectedException
TimeoutException

取得螢幕截圖

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

安裝套件

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

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

離線

public boolean isOffline ()

傳回
boolean

isOnline (線上)

public boolean isOnline ()

傳回
boolean

是根

public boolean isRoot ()

傳回
boolean

擲回
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

PullFile

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

removeRemotePackage

public void removeRemotePackage (String remoteFilePath)

參數
remoteFilePath String

擲回
InstallException

移除

public void removeReverse (int remotePort)

參數
remotePort int

擲回
AdbCommandRejectedException
TimeoutException

根號

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

支援功能

public boolean supportsFeature (IDevice.HardwareFeature arg0)

參數
arg0 IDevice.HardwareFeature

傳回
boolean

支援功能

public boolean supportsFeature (IDevice.Feature feature)

參數
feature IDevice.Feature

傳回
boolean

syncPackageToDevice

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