Thiết bị gốc

public class NativeDevice
extends Object implements IManagedTestDevice, IConfigurationReceiver

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


Phương thức triển khai mặc định của ITestDevice Thiết bị Android không ở trong ngăn xếp đầy đủ.

Tóm tắt

Lớp lồng ghép

class NativeDevice.AdbAction

Một DeviceAction để chạy một hệ điều hành "adb ...." . 

class NativeDevice.AdbShellAction

 

class NativeDevice.RebootDeviceAction

DeviceAction để khởi động lại thiết bị. 

enum NativeDevice.RebootMode

Chế độ khởi động lại. 

Hằng số

int INVALID_USER_ID

Giá trị được trả về cho mọi mã nhận dạng người dùng không hợp lệ/không tìm thấy: UserHandle đã xác định giá trị -10000

long MAX_HOST_DEVICE_TIME_OFFSET

int MAX_RETRY_ATTEMPTS

số lần thử thực hiện lại lệnh mặc định

Trường

protected static final String SD_CARD

protected static final String STORAGE_EMULATED

protected TestDeviceOptions mOptions

protected final IDeviceStateMonitor mStateMonitor

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

NativeDevice(IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)

Tạo TestDevice.

Phương thức công khai

boolean checkApiLevelAgainstNextRelease(int strictMinLevel)

boolean checkConnectivity()

boolean clearErrorDialogs()

void clearLastConnectedWifiNetwork()

void clearLogcat()

boolean connectToWifiNetwork(String wifiSsid, String wifiPsk)

boolean connectToWifiNetwork(String wifiSsid, String wifiPsk, boolean scanSsid)

boolean connectToWifiNetworkIfNeeded(String wifiSsid, String wifiPsk, boolean scanSsid)

boolean connectToWifiNetworkIfNeeded(String wifiSsid, String wifiPsk)

int createUser(String name, boolean guest, boolean ephemeral)

int createUser(String name)

int createUserNoThrow(String name)

void deleteFile(String deviceFilePath)

boolean deviceSoftRestarted(ProcessInfo prevSystemServerProcess)

boolean deviceSoftRestartedSince(long utcEpochTime, TimeUnit timeUnit)

boolean disableAdbRoot()

void disableKeyguard()

boolean disableNetworkMonitor()

boolean disconnectFromWifi()

boolean doesFileExist(String deviceFilePath)

File dumpHeap(String process, String devicePath)

boolean enableAdbRoot()

boolean enableNetworkMonitor()

boolean encryptDevice(boolean inplace)

String executeAdbCommand(long timeout, String... cmdArgs)

String executeAdbCommand(String... cmdArgs)

CommandResult executeFastbootCommand(String... cmdArgs)

CommandResult executeFastbootCommand(long timeout, String... cmdArgs)

CommandResult executeLongFastbootCommand(String... cmdArgs)

String executeShellCommand(String command)

void executeShellCommand(String command, IShellOutputReceiver receiver, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts)

void executeShellCommand(String command, IShellOutputReceiver receiver, long maxTimeoutForCommand, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts)

void executeShellCommand(String command, IShellOutputReceiver receiver)

CommandResult executeShellV2Command(String cmd)

CommandResult executeShellV2Command(String cmd, OutputStream pipeToOutput)

CommandResult executeShellV2Command(String cmd, File pipeAsInput)

CommandResult executeShellV2Command(String cmd, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)

CommandResult executeShellV2Command(String cmd, long maxTimeoutForCommand, TimeUnit timeUnit)

CommandResult executeShellV2Command(String cmd, File pipeAsInput, OutputStream pipeToOutput, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)

CommandResult executeShellV2Command(String cmd, File pipeAsInput, OutputStream pipeToOutput, OutputStream pipeToError, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)

CommandResult fastbootWipePartition(String partition)

getActiveApexes()

getAllSettings(String namespace)

DeviceAllocationState getAllocationState()
String getAndroidId(int userId)

getAndroidIds()

int getApiLevel()

PackageInfo getAppPackageInfo(String packageName)

getAppPackageInfos()

String getBasebandVersion()
Integer getBattery()

boolean getBooleanProperty(String name, boolean defaultValue)

getBootHistory()

getBootHistorySince(long utcEpochTime, TimeUnit timeUnit)

String getBootloaderVersion()

InputStreamSource getBugreport()

InputStreamSource getBugreportz()

String getBuildAlias()

String getBuildFlavor()

String getBuildId()

String getBuildSigningKeys()

DeviceDescriptor getCachedDeviceDescriptor()

String[] getChildren(String path)

DeviceFoldableState getCurrentFoldableState()
int getCurrentUser()

String getDeviceClass()

long getDeviceDate()

DeviceDescriptor getDeviceDescriptor()

TestDeviceState getDeviceState()

long getDeviceTimeOffset(Date date)

InputStreamSource getEmulatorOutput()

Process getEmulatorProcess()

final File getExecuteShellCommandLog()

Nhật ký chứa tất cả nhật ký executeShellCommand(String).

long getExternalStoreFreeSpace()

String getFastbootPath()

String getFastbootProductType()

String getFastbootProductVariant()

String getFastbootSerialNumber()

String getFastbootVariable(String variableName)

String getFastbootVersion()

IFileEntry getFileEntry(String path)

IFileEntry getFileEntry(FileListingService.FileEntry entry)

Trình trợ giúp không chính thức để nhận FileEntry từ một đường dẫn không phải gốc.

getFoldableStates()
IDevice getIDevice()

getInstalledPackageNames()

long getIntProperty(String name, long defaultValue)

String getIpAddress()

KeyguardControllerState getKeyguardState()

long getLastExpectedRebootTimeMillis()

int getLaunchApiLevel()

InputStreamSource getLogcat()

InputStreamSource getLogcat(int maxBytes)

InputStreamSource getLogcatDump()

InputStreamSource getLogcatSince(long date)

String getMacAddress()

getMainlineModuleInfo()

int getMaxNumberOfRunningUsersSupported()
int getMaxNumberOfUsersSupported()

IDeviceStateMonitor getMonitor()
String getMountPoint(String mountName)

ITestDevice.MountPointInfo getMountPointInfo(String mountpoint)

getMountPointInfo()

TestDeviceOptions getOptions()

long getPartitionFreeSpace(String partition)

Integer getPrimaryUserId()

ProcessInfo getProcessByName(String processName)

String getProcessPid(String process)

String getProductType()

String getProductVariant()

String getProperty(String name)

ITestDevice.RecoveryMode getRecoveryMode()

InputStreamSource getScreenshot(String format)

InputStreamSource getScreenshot(long displayId)

InputStreamSource getScreenshot(String format, boolean rescale)

InputStreamSource getScreenshot()

String getSerialNumber()

String getSetting(int userId, String namespace, String key)

String getSetting(String namespace, String key)

String getSimOperator()

String getSimState()

getTombstones()

long getTotalMemory()

getUninstallablePackageNames()

boolean getUseFastbootErase()

int getUserFlags(int userId)

getUserInfos()

int getUserSerialNumber(int userId)

IManagedTestDevice.DeviceEventResponse handleAllocationEvent(DeviceEvent event)

