Thiết bị giữ cố định

public class StubDevice
extends Object implements IDevice

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


Triển khai phần giữ chỗ mã giả lập của IDevice.

Tóm tắt

Hàm khởi tạo công khai

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

Phương thức công khai

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)

Phương thức này không được dùng nữa. sử dụng 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)

Phương thức này không được dùng nữa. hãy sử dụng getBattery(long, TimeUnit).

Integer getBatteryLevel()

Phương thức này không được dùng nữa. hãy sử dụng getBattery().

Client getClient(String applicationName)

String getClientName(int pid)

Client[] getClients()

int getDensity()

FileListingService getFileListingService()

String getLanguage()

String getMountPoint(String name)

String getName()

getProperties()

Phương thức này không được dùng nữa. hãy sử dụng getSystemProperty(String).

String getProperty(String name)

String getPropertyCacheOrSync(String name)

Phương thức này không được dùng nữa. hãy sử dụng getProperty(String).

int getPropertyCount()

Phương thức này không được dùng nữa. không dùng nữa trong ddmlib, lý do là "chi tiết triển khai" là lý do.

String getPropertySync(String name)

Phương thức này không được dùng nữa. hãy sử dụng 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)

Hàm khởi tạo công khai

Thiết bị giữ cố định

public StubDevice (String serial)

Tham số
serial String

Thiết bị giữ cố định

public StubDevice (String serial, 
                boolean isEmulator)

Tham số
serial String

isEmulator boolean

Phương thức công khai

Đặt thuộc tính

public boolean arePropertiesSet ()

Giá trị trả về
boolean

Tạo chuyển tiếp

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

Tham số
localPort int

remoteSocketName String

namespace IDevice.DeviceUnixSocketNamespace

Gửi
AdbCommandRejectedException
TimeoutException

Tạo chuyển tiếp

public void createForward (int localPort, 
                int remotePort)

Tham số
localPort int

remotePort int

Gửi
AdbCommandRejectedException
TimeoutException

Tạo Đảo ngược

public void createReverse (int remotePort, 
                int localPort)

Tham số
remotePort int

localPort int

Gửi
AdbCommandRejectedException
TimeoutException

Thực thiShellCommand

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

Tham số
command String

receiver IShellOutputReceiver

maxTimeToOutputResponse long

maxTimeUnits TimeUnit

Gửi
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

Thực thiShellCommand

public void executeShellCommand (String command, 
                IShellOutputReceiver receiver)

Tham số
command String

receiver IShellOutputReceiver

Gửi
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

Thực thiShellCommand

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

Phương thức này không còn được dùng nữa.
sử dụng executeShellCommand(String, com.android.ddmlib.IShellOutputReceiver, long, TimeUnit).

Tham số
command String

receiver IShellOutputReceiver

maxTimeToOutputResponse int

Gửi
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

Thực thiShellCommand

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

Tham số
command String

receiver IShellOutputReceiver

maxTimeout long

maxTimeToOutputResponse long

maxTimeUnits TimeUnit

Gửi
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

cây dứa

public  getAbis ()

Giá trị trả về

getAvdName

public String getAvdName ()

Giá trị trả về
String

getAvdPath

public String getAvdPath ()

Giá trị trả về
String

getBattery

public  getBattery (long freshnessTime, 
                TimeUnit timeUnit)

Tham số
freshnessTime long

timeUnit TimeUnit

Giá trị trả về

getBattery

public  getBattery ()

Giá trị trả về

getBatteryLevel

public Integer getBatteryLevel (long freshnessMs)

Phương thức này không còn được dùng nữa.Thay vào đó,
hãy sử dụng getBattery(long, TimeUnit).

Tham số
freshnessMs long

Giá trị trả về
Integer

Gửi
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

getBatteryLevel

public Integer getBatteryLevel ()

Phương thức này không còn được dùng nữa.Thay vào đó,
hãy sử dụng getBattery().

Giá trị trả về
Integer

Gửi
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

getClient

public Client getClient (String applicationName)

Tham số
applicationName String

Giá trị trả về
Client

getClientName

public String getClientName (int pid)

Tham số
pid int

Giá trị trả về
String

getClient

public Client[] getClients ()

Giá trị trả về
Client[]

getDensity

public int getDensity ()

Giá trị trả về
int

Dịch vụ getFileListing

public FileListingService getFileListingService ()

Giá trị trả về
FileListingService

getLanguage

public String getLanguage ()

Giá trị trả về
String

getMountPoint

public String getMountPoint (String name)

Tham số
name String

Giá trị trả về
String

getName

public String getName ()

Giá trị trả về
String

getProperties

public  getProperties ()

Phương thức này không còn được dùng nữa.Thay vào đó,
hãy sử dụng getSystemProperty(String).

Giá trị trả về

nhận thuộc tính

public String getProperty (String name)

Tham số
name String

Giá trị trả về
String

getPropertyCacheOrSync

public String getPropertyCacheOrSync (String name)

Phương thức này không còn được dùng nữa.Thay vào đó,
hãy sử dụng getProperty(String).

Tham số
name String

Giá trị trả về
String

Gửi
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

getPropertyCount

public int getPropertyCount ()

Phương thức này không còn được dùng nữa.
không được dùng nữa trong ddmlib vì lý do là "chi tiết triển khai".

Giá trị trả về
int

getPropertySync

public String getPropertySync (String name)

Phương thức này không còn được dùng nữa.Thay vào đó,
hãy sử dụng getProperty(String).

Tham số
name String

Giá trị trả về
String

Gửi
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

getRegion

