Các lớp lồng nhau |
---|
class | NativeDevice.AdbAction Một DeviceAction để chạy lệnh OS 'adb ....'. |
class | NativeDevice.AdbShellAction |
class | NativeDevice.RebootDeviceAction DeviceAction để khởi động lại thiết bị. |
enum | NativeDevice.RebootMode Một chế độ khởi động lại. |
Phương pháp 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 | 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) |
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ả các nhật ký executeShellCommand(String) . |
long | getExternalStoreFreeSpace () |
String | getFastbootPath () |
String | getFastbootProductType () |
String | getFastbootProductVariant () |
String | getFastbootVariable (String variableName) |
String | getFastbootVersion () |
IFileEntry | getFileEntry (String path) |
IFileEntry | getFileEntry (FileListingService.FileEntry entry) Người trợ giúp không chính thức để lấy FileEntry từ đường dẫn không phải root. |
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 () |
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, có thể hoặc không chuyển thiết bị này sang trạng thái cấp phát mớ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ố hành động cụ thể sau khi root adb và trước khi thiết bị trực tuyến trở lại. |
void | postAdbUnrootAction () Ghi đè nếu thiết bị cần thực hiện một số hành động cụ thể sau khi adb unroot và trước khi thiết bị trực tuyến trở lại. |
void | postBootSetup () |
void | postInvocationTearDown (Throwable exception) |
void | preInvocationSetup (IBuildInfo info) |
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) 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 giao tiếp của thiết bị. |
void | remountSystemWritable () |
void | remountVendorWritable () |
boolean | removeAdmin (String componentName, int userId) |
void | removeOwners () |
boolean | removeUser (int userId) |
boolean | runInstrumentationTests (IRemoteAndroidTestRunner runner, ITestLifeCycleReceiver... listeners) |
boolean | runInstrumentationTests (IRemoteAndroidTestRunner runner, listeners) runInstrumentationTests (IRemoteAndroidTestRunner runner, listeners) |
boolean | runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, ITestLifeCycleReceiver... listeners) |
boolean | runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, listeners) runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, listeners) |
void | setDate (Date date) |
boolean | setDeviceOwner (String componentName, int userId) |
void | setDeviceState (TestDeviceState deviceState) |
void | setEmulatorOutputStream ( SizeLimitedOutputStream output) Đối với trình giả lập, hãy đặt SizeLimitedOutputStream để ghi đầ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) |
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) |
Các phương pháp được bảo vệ |
---|
void | checkApiLevelAgainst (String feature, int strictMinLevel) |
NativeDevice.RebootDeviceAction | createRebootDeviceAction ( NativeDevice.RebootMode rebootMode, String reason) Tạo một RebootDeviceAction để sử dụng khi thực hiện một hành động khởi động lại. |
void | doAdbReboot ( NativeDevice.RebootMode rebootMode, String reason) Thực hiện khởi động lại adb. |
void | ensureRuntimePermissionSupported () phương thức trợ giúp để ném ngoại lệ nếu quyền thời gian chạy không được hỗ trợ |
InputStreamSource | getBugreportInternal () |
File | getBugreportzInternal () Phương pháp Trình trợ giúp nội bộ để lấy tệp zip bugreportz dưới dạng ERROR(/File) . |
IRunUtil | getRunUtil () Lấy phiên bản 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ộ đệm ẩn ddmlib theo mặc định và quay trở lại `adb shell getprop` hoặc` fastboot getvar` tùy thuộc vào việc thiết bị có trong Fastboot hay không. |
boolean | isNewer (File localFile, IFileEntry entry) Trả về true nếu tệp cục bộ 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 () Các hành động bổ sung có thể được 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 pháp này để thiết lập khởi động bài cụ thể. |
void | setClock (Clock clock) Đặt phiên bản Đồng hồ để sử dụng. |
void | setLogStartDelay (int delay) Đặt thời gian chờ tính bằng mili giây trước khi bắt đầu chụp logcat cho thiết bị trực tuyến. |
void | waitForDeviceNotAvailable (String operationDesc, long time) |
Hằng số
ID NGƯỜI DÙNG KHÔNG HỢP LỆ
public static final int INVALID_USER_ID
Giá trị được trả về cho bất kỳ id 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: -10000 (0xffffd8f0)
MAX_HOST_DEVICE_TIME_OFFSET
protected static final long MAX_HOST_DEVICE_TIME_OFFSET
Giá trị không đổi: 5000 (0x0000000000001388)
MAX_RETRY_ATTEMPTS
protected static final int MAX_RETRY_ATTEMPTS
số lần thử lại lệnh mặc định để thực hiện
Giá trị không đổi: 2 (0x00000002)
Lĩnh vực
THẺ SD
protected static final String SD_CARD
mOptions
protected TestDeviceOptions mOptions
mStateMonitor
protected final IDeviceStateMonitor mStateMonitor
Công cụ xây dựng
NativeDevice
public NativeDevice (IDevice device,
IDeviceStateMonitor stateMonitor,
IDeviceMonitor allocationMonitor)
Tạo một TestDevice
.
Thông số |
---|
device | IDevice : các liên IDevice |
stateMonitor | IDeviceStateMonitor : cơ chế IDeviceStateMonitor để sử dụng |
allocationMonitor | IDeviceMonitor : IDeviceMonitor để thông báo về các thay đổi trạng thái phân bổ. Có thể là rỗng |
Phương pháp công khai
checkApiLevelAgainstNextRelease
public boolean checkApiLevelAgainstNextRelease (int strictMinLevel)
Thông số |
---|
strictMinLevel | int |
Ném |
---|
DeviceNotAvailableException | |
checkConnectivity
public boolean checkConnectivity ()
Ném |
---|
DeviceNotAvailableException | |
clearErrorDialogs
public boolean clearErrorDialogs ()
Ném |
---|
DeviceNotAvailableException | |
clearLastConnectedWifiNetwork
public void clearLastConnectedWifiNetwork ()
clearLogcat
public void clearLogcat ()
connectToWifiNetwork
public boolean connectToWifiNetwork (String wifiSsid,
String wifiPsk)
Thông số |
---|
wifiSsid | String |
wifiPsk | String |
Ném |
---|
DeviceNotAvailableException | |
connectToWifiNetwork
public boolean connectToWifiNetwork (String wifiSsid,
String wifiPsk,
boolean scanSsid)
Thông số |
---|
wifiSsid | String |
wifiPsk | String |
scanSsid | boolean |
Ném |
---|
DeviceNotAvailableException | |
connectToWifiNetworkIfNeeded
public boolean connectToWifiNetworkIfNeeded (String wifiSsid,
String wifiPsk,
boolean scanSsid)
Thông số |
---|
wifiSsid | String |
wifiPsk | String |
scanSsid | boolean |
Ném |
---|
DeviceNotAvailableException | |
connectToWifiNetworkIfNeeded
public boolean connectToWifiNetworkIfNeeded (String wifiSsid,
String wifiPsk)
Thông số |
---|
wifiSsid | String |
wifiPsk | String |
Ném |
---|
DeviceNotAvailableException | |
tạo người dùng
public int createUser (String name,
boolean guest,
boolean ephemeral)
Thông số |
---|
name | String |
guest | boolean |
ephemeral | boolean |
Ném |
---|
DeviceNotAvailableException | |
tạo người dùng
public int createUser (String name)
Ném |
---|
DeviceNotAvailableException | |
createUserNoThrow
public int createUserNoThrow (String name)
Ném |
---|
DeviceNotAvailableException | |
xóa tài liệu
public void deleteFile (String deviceFilePath)
Thông số |
---|
deviceFilePath | String |
Ném |
---|
DeviceNotAvailableException | |
deviceSoftRestarted
public boolean deviceSoftRestarted (ProcessInfo prevSystemServerProcess)
Thông số |
---|
prevSystemServerProcess | ProcessInfo |
Ném |
---|
DeviceNotAvailableException | |
deviceSoftRestartedSince
public boolean deviceSoftRestartedSince (long utcEpochTime,
TimeUnit timeUnit)
Thông số |
---|
utcEpochTime | long |
timeUnit | TimeUnit |
Ném |
---|
DeviceNotAvailableException | |
disableAdbRoot
public boolean disableAdbRoot ()
Ném |
---|
DeviceNotAvailableException | |
disableKeyguard
public void disableKeyguard ()
Ném |
---|
DeviceNotAvailableException | |
disableNetworkMonitor
public boolean disableNetworkMonitor ()
Ném |
---|
DeviceNotAvailableException | |
ngắt kết nốiFromWifi
public boolean disconnectFromWifi ()
Ném |
---|
DeviceNotAvailableException | |
doesFileExist
public boolean doesFileExist (String deviceFilePath)
Thông số |
---|
deviceFilePath | String |
Ném |
---|
DeviceNotAvailableException | |
dumpHeap
public File dumpHeap (String process,
String devicePath)
Thông số |
---|
process | String |
devicePath | String |
Ném |
---|
DeviceNotAvailableException | |
enableAdbRoot
public boolean enableAdbRoot ()
Ném |
---|
DeviceNotAvailableException | |
enableNetworkMonitor
public boolean enableNetworkMonitor ()
Ném |
---|
DeviceNotAvailableException | |
Thiết bị mã hóa
public boolean encryptDevice (boolean inplace)
Ném |
---|
DeviceNotAvailableException | |
executeAdbCommand
public String executeAdbCommand (long timeout,
String... cmdArgs)
Thông số |
---|
timeout | long |
cmdArgs | String |
Ném |
---|
DeviceNotAvailableException | |
executeAdbCommand
public String executeAdbCommand (String... cmdArgs)
Ném |
---|
DeviceNotAvailableException | |
thi hànhFastbootCommand
public CommandResult executeFastbootCommand (String... cmdArgs)
Ném |
---|
DeviceNotAvailableException | |
thi hànhFastbootCommand
public CommandResult executeFastbootCommand (long timeout,
String... cmdArgs)
Thông số |
---|
timeout | long |
cmdArgs | String |
Ném |
---|
DeviceNotAvailableException | |
executeLongFastbootCommand
public CommandResult executeLongFastbootCommand (String... cmdArgs)
Ném |
---|
DeviceNotAvailableException | |
executeShellCommand
public String executeShellCommand (String command)
Ném |
---|
DeviceNotAvailableException | |
executeShellCommand
public void executeShellCommand (String command,
IShellOutputReceiver receiver,
long maxTimeToOutputShellResponse,
TimeUnit timeUnit,
int retryAttempts)
Thông số |
---|
command | String |
receiver | IShellOutputReceiver |
maxTimeToOutputShellResponse | long |
timeUnit | TimeUnit |
retryAttempts | int |
Ném |
---|
DeviceNotAvailableException | |
executeShellCommand
public void executeShellCommand (String command,
IShellOutputReceiver receiver,
long maxTimeoutForCommand,
long maxTimeToOutputShellResponse,
TimeUnit timeUnit,
int retryAttempts)
Thông số |
---|
command | String |
receiver | IShellOutputReceiver |
maxTimeoutForCommand | long |
maxTimeToOutputShellResponse | long |
timeUnit | TimeUnit |
retryAttempts | int |
Ném |
---|
DeviceNotAvailableException | |
executeShellCommand
public void executeShellCommand (String command,
IShellOutputReceiver receiver)
Thông số |
---|
command | String |
receiver | IShellOutputReceiver |
Ném |
---|
DeviceNotAvailableException | |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd)
Ném |
---|
DeviceNotAvailableException | |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd,
OutputStream pipeToOutput)
Thông số |
---|
cmd | String |
pipeToOutput | OutputStream |
Ném |
---|
DeviceNotAvailableException | |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd,
File pipeAsInput)
Thông số |
---|
cmd | String |
pipeAsInput | File |
Ném |
---|
DeviceNotAvailableException | |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd,
long maxTimeoutForCommand,
TimeUnit timeUnit,
int retryAttempts)
Thông số |
---|
cmd | String |
maxTimeoutForCommand | long |
timeUnit | TimeUnit |
retryAttempts | int |
Ném |
---|
DeviceNotAvailableException | |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd,
long maxTimeoutForCommand,
TimeUnit timeUnit)
Thông số |
---|
cmd | String |
maxTimeoutForCommand | long |
timeUnit | TimeUnit |
Ném |
---|
DeviceNotAvailableException | |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd,
File pipeAsInput,
OutputStream pipeToOutput,
long maxTimeoutForCommand,
TimeUnit timeUnit,
int retryAttempts)
Thông số |
---|
cmd | String |
pipeAsInput | File |
pipeToOutput | OutputStream |
maxTimeoutForCommand | long |
timeUnit | TimeUnit |
retryAttempts | int |
Ném |
---|
DeviceNotAvailableException | |
fastbootWipePartition
public CommandResult fastbootWipePartition (String partition)
Thông số |
---|
partition | String |
Ném |
---|
DeviceNotAvailableException | |
getActiveApexes
public getActiveApexes ()
Ném |
---|
DeviceNotAvailableException | |
getAllSettings
public getAllSettings (String namespace)
Thông số |
---|
namespace | String |
Ném |
---|
DeviceNotAvailableException | |
getAllocationState
public DeviceAllocationState getAllocationState ()
Lợi nhuận |
---|
DeviceAllocationState | |
getAndroidId
public String getAndroidId (int userId)
Ném |
---|
DeviceNotAvailableException | |
getAndroidIds
public getAndroidIds ()
Ném |
---|
DeviceNotAvailableException | |
getApiLevel
public int getApiLevel ()
Ném |
---|
DeviceNotAvailableException | |
getAppPackageInfo
public PackageInfo getAppPackageInfo (String packageName)
Thông số |
---|
packageName | String |
Ném |
---|
DeviceNotAvailableException | |
getAppPackageInfos
public getAppPackageInfos ()
Ném |
---|
DeviceNotAvailableException | |
getBasebandVersion
public String getBasebandVersion ()
Ném |
---|
DeviceNotAvailableException | |
getBattery
public Integer getBattery ()
getBooleanProperty
public boolean getBooleanProperty (String name,
boolean defaultValue)
Thông số |
---|
name | String |
defaultValue | boolean |
Ném |
---|
DeviceNotAvailableException | |
getBootHistory
public getBootHistory ()
Ném |
---|
DeviceNotAvailableException | |
getBootHistorySince
public getBootHistorySince (long utcEpochTime,
TimeUnit timeUnit)
Thông số |
---|
utcEpochTime | long |
timeUnit | TimeUnit |
Ném |
---|
DeviceNotAvailableException | |
getBootloaderVersion
public String getBootloaderVersion ()
Ném |
---|
DeviceNotAvailableException | |
getBugreport
public InputStreamSource getBugreport ()
Lợi nhuận |
---|
InputStreamSource | |
getBugreportz
public InputStreamSource getBugreportz ()
Lợi nhuận |
---|
InputStreamSource | |
getBuildAlias
public String getBuildAlias ()
Ném |
---|
DeviceNotAvailableException | |
getBuildFlavor
public String getBuildFlavor ()
Ném |
---|
DeviceNotAvailableException | |
getBuildId
public String getBuildId ()
Ném |
---|
DeviceNotAvailableException | |
getBuildSagingKeys
public String getBuildSigningKeys ()
Ném |
---|
DeviceNotAvailableException | |
getCachedDeviceDescriptor
public DeviceDescriptor getCachedDeviceDescriptor ()
Lợi nhuận |
---|
DeviceDescriptor | |
getChildren
public String[] getChildren (String path)
Ném |
---|
DeviceNotAvailableException | |
getCurrentUser
public int getCurrentUser ()
Ném |
---|
DeviceNotAvailableException | |
getDeviceClass
public String getDeviceClass ()
getDeviceDate
public long getDeviceDate ()
Ném |
---|
DeviceNotAvailableException | |
getDeviceDescriptor
public DeviceDescriptor getDeviceDescriptor ()
Lợi nhuận |
---|
DeviceDescriptor | |
getDeviceState
public TestDeviceState getDeviceState ()
Lợi nhuận |
---|
TestDeviceState | |
getDeviceTimeOffset
public long getDeviceTimeOffset (Date date)
Ném |
---|
DeviceNotAvailableException | |
getEmulatorOutput
public InputStreamSource getEmulatorOutput ()
Lợi nhuận |
---|
InputStreamSource | |
getEmulatorProcess
public Process getEmulatorProcess ()
getExternalStoreFreeSpace
public long getExternalStoreFreeSpace ()
Ném |
---|
DeviceNotAvailableException | |
getFastbootPath
public String getFastbootPath ()
getFastbootProductType
public String getFastbootProductType ()
Ném |
---|
DeviceNotAvailableException | |
getFastbootProductVariant
public String getFastbootProductVariant ()
Ném |
---|
DeviceNotAvailableException | |
getFastbootVariable
public String getFastbootVariable (String variableName)
Thông số |
---|
variableName | String |
Ném |
---|
DeviceNotAvailableException | |
getFastbootVersion
public String getFastbootVersion ()
getFileEntry
public IFileEntry getFileEntry (String path)
Ném |
---|
DeviceNotAvailableException | |
getFileEntry
public IFileEntry getFileEntry (FileListingService.FileEntry entry)
Người trợ giúp không chính thức để lấy FileEntry
từ đường dẫn không phải root. Khắc phục: Cấu trúc lại hệ thống FileEntry để có nó từ bất kỳ đường dẫn nào. (thậm chí không phải gốc).
Thông số |
---|
entry | FileListingService.FileEntry : một FileEntry không nhất thiết phải root như Ddmlib yêu cầu. |
Ném |
---|
DeviceNotAvailableException | |
getIDevice
public IDevice getIDevice ()
getInstalledPackageNames
public getInstalledPackageNames ()
Ném |
---|
DeviceNotAvailableException | |
getIntProperty
public long getIntProperty (String name,
long defaultValue)
Thông số |
---|
name | String |
defaultValue | long |
Ném |
---|
DeviceNotAvailableException | |
getIpAddress
public String getIpAddress ()
Ném |
---|
DeviceNotAvailableException | |
getKeyguardState
public KeyguardControllerState getKeyguardState ()
Lợi nhuận |
---|
KeyguardControllerState | |
Ném |
---|
DeviceNotAvailableException | |
getLastEosystemRebootTimeMillis
public long getLastExpectedRebootTimeMillis ()
getLaunchApiLevel
public int getLaunchApiLevel ()
Ném |
---|
DeviceNotAvailableException | |
getLogcat
public InputStreamSource getLogcat ()
Lợi nhuận |
---|
InputStreamSource | |
getLogcat
public InputStreamSource getLogcat (int maxBytes)
Lợi nhuận |
---|
InputStreamSource | |
getLogcatDump
public InputStreamSource getLogcatDump ()
Lợi nhuận |
---|
InputStreamSource | |
getLogcatSince
public InputStreamSource getLogcatSince (long date)
Lợi nhuận |
---|
InputStreamSource | |
getMacAddress
public String getMacAddress ()
public int getMaxNumberOfRunningUsersSupported ()
Ném |
---|
DeviceNotAvailableException | |
public int getMaxNumberOfUsersSupported ()
Ném |
---|
DeviceNotAvailableException | |
getMonitor
public IDeviceStateMonitor getMonitor ()
Lợi nhuận |
---|
IDeviceStateMonitor | |
getMountPoint
public String getMountPoint (String mountName)
Thông số |
---|
mountName | String |
getMountPointInfo
public ITestDevice.MountPointInfo getMountPointInfo (String mountpoint)
Thông số |
---|
mountpoint | String |
Lợi nhuận |
---|
ITestDevice.MountPointInfo | |
Ném |
---|
DeviceNotAvailableException | |
getMountPointInfo
public getMountPointInfo ()
Ném |
---|
DeviceNotAvailableException | |
getOptions
public TestDeviceOptions getOptions ()
Lợi nhuận |
---|
TestDeviceOptions | |
getPartitionFreeSpace
public long getPartitionFreeSpace (String partition)
Thông số |
---|
partition | String |
Ném |
---|
DeviceNotAvailableException | |
getPrimaryUserId
public Integer getPrimaryUserId ()
Ném |
---|
DeviceNotAvailableException | |
getProcessByName
public ProcessInfo getProcessByName (String processName)
Thông số |
---|
processName | String |
Ném |
---|
DeviceNotAvailableException | |
getProcessPid
public String getProcessPid (String process)
Ném |
---|
DeviceNotAvailableException | |
getProductType
public String getProductType ()
Ném |
---|
DeviceNotAvailableException | |
getProductVariant
public String getProductVariant ()
Ném |
---|
DeviceNotAvailableException | |
getProperty
public String getProperty (String name)
Ném |
---|
DeviceNotAvailableException | |
getRecoveryMode
public ITestDevice.RecoveryMode getRecoveryMode ()
Lợi nhuận |
---|
ITestDevice.RecoveryMode | |
getScreenshot
public InputStreamSource getScreenshot (String format)
Lợi nhuận |
---|
InputStreamSource | |
Ném |
---|
DeviceNotAvailableException | |
getScreenshot
public InputStreamSource getScreenshot (long displayId)
Lợi nhuận |
---|
InputStreamSource | |
Ném |
---|
DeviceNotAvailableException | |
getScreenshot
public InputStreamSource getScreenshot (String format,
boolean rescale)
Thông số |
---|
format | String |
rescale | boolean |
Lợi nhuận |
---|
InputStreamSource | |
Ném |
---|
DeviceNotAvailableException | |
getScreenshot
public InputStreamSource getScreenshot ()
Lợi nhuận |
---|
InputStreamSource | |
Ném |
---|
DeviceNotAvailableException | |
getSerialNumber
public String getSerialNumber ()
getSetting
public String getSetting (int userId,
String namespace,
String key)
Thông số |
---|
userId | int |
namespace | String |
key | String |
Ném |
---|
DeviceNotAvailableException | |
getSetting
public String getSetting (String namespace,
String key)
Thông số |
---|
namespace | String |
key | String |
Ném |
---|
DeviceNotAvailableException | |
getSimOperator
public String getSimOperator ()
getSimState
public String getSimState ()
getTombstones
public getTombstones ()
Ném |
---|
DeviceNotAvailableException | |
getTotalMemory
public long getTotalMemory ()
getUninstallablePackageNames
public getUninstallablePackageNames ()
Ném |
---|
DeviceNotAvailableException | |
getUseFastbootErase
public boolean getUseFastbootErase ()
getUserFlags
public int getUserFlags (int userId)
Ném |
---|
DeviceNotAvailableException | |
getUserInfos
public getUserInfos ()
Ném |
---|
DeviceNotAvailableException | |
getUserSerialNumber
public int getUserSerialNumber (int userId)
Ném |
---|
DeviceNotAvailableException | |
handleAllocationEvent
public IManagedTestDevice.DeviceEventResponse handleAllocationEvent (DeviceEvent event)
Xử lý DeviceEvent, có thể hoặc không chuyển thiết bị này sang trạng thái cấp phát mới.
Thông số |
---|
event | DeviceEvent |
Lợi nhuận |
---|
IManagedTestDevice.DeviceEventResponse | |
hasFeature
public boolean hasFeature (String feature)
Ném |
---|
DeviceNotAvailableException | |
cài đặt gói
public String installPackage (File packageFile,
boolean reinstall,
String... extraArgs)
Thông số |
---|
packageFile | File |
reinstall | boolean |
extraArgs | String |
Ném |
---|
DeviceNotAvailableException | |
cài đặt gói
public String installPackage (File packageFile,
boolean reinstall,
boolean grantPermissions,
String... extraArgs)
Thông số |
---|
packageFile | File |
reinstall | boolean |
grantPermissions | boolean |
extraArgs | String |
Ném |
---|
DeviceNotAvailableException | |
installPackageForUser
public String installPackageForUser (File packageFile,
boolean reinstall,
int userId,
String... extraArgs)
Thông số |
---|
packageFile | File |
reinstall | boolean |
userId | int |
extraArgs | String |
Ném |
---|
DeviceNotAvailableException | |
installPackageForUser
public String installPackageForUser (File packageFile,
boolean reinstall,
boolean grantPermissions,
int userId,
String... extraArgs)
Thông số |
---|
packageFile | File |
reinstall | boolean |
grantPermissions | boolean |
userId | int |
extraArgs | String |
Ném |
---|
DeviceNotAvailableException | |
isAdbRoot
public boolean isAdbRoot ()
Ném |
---|
DeviceNotAvailableException | |
isAdbTcp
public boolean isAdbTcp ()
isAppEnumerationSupported
public boolean isAppEnumerationSupported ()
Ném |
---|
DeviceNotAvailableException | |
isDeviceEncrypted
public boolean isDeviceEncrypted ()
Ném |
---|
DeviceNotAvailableException | |
isDirectory
public boolean isDirectory (String path)
Ném |
---|
DeviceNotAvailableException | |
isEnableAdbRoot
public boolean isEnableAdbRoot ()
Lợi nhuận |
---|
boolean | true nếu adb root nên được bật trên thiết bị |
isEncryptionSupported
public boolean isEncryptionSupported ()
Ném |
---|
DeviceNotAvailableException | |
isExecutable
public boolean isExecutable (String fullPath)
Ném |
---|
DeviceNotAvailableException | |
isFastbootEnabled
public boolean isFastbootEnabled ()
isHeadless
public boolean isHeadless ()
Ném |
---|
DeviceNotAvailableException | |
isMultiUserSupported
public boolean isMultiUserSupported ()
Ném |
---|
DeviceNotAvailableException | |
isPackageInstalled
public boolean isPackageInstalled (String packageName,
String userId)
Thông số |
---|
packageName | String |
userId | String |
Ném |
---|
DeviceNotAvailableException | |
isPackageInstalled
public boolean isPackageInstalled (String packageName)
Thông số |
---|
packageName | String |
Ném |
---|
DeviceNotAvailableException | |
isRuntimePermissionSupported
public boolean isRuntimePermissionSupported ()
Ném |
---|
DeviceNotAvailableException | |
isStateBootloaderOrFastbootd
public boolean isStateBootloaderOrFastbootd ()
isUserRunning
public boolean isUserRunning (int userId)
Ném |
---|
DeviceNotAvailableException | |
isUserSecondary
public boolean isUserSecondary (int userId)
Ném |
---|
DeviceNotAvailableException | |
isWifiEnabled
public boolean isWifiEnabled ()
Ném |
---|
DeviceNotAvailableException | |
listDisplayIds
public listDisplayIds ()
Ném |
---|
DeviceNotAvailableException | |
listUsers
public listUsers ()
Ném |
---|
DeviceNotAvailableException | |
logBugreport
public boolean logBugreport (String dataName,
ITestLogger listener)
Thông số |
---|
dataName | String |
listener | ITestLogger |
logOnDevice
public void logOnDevice (String tag,
Log.LogLevel level,
String format,
Object... args)
Thông số |
---|
tag | String |
level | Log.LogLevel |
format | String |
args | Object |
nonBlockingReboot
public void nonBlockingReboot ()
Ném |
---|
DeviceNotAvailableException | |
postAdbRootAction
public void postAdbRootAction ()
Ghi đè nếu thiết bị cần thực hiện một số hành động cụ thể sau khi root adb và trước khi thiết bị trực tuyến trở lại. Triển khai mặc định không bao gồm bất kỳ hành động bổ sung nào. adb root không được đảm bảo sẽ được bật ở giai đoạn này.
Ném |
---|
DeviceNotAvailableException | |
postAdbUnrootAction
public void postAdbUnrootAction ()
Ghi đè nếu thiết bị cần thực hiện một số hành động cụ thể sau khi adb unroot và trước khi thiết bị trực tuyến trở lại. Triển khai mặc định không bao gồm bất kỳ hành động bổ sung nào. adb root không được đảm bảo sẽ bị vô hiệu hóa ở giai đoạn này.
Ném |
---|
DeviceNotAvailableException | |
postBootSetup
public void postBootSetup ()
Ném |
---|
DeviceNotAvailableException | |
postInvocationTearDown
public void postInvocationTearDown (Throwable exception)
Thông số |
---|
exception | Throwable |
preInvocationSetup
public void preInvocationSetup (IBuildInfo info)
Ném |
---|
DeviceNotAvailableException | |
TargetSetupError | |
pullDir
public boolean pullDir (String deviceFilePath,
File localDir)
Thông số |
---|
deviceFilePath | String |
localDir | File |
Ném |
---|
DeviceNotAvailableException | |
pullFile
public boolean pullFile (String remoteFilePath,
File localFile)
Thông số |
---|
remoteFilePath | String |
localFile | File |
Ném |
---|
DeviceNotAvailableException | |
pullFile
public File pullFile (String remoteFilePath)
Thông số |
---|
remoteFilePath | String |
Ném |
---|
DeviceNotAvailableException | |
pullFileContents
public String pullFileContents (String remoteFilePath)
Thông số |
---|
remoteFilePath | String |
Ném |
---|
DeviceNotAvailableException | |
pullFileFromExternal
public File pullFileFromExternal (String remoteFilePath)
Thông số |
---|
remoteFilePath | String |
Ném |
---|
DeviceNotAvailableException | |
pushDir
public boolean pushDir (File localFileDir,
String deviceFilePath,
excludedDirectories)
Thông số |
---|
localFileDir | File |
deviceFilePath | String |
excludedDirectories | |
Ném |
---|
DeviceNotAvailableException | |
pushDir
public boolean pushDir (File localFileDir,
String deviceFilePath)
Thông số |
---|
localFileDir | File |
deviceFilePath | String |
Ném |
---|
DeviceNotAvailableException | |
pushFile
public boolean pushFile (File localFile,
String remoteFilePath)
Thông số |
---|
localFile | File |
remoteFilePath | String |
Ném |
---|
DeviceNotAvailableException | |
pushString
public boolean pushString (String contents,
String remoteFilePath)
Thông số |
---|
contents | String |
remoteFilePath | String |
Ném |
---|
DeviceNotAvailableException | |
khởi động lại
public void reboot (String reason)
Ném |
---|
DeviceNotAvailableException | |
khởi động lại
public void reboot ()
Ném |
---|
DeviceNotAvailableException | |
rebootIntoBootloader
public void rebootIntoBootloader ()
Ném |
---|
DeviceNotAvailableException | |
khởi động lạiIntoFastbootd
public void rebootIntoFastbootd ()
Ném |
---|
DeviceNotAvailableException | |
khởi động lạiIntoRecovery
public void rebootIntoRecovery ()
Ném |
---|
DeviceNotAvailableException | |
rebootIntoSideload
public void rebootIntoSideload ()
Ném |
---|
DeviceNotAvailableException | |
rebootIntoSideload
public void rebootIntoSideload (boolean autoReboot)
Thông số |
---|
autoReboot | boolean |
Ném |
---|
DeviceNotAvailableException | |
khởi động lạiUntilOnline
public void rebootUntilOnline ()
Ném |
---|
DeviceNotAvailableException | |
khởi động lạiUntilOnline
public void rebootUntilOnline (String reason)
Ném |
---|
DeviceNotAvailableException | |
rebootUserspace
public void rebootUserspace ()
Ném |
---|
DeviceNotAvailableException | |
khởi động lạiUserspaceUntilOnline
public void rebootUserspaceUntilOnline ()
Ném |
---|
DeviceNotAvailableException | |
recoveryDevice
public void recoverDevice ()
Cố gắng khôi phục giao tiếp của thiết bị.
Ném |
---|
DeviceNotAvailableException | nếu thiết bị không còn nữa |
remountSystemW ghi
public void remountSystemWritable ()
Ném |
---|
DeviceNotAvailableException | |
remountVendorWlike
public void remountVendorWritable ()
Ném |
---|
DeviceNotAvailableException | |
removeAdmin
public boolean removeAdmin (String componentName,
int userId)
Thông số |
---|
componentName | String |
userId | int |
Ném |
---|
DeviceNotAvailableException | |
removeOwners
public void removeOwners ()
Ném |
---|
DeviceNotAvailableException | |
removeUser
public boolean removeUser (int userId)
Ném |
---|
DeviceNotAvailableException | |
runIricalmentationTests
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner,
ITestLifeCycleReceiver... listeners)
Thông số |
---|
runner | IRemoteAndroidTestRunner |
listeners | ITestLifeCycleReceiver |
Ném |
---|
DeviceNotAvailableException | |
runIricalmentationTests
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner,
listeners)
Thông số |
---|
runner | IRemoteAndroidTestRunner |
listeners | |
Ném |
---|
DeviceNotAvailableException | |
runIricalmentationTestsAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner,
int userId,
ITestLifeCycleReceiver... listeners)
Thông số |
---|
runner | IRemoteAndroidTestRunner |
userId | int |
listeners | ITestLifeCycleReceiver |
Ném |
---|
DeviceNotAvailableException | |
runIricalmentationTestsAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner,
int userId,
listeners)
Thông số |
---|
runner | IRemoteAndroidTestRunner |
userId | int |
listeners | |
Ném |
---|
DeviceNotAvailableException | |
đặt ngày
public void setDate (Date date)
Ném |
---|
DeviceNotAvailableException | |
setDeviceOwner
public boolean setDeviceOwner (String componentName,
int userId)
Thông số |
---|
componentName | String |
userId | int |
Ném |
---|
DeviceNotAvailableException | |
setDeviceState
public void setDeviceState (TestDeviceState deviceState)
Thông số |
---|
deviceState | TestDeviceState |
setEmulatorProcess
public void setEmulatorProcess (Process p)
setFastbootEnabled
public void setFastbootEnabled (boolean fastbootEnabled)
Thông số |
---|
fastbootEnabled | boolean |
setFastbootPath
public void setFastbootPath (String fastbootPath)
Thông số |
---|
fastbootPath | String |
setIDevice
public void setIDevice (IDevice newDevice)
Thông số |
---|
newDevice | IDevice |
setOptions
public void setOptions (TestDeviceOptions options)
Thông số |
---|
options | TestDeviceOptions |
setProperty
public boolean setProperty (String propKey,
String propValue)
Thông số |
---|
propKey | String |
propValue | String |
Ném |
---|
DeviceNotAvailableException | |
setRecovery
public void setRecovery (IDeviceRecovery recovery)
Thông số |
---|
recovery | IDeviceRecovery |
setRecoveryMode
public void setRecoveryMode (ITestDevice.RecoveryMode mode)
Thông số |
---|
mode | ITestDevice.RecoveryMode |
setSetting
public void setSetting (String namespace,
String key,
String value)
Thông số |
---|
namespace | String |
key | String |
value | String |
Ném |
---|
DeviceNotAvailableException | |
setSetting
public void setSetting (int userId,
String namespace,
String key,
String value)
Thông số |
---|
userId | int |
namespace | String |
key | String |
value | String |
Ném |
---|
DeviceNotAvailableException | |
setUseFastbootErase
public void setUseFastbootErase (boolean useFastbootErase)
Thông số |
---|
useFastbootErase | boolean |
startLogcat
public void startLogcat ()
startUser
public boolean startUser (int userId)
Ném |
---|
DeviceNotAvailableException | |
startUser
public boolean startUser (int userId,
boolean waitFlag)
Thông số |
---|
userId | int |
waitFlag | boolean |
Ném |
---|
DeviceNotAvailableException | |
stopEmulatorOutput
public void stopEmulatorOutput ()
stopLogcat
public void stopLogcat ()
stopUser
public boolean stopUser (int userId)
Ném |
---|
DeviceNotAvailableException | |
stopUser
public boolean stopUser (int userId,
boolean waitFlag,
boolean forceFlag)
Thông số |
---|
userId | int |
waitFlag | boolean |
forceFlag | boolean |
Ném |
---|
DeviceNotAvailableException | |
switchToAdbTcp
public String switchToAdbTcp ()
Ném |
---|
DeviceNotAvailableException | |
switchToAdbUsb
public boolean switchToAdbUsb ()
Ném |
---|
DeviceNotAvailableException | |
switchUser
public boolean switchUser (int userId)
Ném |
---|
DeviceNotAvailableException | |
switchUser
public boolean switchUser (int userId,
long timeout)
Thông số |
---|
userId | int |
timeout | long |
Ném |
---|
DeviceNotAvailableException | |
syncFiles
public boolean syncFiles (File localFileDir,
String deviceFilePath)
Thông số |
---|
localFileDir | File |
deviceFilePath | String |
Ném |
---|
DeviceNotAvailableException | |
takeBugreport
public Bugreport takeBugreport ()
unncryptDevice
public boolean unencryptDevice ()
Ném |
---|
DeviceNotAvailableException | |
gỡ cài đặt
public String uninstallPackage (String packageName)
Thông số |
---|
packageName | String |
Ném |
---|
DeviceNotAvailableException | |
mở khóa máy
public boolean unlockDevice ()
Ném |
---|
DeviceNotAvailableException | |
waitForBootComplete
public boolean waitForBootComplete (long timeOut)
Ném |
---|
DeviceNotAvailableException | |
waitForDeviceAvailable
public void waitForDeviceAvailable ()
Ném |
---|
DeviceNotAvailableException | |
waitForDeviceAvailable
public void waitForDeviceAvailable (long waitTime)
Ném |
---|
DeviceNotAvailableException | |
waitForDeviceInRecovery
public boolean waitForDeviceInRecovery (long waitTime)
waitForDeviceInSideload
public boolean waitForDeviceInSideload (long waitTime)
waitForDeviceNotAvailable
public boolean waitForDeviceNotAvailable (long waitTime)
waitForDeviceOnline
public void waitForDeviceOnline ()
Ném |
---|
DeviceNotAvailableException | |
waitForDeviceOnline
public void waitForDeviceOnline (long waitTime)
Ném |
---|
DeviceNotAvailableException | |
waitForDeviceShell
public boolean waitForDeviceShell (long waitTime)
Các phương pháp được bảo vệ
checkApiLevelAgainst
protected void checkApiLevelAgainst (String feature,
int strictMinLevel)
Thông số |
---|
feature | String |
strictMinLevel | int |
doAdbReboot
protected void doAdbReboot (NativeDevice.RebootMode rebootMode,
String reason)
Thực hiện khởi động lại adb.
Thông số |
---|
rebootMode | NativeDevice.RebootMode : một chế độ khởi động lại này. |
reason | String : cho lần khởi động lại này. |
Ném |
---|
DeviceNotAvailableException | |
ensureRuntimePermissionSupported
protected void ensureRuntimePermissionSupported ()
phương thức trợ giúp để ném ngoại lệ nếu quyền thời gian chạy không được hỗ trợ
Ném |
---|
DeviceNotAvailableException | |
getBugreportInternal
protected InputStreamSource getBugreportInternal ()
Lợi nhuận |
---|
InputStreamSource | |
getBugreportzInternal
protected File getBugreportzInternal ()
Phương pháp Trình trợ giúp nội bộ để lấy tệp zip bugreportz dưới dạng ERROR(/File)
.
getRunUtil
protected IRunUtil getRunUtil ()
Lấy phiên bản RunUtil
để sử dụng.
InternalGetProperty
protected String internalGetProperty (String propName,
String fastbootVar,
String description)
Tìm nạp thuộc tính thiết bị, từ bộ nhớ cache ddmlib theo mặc định và quay trở lại `adb shell getprop` hoặc` fastboot getvar` tùy thuộc vào việc thiết bị có ở trong Fastboot hay không.
Thông số |
---|
propName | String : Tên của thuộc tính thiết bị được trả về bởi `adb shell getprop` |
fastbootVar | String : Tên của biến fastboot tương đương để truy vấn. nếu null , truy vấn fastboot sẽ không được thử |
description | String : Mô tả đơn giản về biến. Chữ cái đầu tiên nên được viết hoa. |
Lợi nhuận |
---|
String | Một chuỗi, có thể là null hoặc rỗng, chứa giá trị của thuộc tính đã cho |
Ném |
---|
DeviceNotAvailableException | |
isNewer
protected boolean isNewer (File localFile,
IFileEntry entry)
Trả về true
nếu tệp cục bộ mới hơn tệp từ xa. IFileEntry
chính xác đến từng phút, trong trường hợp thời gian bằng nhau, tệp sẽ được coi là mới hơn.
Thông số |
---|
localFile | File |
entry | IFileEntry |
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à tùy chọn thử lại lệnh nếu hành động không thành công.
Thông số |
---|
actionDescription | String : mô tả ngắn gọn về hành động sẽ được thực hiện. Chỉ được sử dụng cho mục đích ghi nhật ký. |
action | com.android.tradefed.device.NativeDevice.DeviceAction : hành động được thực hiện |
retryAttempts | int : thử lại cố gắng thực hiện hành động nếu nó không thành công nhưng khôi phục thành công |
Lợi nhuận |
---|
boolean | true nếu hành động được thực hiện thành công |
Ném |
---|
DeviceNotAvailableException | nếu nỗ lực khôi phục không thành công hoặc các nỗ lực tối đa được thực hiện mà không thành công |
postAdbReboot
protected void postAdbReboot ()
Các hành động bổ sung có thể được thực hiện sau khi khởi động lại.
Ném |
---|
DeviceNotAvailableException | |
prePostBootSetup
protected void prePostBootSetup ()
Cho phép từng loại thiết bị (AndroidNativeDevice, TestDevice) ghi đè phương pháp này để thiết lập khởi động bài cụ thể.
Ném |
---|
DeviceNotAvailableException | |
bộ đồng hồ
protected void setClock (Clock clock)
Đặt phiên bản Đồng hồ để sử dụng.
setLogStartDelay
protected void setLogStartDelay (int delay)
Đặt thời gian chờ tính bằng mili giây trước khi bắt đầu chụp logcat cho thiết bị trực tuyến.
Thông số |
---|
delay | int : độ trễ tính bằng mili giây |
waitForDeviceNotAvailable
protected void waitForDeviceNotAvailable (String operationDesc,
long time)
Thông số |
---|
operationDesc | String |
time | long |
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-09-08 UTC.