Xử lý DeviceEvent. Quá trình này có thể hoặc không thể chuyển thiết bị này sang một lượt phân bổ mới trạng thái.

boolean hasFeature(String feature)

String installPackage(File packageFile, boolean reinstall, String... extraArgs)

String installPackage(File packageFile, boolean reinstall, boolean grantPermissions, String... extraArgs)

String installPackageForUser(File packageFile, boolean reinstall, int userId, String... extraArgs)

String installPackageForUser(File packageFile, boolean reinstall, boolean grantPermissions, int userId, String... extraArgs)

boolean isAdbRoot()

boolean isAdbTcp()
boolean isAppEnumerationSupported()

boolean isDeviceEncrypted()

boolean isDirectory(String path)

boolean isEnableAdbRoot()
boolean isEncryptionSupported()

boolean isExecutable(String fullPath)

boolean isFastbootEnabled()

boolean isHeadless()

boolean isMultiUserSupported()

boolean isPackageInstalled(String packageName, String userId)

boolean isPackageInstalled(String packageName)

boolean isRuntimePermissionSupported()

boolean isStateBootloaderOrFastbootd()

boolean isUserRunning(int userId)

boolean isUserSecondary(int userId)

boolean isWifiEnabled()

listDisplayIds()

listUsers()

boolean logBugreport(String dataName, ITestLogger listener)

void logOnDevice(String tag, Log.LogLevel level, String format, Object... args)

void nonBlockingReboot()

void postAdbRootAction()

Ghi đè nếu thiết bị cần thực hiện một số thao tác cụ thể sau adb gốc và trước lệnh thiết bị đã kết nối mạng trở lại.

void postAdbUnrootAction()

Ghi đè nếu thiết bị cần thực hiện một số thao tác cụ thể sau khi gỡ bỏ adb và trước thiết bị đã kết nối mạng trở lại.

void postBootSetup()

void postInvocationTearDown(Throwable exception)

void preInvocationSetup(IBuildInfo info, MultiMap<String, String> attributes)

boolean pullDir(String deviceFilePath, File localDir)

boolean pullFile(String remoteFilePath, File localFile)

File pullFile(String remoteFilePath)

String pullFileContents(String remoteFilePath)

File pullFileFromExternal(String remoteFilePath)

boolean pushDir(File localFileDir, String deviceFilePath, excludedDirectories)

boolean pushDir(File localFileDir, String deviceFilePath)

boolean pushFile(File localFile, String remoteFilePath)

boolean pushString(String contents, String remoteFilePath)

void reboot(String reason)

void reboot()

void rebootIntoBootloader()

void rebootIntoFastbootd()

void rebootIntoRecovery()

void rebootIntoSideload()

void rebootIntoSideload(boolean autoReboot)

void rebootUntilOnline()
void rebootUntilOnline(String reason)

void rebootUserspace()
void rebootUserspaceUntilOnline()
void recoverDevice()

Cố gắng khôi phục khả năng kết nối của thiết bị.

void remountSystemWritable()

void remountVendorWritable()

boolean removeAdmin(String componentName, int userId)

void removeOwners()

boolean removeUser(int userId)

void resetContentProviderSetup()

Đặt lại cờ cho chế độ thiết lập trình cung cấp nội dung để kích hoạt lại cờ.

boolean runInstrumentationTests(IRemoteAndroidTestRunner runner, ITestLifeCycleReceiver... listeners)

boolean runInstrumentationTests(IRemoteAndroidTestRunner runner, listeners)

boolean runInstrumentationTestsAsUser(IRemoteAndroidTestRunner runner, int userId, ITestLifeCycleReceiver... listeners)

boolean runInstrumentationTestsAsUser(IRemoteAndroidTestRunner runner, int userId, listeners)

void setConfiguration(IConfiguration configuration)

Chèn IConfiguration đang sử dụng.

void setDate(Date date)

boolean setDeviceOwner(String componentName, int userId)

void setDeviceState(TestDeviceState deviceState)

void setEmulatorOutputStream(SizeLimitedOutputStream output)

Đối với trình mô phỏng, hãy đặt SizeLimitedOutputStream thành nhật ký đầu ra

void setEmulatorProcess(Process p)

void setFastbootEnabled(boolean fastbootEnabled)

void setFastbootPath(String fastbootPath)

void setIDevice(IDevice newDevice)

void setOptions(TestDeviceOptions options)

boolean setProperty(String propKey, String propValue)

void setRecovery(IDeviceRecovery recovery)

void setRecoveryMode(ITestDevice.RecoveryMode mode)

void setSetting(String namespace, String key, String value)

void setSetting(int userId, String namespace, String key, String value)

void setUseFastbootErase(boolean useFastbootErase)

void startLogcat()

boolean startUser(int userId)

boolean startUser(int userId, boolean waitFlag)

void stopEmulatorOutput()

void stopLogcat()

boolean stopUser(int userId)

boolean stopUser(int userId, boolean waitFlag, boolean forceFlag)

String switchToAdbTcp()

boolean switchToAdbUsb()

boolean switchUser(int userId)

boolean switchUser(int userId, long timeout)

boolean syncFiles(File localFileDir, String deviceFilePath)

Bugreport takeBugreport()

boolean unencryptDevice()

String uninstallPackage(String packageName)

String uninstallPackageForUser(String packageName, int userId)

boolean unlockDevice()

boolean waitForBootComplete(long timeOut)

void waitForDeviceAvailable()

void waitForDeviceAvailable(long waitTime)

boolean waitForDeviceInRecovery(long waitTime)

boolean waitForDeviceInSideload(long waitTime)

boolean waitForDeviceNotAvailable(long waitTime)

void waitForDeviceOnline()

void waitForDeviceOnline(long waitTime)

boolean waitForDeviceShell(long waitTime)

Phương thức được bảo vệ

void checkApiLevelAgainst(String feature, int strictMinLevel)
NativeDevice.RebootDeviceAction createRebootDeviceAction(NativeDevice.RebootMode rebootMode, String reason)

Tạo RebootDeviceAction để dùng khi thực hiện thao tác khởi động lại.

void doAdbReboot(NativeDevice.RebootMode rebootMode, String reason)

Khởi động lại adb.

void ensureRuntimePermissionSupported()

phương thức trợ giúp để gửi trường hợp ngoại lệ nếu quyền khi bắt đầu chạy không được hỗ trợ

InputStreamSource getBugreportInternal()
File getBugreportzInternal()

Phương thức của Trình trợ giúp nội bộ để lấy tệp zip bugreportz dưới dạng ERROR(/File).

IRunUtil getRunUtil()

Tải thực thể RunUtil để sử dụng.

String internalGetProperty(String propName, String fastbootVar, String description)