public String getRegion ()

Giá trị trả về
String

getẢnh chụp màn hình

public RawImage getScreenshot ()

Giá trị trả về
RawImage

Gửi
AdbCommandRejectedException
TimeoutException

getẢnh chụp màn hình

public RawImage getScreenshot (long timeout, 
                TimeUnit unit)

Tham số
timeout long

unit TimeUnit

Giá trị trả về
RawImage

Gửi
AdbCommandRejectedException
TimeoutException

getSerialNumber

public String getSerialNumber ()

Giá trị trả về
String

nhận trạng thái

public IDevice.DeviceState getState ()

Giá trị trả về
IDevice.DeviceState

getSyncService

public SyncService getSyncService ()

Giá trị trả về
SyncService

Gửi
AdbCommandRejectedException
TimeoutException

lấy thuộc tính hệ thống

public ListenableFuture<String> getSystemProperty (String name)

Tham số
name String

Giá trị trả về
ListenableFuture<String>

getVersion

public AndroidVersion getVersion ()

Giá trị trả về
AndroidVersion

hasClient

public boolean hasClients ()

Giá trị trả về
boolean

lượt cài đặt

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

Tham số
packageFilePath String

reinstall boolean

receiver InstallReceiver

maxTimeout long

maxTimeToOutputResponse long

maxTimeUnits TimeUnit

extraArgs String

Gửi
InstallException

lượt cài đặt

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

Tham số
packageFilePath String

reinstall boolean

receiver InstallReceiver

extraArgs String

Gửi
InstallException

lượt cài đặt

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

Tham số
packageFilePath String

reinstall boolean

extraArgs String

Gửi
InstallException

lượt cài đặt

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

Tham số
apkFilePaths

reinstall boolean

extraArgs

timeOutInMs long

timeunit TimeUnit

Gửi
InstallException

cài đặtRemotePackage

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

Tham số
remoteFilePath String

reinstall boolean

receiver InstallReceiver

extraArgs String

Gửi
InstallException

cài đặtRemotePackage

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

Tham số
remoteFilePath String

reinstall boolean

extraArgs String

Gửi
InstallException

cài đặtRemotePackage

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

Tham số
remoteFilePath String

reinstall boolean

receiver InstallReceiver

maxTimeout long

maxTimeToOutputResponse long

maxTimeUnits TimeUnit

extraArgs String

Gửi
InstallException

isBootLoader

public boolean isBootLoader ()

Giá trị trả về
boolean

isEmulator

public boolean isEmulator ()

Giá trị trả về
boolean

Đang ngoại tuyến

public boolean isOffline ()

Giá trị trả về
boolean

đang Trực tuyến

public boolean isOnline ()

Giá trị trả về
boolean

isRoot

public boolean isRoot ()

Giá trị trả về
boolean

Gửi
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

tệp kéo

public void pullFile (String remote, 
                String local)

Tham số
remote String

local String

Gửi
AdbCommandRejectedException
SyncException
TimeoutException

tệp đẩy

public void pushFile (String local, 
                String remote)

Tham số
local String

remote String

Gửi
AdbCommandRejectedException
SyncException
TimeoutException

khởi động lại

public void reboot (String into)

Tham số
into String

Gửi
AdbCommandRejectedException
TimeoutException

xoá chuyển tiếp

public void removeForward (int localPort)

Tham số
localPort int

Gửi
AdbCommandRejectedException
TimeoutException

xoá chuyển tiếp

public void removeForward (int localPort, 
                int remotePort)

Tham số
localPort int

remotePort int

Gửi
AdbCommandRejectedException
TimeoutException

xoá chuyển tiếp

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

Tham số
localPort int

remoteSocketName String

namespace IDevice.DeviceUnixSocketNamespace

Gửi
AdbCommandRejectedException
TimeoutException

removeRemotePackage

public void removeRemotePackage (String remoteFilePath)

Tham số
remoteFilePath String

Gửi
InstallException

Xoá Đảo ngược

public void removeReverse (int remotePort)

Tham số
remotePort int

Gửi
AdbCommandRejectedException
TimeoutException

gốc

public boolean root ()

Giá trị trả về
boolean

Gửi
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

runEventLogService

public void runEventLogService (LogReceiver receiver)

Tham số
receiver LogReceiver

Gửi
AdbCommandRejectedException
TimeoutException

runLogService

public void runLogService (String logname, 
                LogReceiver receiver)

Tham số
logname String

receiver LogReceiver

Gửi
AdbCommandRejectedException
TimeoutException

setSerial

public void setSerial (String serial)

Tham số
serial String

startScreenRecorder

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

Tham số
remoteFilePath String

options ScreenRecorderOptions

receiver IShellOutputReceiver

Gửi
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

hỗ trợTính năng

public boolean supportsFeature (IDevice.HardwareFeature arg0)

Tham số
arg0 IDevice.HardwareFeature

Giá trị trả về
boolean

hỗ trợTính năng

public boolean supportsFeature (IDevice.Feature feature)

Tham số
feature IDevice.Feature

Giá trị trả về
boolean

SyncPackageToDevice

public String syncPackageToDevice (String localFilePath)

Tham số
localFilePath String

Giá trị trả về
String

Gửi
AdbCommandRejectedException
SyncException
TimeoutException

gỡ cài đặt ứng dụng

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

Tham số
applicationID String

extraArgs String

Giá trị trả về
String

Gửi
InstallException

gỡ cài đặt gói

public String uninstallPackage (String packageName)

Tham số
packageName String

Giá trị trả về
String

Gửi
InstallException