Tìm nạp một thuộc tính thiết bị từ bộ nhớ đệm ddmlib theo mặc định và quay lại phương thức "adb" shell getprop` hoặc "fastboot getvar" tuỳ thuộc vào việc thiết bị có đang ở chế độ Fastboot hay không.

boolean isNewer(File localFile, IFileEntry entry)

Trả về true nếu tệp trên máy mới hơn tệp từ xa.

boolean performDeviceAction(String actionDescription, com.android.tradefed.device.NativeDevice.DeviceAction action, int retryAttempts)

Thực hiện một hành động trên thiết bị này.

void postAdbReboot()

Những thao tác bổ sung mà bạn có thể thực hiện sau khi khởi động lại.

void prePostBootSetup()

Cho phép từng loại thiết bị (AndroidNativeDevice, TestDevice) ghi đè phương thức này cho thiết lập khởi động bài đăng cụ thể.

void setClock(Clock clock)

Đặt thực thể Đồng hồ để sử dụng.

void setLogStartDelay(int delay)

Đặt thời gian tính bằng mili giây để chờ trước khi bắt đầu thu thập logcat cho một thiết bị trực tuyến.

void waitForDeviceNotAvailable(String operationDesc, long time)

Hằng số

Mã INVALID_USER_ID

public static final int INVALID_USER_ID

Giá trị được trả về cho mọi mã nhận dạng người dùng không hợp lệ/không tìm thấy: UserHandle đã xác định giá trị -10000

Giá trị không đổi: -10.000 (0xffffd8f0)

MAX_HOST_DEVICE_TIME_OFFSET

protected static final long MAX_HOST_DEVICE_TIME_OFFSET

Giá trị không đổi: 5.000 (0x0000000000001388)

MAX_RETRY_ Channel

protected static final int MAX_RETRY_ATTEMPTS

số lần thử thực hiện lại lệnh mặc định

Giá trị không đổi: 2 (0x00000002)

Trường

THẺ SD

protected static final String SD_CARD

ĐÃ_ĐƯỢC TRUY CẬP

protected static final String STORAGE_EMULATED

mOptions

protected TestDeviceOptions mOptions

mStateMonitor

protected final IDeviceStateMonitor mStateMonitor

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

Thiết bị gốc

public NativeDevice (IDevice device, 
                IDeviceStateMonitor stateMonitor, 
                IDeviceMonitor allocationMonitor)

Tạo TestDevice.

Tham số
device IDevice: IDevice được liên kết

stateMonitor IDeviceStateMonitor: cơ chế IDeviceStateMonitor để sử dụng

allocationMonitor IDeviceMonitor: IDeviceMonitor để thông báo về những thay đổi ở trạng thái phân bổ. Có thể có giá trị rỗng

Phương thức công khai

checkApilevelAgainstNextRelease

public boolean checkApiLevelAgainstNextRelease (int strictMinLevel)

Tham số
strictMinLevel int

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

kiểm tra kết nối

public boolean checkConnectivity ()

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

clearErrorDialogs

public boolean clearErrorDialogs ()

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

clearLastConnectWifiNetwork

public void clearLastConnectedWifiNetwork ()

xoáLogcat

public void clearLogcat ()

kết nối vớiMạng Wifi

public boolean connectToWifiNetwork (String wifiSsid, 
                String wifiPsk)

Tham số
wifiSsid String

wifiPsk String

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

kết nối vớiMạng Wifi

public boolean connectToWifiNetwork (String wifiSsid, 
                String wifiPsk, 
                boolean scanSsid)

Tham số
wifiSsid String

wifiPsk String

scanSsid boolean

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

kết nối vớiWi-FiMạng nếu cần

public boolean connectToWifiNetworkIfNeeded (String wifiSsid, 
                String wifiPsk, 
                boolean scanSsid)

Tham số
wifiSsid String

wifiPsk String

scanSsid boolean

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

kết nối vớiWi-FiMạng nếu cần

public boolean connectToWifiNetworkIfNeeded (String wifiSsid, 
                String wifiPsk)

Tham số
wifiSsid String

wifiPsk String

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

Tạo người dùng

public int createUser (String name, 
                boolean guest, 
                boolean ephemeral)

Tham số
name String

guest boolean

ephemeral boolean

Giá trị trả về
int

Gửi
DeviceNotAvailableException

Tạo người dùng

public int createUser (String name)

Tham số
name String

Giá trị trả về
int

Gửi
DeviceNotAvailableException

createNgười dùngKhôngThrow

public int createUserNoThrow (String name)

Tham số
name String

Giá trị trả về
int

Gửi
DeviceNotAvailableException

xoá tệp

public void deleteFile (String deviceFilePath)

Tham số
deviceFilePath String

Gửi
DeviceNotAvailableException

thiết bị đã khởi động lại mềm

public boolean deviceSoftRestarted (ProcessInfo prevSystemServerProcess)

Tham số
prevSystemServerProcess ProcessInfo

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

thiết bịKhởi động lạiKhởi động lại Thiết bị

public boolean deviceSoftRestartedSince (long utcEpochTime, 
                TimeUnit timeUnit)

Tham số
utcEpochTime long

timeUnit TimeUnit

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

vô hiệu hoáAdbRoot

public boolean disableAdbRoot ()

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

tắt tính năng Bảo vệ bàn phím

public void disableKeyguard ()

Gửi
DeviceNotAvailableException

vô hiệu hoáNetworkMonitor

public boolean disableNetworkMonitor ()

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

ngắt kết nối TừWifi

public boolean disconnectFromWifi ()

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

notFileExist

public boolean doesFileExist (String deviceFilePath)

Tham số
deviceFilePath String

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

Tệp báo lỗi

public File dumpHeap (String process, 
                String devicePath)

Tham số
process String

devicePath String

Giá trị trả về
File

Gửi
DeviceNotAvailableException

enableAdbRoot

public boolean enableAdbRoot ()

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

bậtNetworkMonitor

public boolean enableNetworkMonitor ()

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

mã hoá thiết bị

public boolean encryptDevice (boolean inplace)

Tham số
inplace boolean

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

Thực thiAdbCommand

public String executeAdbCommand (long timeout, 
                String... cmdArgs)

Tham số
timeout long

cmdArgs String

Giá trị trả về
String

Gửi
DeviceNotAvailableException

Thực thiAdbCommand

public String executeAdbCommand (String... cmdArgs)

Tham số
cmdArgs String

Giá trị trả về
String

Gửi
DeviceNotAvailableException

Thực thi FastbootCommand

public CommandResult executeFastbootCommand (String... cmdArgs)

Tham số
cmdArgs String

Giá trị trả về
CommandResult

Gửi
DeviceNotAvailableException

Thực thi FastbootCommand

public CommandResult executeFastbootCommand (long timeout, 
                String... cmdArgs)

Tham số
timeout long

cmdArgs String

Giá trị trả về
CommandResult

Gửi
DeviceNotAvailableException

Thực thiLongFastbootCommand

public CommandResult executeLongFastbootCommand (String... cmdArgs)

Tham số
cmdArgs String

Giá trị trả về
CommandResult

Gửi
DeviceNotAvailableException

Thực thiShellCommand

public String executeShellCommand (String command)

Tham số
command String

Giá trị trả về
String

Gửi
DeviceNotAvailableException

Thực thiShellCommand

public void executeShellCommand (String command, 
                IShellOutputReceiver receiver, 
                long maxTimeToOutputShellResponse, 
                TimeUnit timeUnit, 
                int retryAttempts)

Tham số
command String

receiver IShellOutputReceiver

maxTimeToOutputShellResponse long

timeUnit TimeUnit

retryAttempts int

Gửi
DeviceNotAvailableException

Thực thiShellCommand

public void executeShellCommand (String command, 
                IShellOutputReceiver receiver, 
                long maxTimeoutForCommand, 
                long maxTimeToOutputShellResponse, 
                TimeUnit timeUnit, 
                int retryAttempts)

Tham số
command String

receiver IShellOutputReceiver

maxTimeoutForCommand long

maxTimeToOutputShellResponse long

timeUnit TimeUnit

retryAttempts int

Gửi
DeviceNotAvailableException

Thực thiShellCommand

public void executeShellCommand (String command, 
                IShellOutputReceiver receiver)

Tham số
command String

receiver IShellOutputReceiver

Gửi
DeviceNotAvailableException

Thực thiShellV2Command

public CommandResult executeShellV2Command (String cmd)

Tham số
cmd String

Giá trị trả về
CommandResult

Gửi
DeviceNotAvailableException

Thực thiShellV2Command

public CommandResult executeShellV2Command (String cmd, 
                OutputStream pipeToOutput)

Tham số
cmd String

pipeToOutput OutputStream

Giá trị trả về
CommandResult

Gửi
DeviceNotAvailableException

Thực thiShellV2Command

public CommandResult executeShellV2Command (String cmd, 
                File pipeAsInput)

Tham số
cmd String

pipeAsInput File

Giá trị trả về
CommandResult

Gửi
DeviceNotAvailableException

Thực thiShellV2Command

public CommandResult executeShellV2Command (String cmd, 
                long maxTimeoutForCommand, 
                TimeUnit timeUnit, 
                int retryAttempts)

Tham số
cmd String

maxTimeoutForCommand long

timeUnit TimeUnit

retryAttempts int

Giá trị trả về
CommandResult

Gửi
DeviceNotAvailableException

Thực thiShellV2Command

public CommandResult executeShellV2Command (String cmd, 
                long maxTimeoutForCommand, 
                TimeUnit timeUnit)

Tham số
cmd String

maxTimeoutForCommand long

timeUnit TimeUnit

Giá trị trả về
CommandResult

Gửi
DeviceNotAvailableException

Thực thiShellV2Command

public CommandResult executeShellV2Command (String cmd, 
                File pipeAsInput, 
                OutputStream pipeToOutput, 
                long maxTimeoutForCommand, 
                TimeUnit timeUnit, 
                int retryAttempts)

Tham số
cmd String

pipeAsInput File

pipeToOutput OutputStream

maxTimeoutForCommand long

timeUnit TimeUnit

retryAttempts int

Giá trị trả về
CommandResult

Gửi
DeviceNotAvailableException

Thực thiShellV2Command

public CommandResult executeShellV2Command (String cmd, 
                File pipeAsInput, 
                OutputStream pipeToOutput, 
                OutputStream pipeToError, 
                long maxTimeoutForCommand, 
                TimeUnit timeUnit, 
                int retryAttempts)

Tham số
cmd String

pipeAsInput File

pipeToOutput OutputStream

pipeToError OutputStream

maxTimeoutForCommand long

timeUnit TimeUnit

retryAttempts int

Giá trị trả về
CommandResult

Gửi
DeviceNotAvailableException

khởi động nhanhWipePartition

public CommandResult fastbootWipePartition (String partition)

Tham số
partition String

Giá trị trả về
CommandResult

Gửi
DeviceNotAvailableException

getActiveApexes

public  getActiveApexes ()

Giá trị trả về

Gửi
DeviceNotAvailableException

getTất cả chế độ cài đặt

public  getAllSettings (String namespace)

Tham số
namespace String

Giá trị trả về

Gửi
DeviceNotAvailableException

getAllocationState

public DeviceAllocationState getAllocationState ()

Giá trị trả về
DeviceAllocationState

getAndroidId

public String getAndroidId (int userId)

Tham số
userId int

Giá trị trả về
String

Gửi
DeviceNotAvailableException

getAndroidIds

public  getAndroidIds ()

Giá trị trả về

Gửi
DeviceNotAvailableException

getApiCấp độ

public int getApiLevel ()

Giá trị trả về
int

Gửi
DeviceNotAvailableException

getAppPackageInfo

public PackageInfo getAppPackageInfo (String packageName)

Tham số
packageName String

Giá trị trả về
PackageInfo

Gửi
DeviceNotAvailableException

getAppPackageInfos

public  getAppPackageInfos ()

Giá trị trả về

Gửi
DeviceNotAvailableException

nhận phiên bản băng tần cơ sở

public String getBasebandVersion ()

Giá trị trả về
String

Gửi
DeviceNotAvailableException

getBattery

public Integer getBattery ()

Giá trị trả về
Integer

Thuộc tính getBoolean

public boolean getBooleanProperty (String name, 
                boolean defaultValue)

Tham số
name String

defaultValue boolean

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

getNhật ký khởi động

public  getBootHistory ()

Giá trị trả về

Gửi
DeviceNotAvailableException

nhận nhật ký khởi động từ

public  getBootHistorySince (long utcEpochTime, 
                TimeUnit timeUnit)

Tham số
utcEpochTime long

timeUnit TimeUnit

Giá trị trả về

Gửi
DeviceNotAvailableException

nhận phiên bản trình tải khởi động

public String getBootloaderVersion ()

Giá trị trả về
String

Gửi
DeviceNotAvailableException

nhận báo cáo lỗi

public InputStreamSource getBugreport ()

Giá trị trả về
InputStreamSource

lỗi báo cáo lỗi

public InputStreamSource getBugreportz ()

Giá trị trả về
InputStreamSource

getBuildAlias

public String getBuildAlias ()

Giá trị trả về
String

Gửi
DeviceNotAvailableException

tạo hương vị

public String getBuildFlavor ()

Giá trị trả về
String

Gửi
DeviceNotAvailableException

getBuildId

public String getBuildId ()

Giá trị trả về
String

Gửi
DeviceNotAvailableException

getBuildKýKeys

public String getBuildSigningKeys ()

Giá trị trả về
String

Gửi
DeviceNotAvailableException

getBộ nhớ đệm thiết bị mô tả

public DeviceDescriptor getCachedDeviceDescriptor ()

Giá trị trả về
DeviceDescriptor

nhận trẻ em

public String[] getChildren (String path)

Tham số
path String

Giá trị trả về
String[]

Gửi
DeviceNotAvailableException

Nhận trạng thái có thể gập lại hiện tại

public DeviceFoldableState getCurrentFoldableState ()

Giá trị trả về
DeviceFoldableState

Gửi
DeviceNotAvailableException

nhận người dùng hiện tại

public int getCurrentUser ()

Giá trị trả về
int

Gửi
DeviceNotAvailableException

getDeviceClass

public String getDeviceClass ()

Giá trị trả về
String

nhận ngày thiết bị

public long getDeviceDate ()

Giá trị trả về
long

Gửi
DeviceNotAvailableException

getDeviceDescriptor

public DeviceDescriptor getDeviceDescriptor ()

Giá trị trả về
DeviceDescriptor

nhận Trạng thái thiết bị

public TestDeviceState getDeviceState ()

Giá trị trả về
TestDeviceState

getDeviceTimeOffset

public long getDeviceTimeOffset (Date date)

Tham số
date Date

Giá trị trả về
long

Gửi
DeviceNotAvailableException

getEmulatorOutput

public InputStreamSource getEmulatorOutput ()

Giá trị trả về
InputStreamSource

getEmulatorProcess

public Process getEmulatorProcess ()

Giá trị trả về
Process

getExecuteShellCommandLog

public final File getExecuteShellCommandLog ()

Nhật ký chứa tất cả nhật ký executeShellCommand(String).

Giá trị trả về
File

getExternalStoreFreeSpace

public long getExternalStoreFreeSpace ()

Giá trị trả về
long

Gửi
DeviceNotAvailableException

getFastbootPath

public String getFastbootPath ()

Giá trị trả về
String

loại chiến dịch khởi động nhanh

public String getFastbootProductType ()

Giá trị trả về
String

Gửi
DeviceNotAvailableException

phương thức get FastbootProductVariant

public String getFastbootProductVariant ()

Giá trị trả về
String

Gửi
DeviceNotAvailableException

getFastbootSerialNumber

public String getFastbootSerialNumber ()

Giá trị trả về
String

phương thức khởi động nhanh

public String getFastbootVariable (String variableName)

Tham số
variableName String

Giá trị trả về
String

Gửi
DeviceNotAvailableException

lấy phiên bản khởi động nhanh

public String getFastbootVersion ()

Giá trị trả về
String

getFileEntry

public IFileEntry getFileEntry (String path)

Tham số
path String

Giá trị trả về
IFileEntry

Gửi
DeviceNotAvailableException

getFileEntry

public IFileEntry getFileEntry (FileListingService.FileEntry entry)

Trình trợ giúp không chính thức để nhận FileEntry từ một đường dẫn không phải gốc. FIXME: Tái cấu trúc phần tử FileEntry của hệ thống để có sẵn từ bất kỳ đường dẫn nào. (kể cả không phải thư mục gốc).

Tham số
entry FileListingService.FileEntry: FileEntry không nhất thiết phải là gốc như Ddmlib yêu cầu.

Giá trị trả về
IFileEntry FileEntryWrapper đại diện cho FileEntry.

Gửi
DeviceNotAvailableException

có thể gập lạiStates

public  getFoldableStates ()

Giá trị trả về

Gửi
DeviceNotAvailableException

getIDevice

public IDevice getIDevice ()

Giá trị trả về
IDevice

getInstallPackageNames

public  getInstalledPackageNames ()

Giá trị trả về

Gửi
DeviceNotAvailableException

getIntProperty

public long getIntProperty (String name, 
                long defaultValue)

Tham số
name String

defaultValue long

Giá trị trả về
long

Gửi
DeviceNotAvailableException

getIpAddress

public String getIpAddress ()

Giá trị trả về
String

Gửi
DeviceNotAvailableException

nhận trạng thái bảo vệ phím

public KeyguardControllerState getKeyguardState ()

Giá trị trả về
KeyguardControllerState

Gửi
DeviceNotAvailableException

getLastIntentRestartTimeMillis

public long getLastExpectedRebootTimeMillis ()

Giá trị trả về
long

getLaunchApilevel

public int getLaunchApiLevel ()

Giá trị trả về
int

Gửi
DeviceNotAvailableException

lấy Logcat

public InputStreamSource getLogcat ()

Giá trị trả về
InputStreamSource

lấy Logcat

public InputStreamSource getLogcat (int maxBytes)

Tham số
maxBytes int

Giá trị trả về
InputStreamSource

tải LogcatDump

public InputStreamSource getLogcatDump ()

Giá trị trả về
InputStreamSource

Nhận Logcat từ

public InputStreamSource getLogcatSince (long date)

Tham số
date long

Giá trị trả về
InputStreamSource

getMacAddress

public String getMacAddress ()

Giá trị trả về
String

getMainlineModuleInfo

public  getMainlineModuleInfo ()

Giá trị trả về

Gửi
DeviceNotAvailableException

getMaxNumberOfRunningNgười dùng được hỗ trợ

public int getMaxNumberOfRunningUsersSupported ()

Giá trị trả về
int

Gửi
DeviceNotAvailableException

getMaxNumberOfUsersSupported

public int getMaxNumberOfUsersSupported ()

Giá trị trả về
int

Gửi
DeviceNotAvailableException

getMonitor

public IDeviceStateMonitor getMonitor ()

Giá trị trả về
IDeviceStateMonitor

getMountPoint

public String getMountPoint (String mountName)

Tham số
mountName String

Giá trị trả về
String

getMountPointInfo

public ITestDevice.MountPointInfo getMountPointInfo (String mountpoint)

Tham số
mountpoint String

Giá trị trả về
ITestDevice.MountPointInfo

Gửi
DeviceNotAvailableException

getMountPointInfo

public  getMountPointInfo ()

Giá trị trả về

Gửi
DeviceNotAvailableException

getOptions

public TestDeviceOptions getOptions ()

Giá trị trả về
TestDeviceOptions

getPartitionFreeSpace

public long getPartitionFreeSpace (String partition)

Tham số
partition String

Giá trị trả về
long

Gửi
DeviceNotAvailableException

getPrimaryUserId

public Integer getPrimaryUserId ()

Giá trị trả về
Integer

Gửi
DeviceNotAvailableException

getProcessByName

public ProcessInfo getProcessByName (String processName)

Tham số
processName String

Giá trị trả về
ProcessInfo

Gửi
DeviceNotAvailableException

getProcessPid

public String getProcessPid (String process)

Tham số
process String

Giá trị trả về
String

Gửi
DeviceNotAvailableException

getProductType

public String getProductType ()

Giá trị trả về
String

Gửi
DeviceNotAvailableException

getProductVariant

public String getProductVariant ()

Giá trị trả về
String

Gửi
DeviceNotAvailableException

nhận thuộc tính

public String getProperty (String name)

Tham số
name String

Giá trị trả về
String

Gửi
DeviceNotAvailableException

lấy lại Chế độ khôi phục

public ITestDevice.RecoveryMode getRecoveryMode ()

Giá trị trả về
ITestDevice.RecoveryMode

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

public InputStreamSource getScreenshot (String format)

Tham số
format String

Giá trị trả về
InputStreamSource

Gửi
DeviceNotAvailableException

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

public InputStreamSource getScreenshot (long displayId)

Tham số
displayId long

Giá trị trả về
InputStreamSource

Gửi
DeviceNotAvailableException

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

public InputStreamSource getScreenshot (String format, 
                boolean rescale)

Tham số
format String

rescale boolean

Giá trị trả về
InputStreamSource

Gửi
DeviceNotAvailableException

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

public InputStreamSource getScreenshot ()

Giá trị trả về
InputStreamSource

Gửi
DeviceNotAvailableException

getSerialNumber

public String getSerialNumber ()

Giá trị trả về
String

getCài đặt

public String getSetting (int userId, 
                String namespace, 
                String key)

Tham số
userId int

namespace String

key String

Giá trị trả về
String

Gửi
DeviceNotAvailableException

getCài đặt

public String getSetting (String namespace, 
                String key)

Tham số
namespace String

key String

Giá trị trả về
String

Gửi
DeviceNotAvailableException

getSimOperator

public String getSimOperator ()

Giá trị trả về
String

getSimState

public String getSimState ()

Giá trị trả về
String

getTombstones

public  getTombstones ()

Giá trị trả về

Gửi
DeviceNotAvailableException

getTotalMemory

public long getTotalMemory ()

Giá trị trả về
long

getUninstallablePackageNames

public  getUninstallablePackageNames ()

Giá trị trả về

Gửi
DeviceNotAvailableException

getUseKhởi động nhanh

public boolean getUseFastbootErase ()

Giá trị trả về
boolean

getUserGắn cờ

public int getUserFlags (int userId)

Tham số
userId int

Giá trị trả về
int

Gửi
DeviceNotAvailableException

getUserInfo

public  getUserInfos ()

Giá trị trả về

Gửi
DeviceNotAvailableException

getUserSerialNumber

public int getUserSerialNumber (int userId)

Tham số
userId int

Giá trị trả về
int

Gửi
DeviceNotAvailableException

sự kiện xử lýAllocationEvent

public IManagedTestDevice.DeviceEventResponse handleAllocationEvent (DeviceEvent event)

Xử lý DeviceEvent. Quá trình này có thể hoặc không thể chuyển thiết bị này sang một lượt phân bổ mới trạng thái.

Tham số
event DeviceEvent

Giá trị trả về
IManagedTestDevice.DeviceEventResponse

cóTính năng

public boolean hasFeature (String feature)

Tham số
feature String

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

lượt cài đặt

public String installPackage (File packageFile, 
                boolean reinstall, 
                String... extraArgs)

Tham số
packageFile File

reinstall boolean

extraArgs String

Giá trị trả về
String

Gửi
DeviceNotAvailableException

lượt cài đặt

public String installPackage (File packageFile, 
                boolean reinstall, 
                boolean grantPermissions, 
                String... extraArgs)

Tham số
packageFile File

reinstall boolean

grantPermissions boolean

extraArgs String

Giá trị trả về
String

Gửi
DeviceNotAvailableException

lượt cài đặt cho người dùng gói cài đặt

public String installPackageForUser (File packageFile, 
                boolean reinstall, 
                int userId, 
                String... extraArgs)

Tham số
packageFile File

reinstall boolean

userId int

extraArgs String

Giá trị trả về
String

Gửi
DeviceNotAvailableException

lượt cài đặt cho người dùng gói cài đặt

public String installPackageForUser (File packageFile, 
                boolean reinstall, 
                boolean grantPermissions, 
                int userId, 
                String... extraArgs)

Tham số
packageFile File

reinstall boolean

grantPermissions boolean

userId int

extraArgs String

Giá trị trả về
String

Gửi
DeviceNotAvailableException

isAdbRoot

public boolean isAdbRoot ()

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

isAdbTcp

public boolean isAdbTcp ()

Giá trị trả về
boolean

isAppEnumeration được hỗ trợ

public boolean isAppEnumerationSupported ()

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

Đã mã hoá thiết bị

public boolean isDeviceEncrypted ()

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

isDirectory

public boolean isDirectory (String path)

Tham số
path String

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

isEnableAdbRoot

public boolean isEnableAdbRoot ()

Giá trị trả về
boolean true nếu có phải bật adb gốc trên thiết bị

Hỗ trợ Mã hoá

public boolean isEncryptionSupported ()

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

có thể thực thi

public boolean isExecutable (String fullPath)

Tham số
fullPath String

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

isFastbootEnabled

public boolean isFastbootEnabled ()

Giá trị trả về
boolean

Không có giao diện người dùng

public boolean isHeadless ()

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

được MultiUser hỗ trợ

public boolean isMultiUserSupported ()

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

Đã cài đặt gói isPackage

public boolean isPackageInstalled (String packageName, 
                String userId)

Tham số
packageName String

userId String

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

Đã cài đặt gói isPackage

public boolean isPackageInstalled (String packageName)

Tham số
packageName String

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

isRuntimePermission được hỗ trợ

public boolean isRuntimePermissionSupported ()

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

isStateKhởi động hoặc Khởi động nhanh

public boolean isStateBootloaderOrFastbootd ()

Giá trị trả về
boolean

đang chạy người dùng

public boolean isUserRunning (int userId)

Tham số
userId int

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

isUserPhụ

public boolean isUserSecondary (int userId)

Tham số
userId int

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

isWifiEnabled

public boolean isWifiEnabled ()

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

listDisplayIds

public  listDisplayIds ()

Giá trị trả về

Gửi
DeviceNotAvailableException

Người dùng list

public  listUsers ()

Giá trị trả về

Gửi
DeviceNotAvailableException

báo cáo lỗi

public boolean logBugreport (String dataName, 
                ITestLogger listener)

Tham số
dataName String

listener ITestLogger

Giá trị trả về
boolean

đăng nhập trên thiết bị

public void logOnDevice (String tag, 
                Log.LogLevel level, 
                String format, 
                Object... args)

Tham số
tag String

level Log.LogLevel

format String

args Object

không chặn khởi động lại

public void nonBlockingReboot ()

Gửi
DeviceNotAvailableException

PostAdbRootAction

public void postAdbRootAction ()

Ghi đè nếu thiết bị cần thực hiện một số thao tác cụ thể sau adb gốc và trước lệnh thiết bị đã kết nối mạng trở lại. Cách triển khai mặc định không bao gồm bất kỳ hành động bổ sung nào. Không đảm bảo sẽ bật adb gốc ở giai đoạn này.

Gửi
DeviceNotAvailableException

PostAdbUnrootAction

public void postAdbUnrootAction ()

Ghi đè nếu thiết bị cần thực hiện một số thao tác cụ thể sau khi gỡ bỏ adb và trước thiết bị đã kết nối mạng trở lại. Phương thức triển khai mặc định không bao gồm bất kỳ hành động nào khác. Không đảm bảo rằng gốc adb sẽ bị tắt ở giai đoạn này.

Gửi
DeviceNotAvailableException

Thiết lập postBoot

public void postBootSetup ()

Gửi
DeviceNotAvailableException

PostInvocationTearDown

public void postInvocationTearDown (Throwable exception)

Tham số
exception Throwable

Thiết lập preInvocation

public void preInvocationSetup (IBuildInfo info, 
                MultiMap<String, String> attributes)

Tham số
info IBuildInfo

attributes MultiMap

Gửi
DeviceNotAvailableException
TargetSetupError

kéoDir

public boolean pullDir (String deviceFilePath, 
                File localDir)

Tham số
deviceFilePath String

localDir File

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

tệp kéo

public boolean pullFile (String remoteFilePath, 
                File localFile)

Tham số
remoteFilePath String

localFile File

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

tệp kéo

public File pullFile (String remoteFilePath)

Tham số
remoteFilePath String

Giá trị trả về
File

Gửi
DeviceNotAvailableException

putFileContents

public String pullFileContents (String remoteFilePath)

Tham số
remoteFilePath String

Giá trị trả về
String

Gửi
DeviceNotAvailableException

kéotệp từ bên ngoài

public File pullFileFromExternal (String remoteFilePath)

Tham số
remoteFilePath String

Giá trị trả về
File

Gửi
DeviceNotAvailableException

pushDir

public boolean pushDir (File localFileDir, 
                String deviceFilePath, 
                 excludedDirectories)

Tham số
localFileDir File

deviceFilePath String

excludedDirectories

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

pushDir

public boolean pushDir (File localFileDir, 
                String deviceFilePath)

Tham số
localFileDir File

deviceFilePath String

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

tệp đẩy

public boolean pushFile (File localFile, 
                String remoteFilePath)

Tham số
localFile File

remoteFilePath String

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

chuỗi thông báo đẩy

public boolean pushString (String contents, 
                String remoteFilePath)

Tham số
contents String

remoteFilePath String

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

khởi động lại

public void reboot (String reason)

Tham số
reason String

Gửi
DeviceNotAvailableException

khởi động lại

public void reboot ()

Gửi
DeviceNotAvailableException

khởi động lạiIntoBootLoader

public void rebootIntoBootloader ()

Gửi
DeviceNotAvailableException

khởi động lạiIntoFastbootd

public void rebootIntoFastbootd ()

Gửi
DeviceNotAvailableException

khởi động lạiIntoRecovery

public void rebootIntoRecovery ()

Gửi
DeviceNotAvailableException

khởi động lạiIntoSideload

public void rebootIntoSideload ()

Gửi
DeviceNotAvailableException

khởi động lạiIntoSideload

public void rebootIntoSideload (boolean autoReboot)

Tham số
autoReboot boolean

Gửi
DeviceNotAvailableException

khởi động lại cho đến khi trực tuyến

public void rebootUntilOnline ()

Gửi
DeviceNotAvailableException

khởi động lại cho đến khi trực tuyến

public void rebootUntilOnline (String reason)

Tham số
reason String

Gửi
DeviceNotAvailableException

khởi động lạikhông gian người dùng

public void rebootUserspace ()

Gửi
DeviceNotAvailableException

khởi động lại

public void rebootUserspaceUntilOnline ()

Gửi
DeviceNotAvailableException

khôi phục thiết bị

public void recoverDevice ()

Cố gắng khôi phục khả năng kết nối của thiết bị.

Gửi
DeviceNotAvailableException nếu thiết bị không còn khả dụng

kết nối lạiHệ thống có thể ghi

public void remountSystemWritable ()

Gửi
DeviceNotAvailableException

gắn lại nhà cung cấp có thể ghi

public void remountVendorWritable ()

Gửi
DeviceNotAvailableException

removeAdmin

public boolean removeAdmin (String componentName, 
                int userId)

Tham số
componentName String

userId int

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

removeOwners

public void removeOwners ()

Gửi
DeviceNotAvailableException

xoá người dùng

public boolean removeUser (int userId)

Tham số
userId int

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

thiết lập lạiContentProviderSetup

public void resetContentProviderSetup ()

Đặt lại cờ cho chế độ thiết lập trình cung cấp nội dung để kích hoạt lại cờ.

chạyInstrumentationTests

public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner, 
                ITestLifeCycleReceiver... listeners)

Tham số
runner IRemoteAndroidTestRunner

listeners ITestLifeCycleReceiver

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

chạyInstrumentationTests

public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner, 
                 listeners)

Tham số
runner IRemoteAndroidTestRunner

listeners

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

runInstrumentationTestsAsUser

public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, 
                int userId, 
                ITestLifeCycleReceiver... listeners)

Tham số
runner IRemoteAndroidTestRunner

userId int

listeners ITestLifeCycleReceiver

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

runInstrumentationTestsAsUser

public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, 
                int userId, 
                 listeners)

Tham số
runner IRemoteAndroidTestRunner

userId int

listeners

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

Cấu hình đặt

public void setConfiguration (IConfiguration configuration)

Chèn IConfiguration đang sử dụng.

Tham số
configuration IConfiguration

ngày đặt

public void setDate (Date date)

Tham số
date Date

Gửi
DeviceNotAvailableException

setDeviceOwner

public boolean setDeviceOwner (String componentName, 
                int userId)

Tham số
componentName String

userId int

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

Trạng thái thiết bị

public void setDeviceState (TestDeviceState deviceState)

Tham số
deviceState TestDeviceState

setEmulatorOutputStream

public void setEmulatorOutputStream (SizeLimitedOutputStream output)

Đối với trình mô phỏng, hãy đặt SizeLimitedOutputStream thành nhật ký đầu ra

Tham số
output SizeLimitedOutputStream: để ghi kết quả đầu ra

setEmulatorProcess

public void setEmulatorProcess (Process p)

Tham số
p Process

setFastbootEnabled

public void setFastbootEnabled (boolean fastbootEnabled)

Tham số
fastbootEnabled boolean

setFastbootPath

public void setFastbootPath (String fastbootPath)

Tham số
fastbootPath String

Thiết lập tôi

public void setIDevice (IDevice newDevice)

Tham số
newDevice IDevice

setOptions

public void setOptions (TestDeviceOptions options)

Tham số
options TestDeviceOptions

setProperty

public boolean setProperty (String propKey, 
                String propValue)

Tham số
propKey String

propValue String

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

Đặt lại

public void setRecovery (IDeviceRecovery recovery)

Tham số
recovery IDeviceRecovery

setRecoveryMode

public void setRecoveryMode (ITestDevice.RecoveryMode mode)

Tham số
mode ITestDevice.RecoveryMode

cài đặt

public void setSetting (String namespace, 
                String key, 
                String value)

Tham số
namespace String

key String

value String

Gửi
DeviceNotAvailableException

cài đặt

public void setSetting (int userId, 
                String namespace, 
                String key, 
                String value)

Tham số
userId int

namespace String

key String

value String

Gửi
DeviceNotAvailableException

setUse FastbootXoá

public void setUseFastbootErase (boolean useFastbootErase)

Tham số
useFastbootErase boolean

bắt đầuLogcat

public void startLogcat ()

người dùng bắt đầu

public boolean startUser (int userId)

Tham số
userId int

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

người dùng bắt đầu

public boolean startUser (int userId, 
                boolean waitFlag)

Tham số
userId int

waitFlag boolean

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

dừngTrình mô phỏngOutput

public void stopEmulatorOutput ()

dừngLogcat

public void stopLogcat ()

người dùng dừng

public boolean stopUser (int userId)

Tham số
userId int

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

người dùng dừng

public boolean stopUser (int userId, 
                boolean waitFlag, 
                boolean forceFlag)

Tham số
userId int

waitFlag boolean

forceFlag boolean

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

SwitchToAdbTcp

public String switchToAdbTcp ()

Giá trị trả về
String

Gửi
DeviceNotAvailableException

SwitchToAdbUsb

public boolean switchToAdbUsb ()

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

người dùng chuyển đổi

public boolean switchUser (int userId)

Tham số
userId int

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

người dùng chuyển đổi

public boolean switchUser (int userId, 
                long timeout)

Tham số
userId int

timeout long

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

SyncFiles

public boolean syncFiles (File localFileDir, 
                String deviceFilePath)

Tham số
localFileDir File

deviceFilePath String

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

báo cáo lỗi

public Bugreport takeBugreport ()

Giá trị trả về
Bugreport

chưa mã hoá thiết bị

public boolean unencryptDevice ()

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

gỡ cài đặt gói

public String uninstallPackage (String packageName)

Tham số
packageName String

Giá trị trả về
String

Gửi
DeviceNotAvailableException

Gỡ cài đặt cho người dùng

public String uninstallPackageForUser (String packageName, 
                int userId)

Tham số
packageName String

userId int

Giá trị trả về
String

Gửi
DeviceNotAvailableException

mở khoá thiết bị

public boolean unlockDevice ()

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

Chờ đợiKhởi động hoàn tất

public boolean waitForBootComplete (long timeOut)

Tham số
timeOut long

Giá trị trả về
boolean

Gửi
DeviceNotAvailableException

Chờ thiết bị có sẵn

public void waitForDeviceAvailable ()

Gửi
DeviceNotAvailableException

Chờ thiết bị có sẵn

public void waitForDeviceAvailable (long waitTime)

Tham số
waitTime long

Gửi
DeviceNotAvailableException

WaitForDeviceInRecovery

public boolean waitForDeviceInRecovery (long waitTime)

Tham số
waitTime long

Giá trị trả về
boolean

waitForDeviceInSideload

public boolean waitForDeviceInSideload (long waitTime)

Tham số
waitTime long

Giá trị trả về
boolean

Chờ thiết bị không có sẵn

public boolean waitForDeviceNotAvailable (long waitTime)

Tham số
waitTime long

Giá trị trả về
boolean

ChờChoThiết bịTrực tuyến

public void waitForDeviceOnline ()

Gửi
DeviceNotAvailableException

ChờChoThiết bịTrực tuyến

public void waitForDeviceOnline (long waitTime)

Tham số
waitTime long

Gửi
DeviceNotAvailableException

WaitForDeviceShell

public boolean waitForDeviceShell (long waitTime)

Tham số
waitTime long

Giá trị trả về
boolean

Phương thức được bảo vệ

CheckApiLevelAgainst

protected void checkApiLevelAgainst (String feature, 
                int strictMinLevel)

Tham số
feature String

strictMinLevel int

createRestartDeviceAction

protected NativeDevice.RebootDeviceAction createRebootDeviceAction (NativeDevice.RebootMode rebootMode, 
                String reason)

Tạo RebootDeviceAction để dùng khi thực hiện thao tác khởi động lại.

Tham số
rebootMode NativeDevice.RebootMode: một chế độ của quá trình khởi động lại này.

reason String: cho lần khởi động lại này.

Giá trị trả về
NativeDevice.RebootDeviceAction RebootDeviceAction được tạo.

Khởi động lại doAdb

protected void doAdbReboot (NativeDevice.RebootMode rebootMode, 
                String reason)

Khởi động lại adb.

Tham số
rebootMode NativeDevice.RebootMode: một chế độ của quá trình khởi động lại này.

reason String: cho lần khởi động lại này.

Gửi
DeviceNotAvailableException

đảm bảoRuntimePermissionsupported

protected void ensureRuntimePermissionSupported ()

phương thức trợ giúp để gửi trường hợp ngoại lệ nếu quyền khi bắt đầu chạy không được hỗ trợ

Gửi
DeviceNotAvailableException

lấy báo cáo lỗi nội bộ

protected InputStreamSource getBugreportInternal ()

Giá trị trả về
InputStreamSource

getBáo cáo lỗi nội bộ

protected File getBugreportzInternal ()

Phương thức của Trình trợ giúp nội bộ để lấy tệp zip bugreportz dưới dạng ERROR(/File).

Giá trị trả về
File

getRunUtil

protected IRunUtil getRunUtil ()

Tải thực thể RunUtil để sử dụng.

Giá trị trả về
IRunUtil

nội bộ,GetProperty

protected String internalGetProperty (String propName, 
                String fastbootVar, 
                String description)

Tìm nạp một thuộc tính thiết bị từ bộ nhớ đệm ddmlib theo mặc định và quay lại phương thức "adb" shell getprop` hoặc "fastboot getvar" tuỳ thuộc vào việc thiết bị có đang ở chế độ Fastboot hay không.

Tham số
propName String: Tên của thuộc tính thiết bị do `adb shell getprop` trả về

fastbootVar String: Tên của biến khởi động nhanh tương đương để truy vấn. nếu null, truy vấn khởi động nhanh sẽ không được thử

description String: Nội dung mô tả đơn giản về biến. Chữ cái đầu tiên phải được viết hoa.

Giá trị trả về
String Một chuỗi, có thể là null hoặc trống, chứa giá trị của thuộc tính đã cho

Gửi
DeviceNotAvailableException

mới hơn

protected boolean isNewer (File localFile, 
                IFileEntry entry)

Trả về true nếu tệp trên máy mới hơn tệp từ xa. IFileEntry đang được chính xác đến phút, trong trường hợp các khoảng thời gian bằng nhau, tệp sẽ được coi là mới hơn.

Tham số
localFile File

entry IFileEntry

Giá trị trả về
boolean

thực hiện hành động trên thiết bị

protected boolean performDeviceAction (String actionDescription, 
                com.android.tradefed.device.NativeDevice.DeviceAction action, 
                int retryAttempts)

Thực hiện một hành động trên thiết bị này. Cố gắng khôi phục thiết bị và thử lại lệnh (không bắt buộc) nếu thao tác không thành công.

Tham số
actionDescription String: một đoạn mô tả ngắn về hành động cần thực hiện. Dùng để ghi nhật ký chỉ có mục đích riêng.

action com.android.tradefed.device.NativeDevice.DeviceAction: hành động cần thực hiện

retryAttempts int: lần thử lại để thực hiện hành động nếu không thành công nhưng khôi phục thành công

Giá trị trả về
boolean true nếu đã thực hiện hành động thành công

Gửi
DeviceNotAvailableException nếu cố gắng khôi phục không thành công hoặc số lần thử tối đa mà không có thành công

PostAdbKhởi động lại

protected void postAdbReboot ()

Những thao tác bổ sung mà bạn có thể thực hiện sau khi khởi động lại.

Gửi
DeviceNotAvailableException

Thiết lập prePostBoot

protected void prePostBootSetup ()

Cho phép từng loại thiết bị (AndroidNativeDevice, TestDevice) ghi đè phương thức này cho thiết lập khởi động bài đăng cụ thể.

Gửi
DeviceNotAvailableException

đặtĐồng hồ

protected void setClock (Clock clock)

Đặt thực thể Đồng hồ để sử dụng.

Tham số
clock Clock

setLogStartDelay

protected void setLogStartDelay (int delay)

Đặt thời gian tính bằng mili giây để chờ trước khi bắt đầu thu thập logcat cho một thiết bị trực tuyến.

Tham số
delay int: độ trễ tính bằng mili giây

Chờ thiết bị không có sẵn

protected void waitForDeviceNotAvailable (String operationDesc, 
                long time)

Tham số
operationDesc String

time long