Вложенные классы |
---|
class | NativeDevice.AdbAction DeviceAction для запуска команды ОС «adb ....». |
class | NativeDevice.AdbShellAction |
class | NativeDevice.RebootDeviceAction DeviceAction для перезагрузки устройства. |
enum | NativeDevice.RebootMode Режим перезагрузки. |
Публичные методы |
---|
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 () Журнал, содержащий все журналы 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) Неофициальный помощник для получения FileEntry по некорневому пути. |
| 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) Обработайте DeviceEvent, который может перевести или не перевести это устройство в новое состояние распределения. |
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 () Переопределить, если устройству необходимо выполнить какие-то определенные действия после получения root-доступа adb и до того, как устройство снова подключится к сети. |
void | postAdbUnrootAction () Переопределить, если устройству необходимо выполнить какие-то определенные действия после отключения adb и до того, как устройство снова подключится к сети. |
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) 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 () Попытки восстановить связь с устройством. |
void | remountSystemWritable () |
void | remountVendorWritable () |
boolean | removeAdmin (String componentName, int userId) |
void | removeOwners () |
boolean | removeUser (int userId) |
void | resetContentProviderSetup () Сбросьте флаг настройки поставщика контента, чтобы активировать его снова. |
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 | setConfiguration ( IConfiguration configuration) Внедряет используемый IConfiguration . |
void | setDate (Date date) |
boolean | setDeviceOwner (String componentName, int userId) |
void | setDeviceState (TestDeviceState deviceState) |
void | setEmulatorOutputStream ( SizeLimitedOutputStream output) Для эмулятора установите SizeLimitedOutputStream для регистрации вывода |
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) |
Защищенные методы |
---|
void | checkApiLevelAgainst (String feature, int strictMinLevel) |
NativeDevice.RebootDeviceAction | createRebootDeviceAction ( NativeDevice.RebootMode rebootMode, String reason) Создайте RebootDeviceAction , который будет использоваться при выполнении действия перезагрузки. |
void | doAdbReboot ( NativeDevice.RebootMode rebootMode, String reason) Выполните перезагрузку adb. |
void | ensureRuntimePermissionSupported () вспомогательный метод для создания исключения, если разрешение времени выполнения не поддерживается |
InputStreamSource | getBugreportInternal () |
File | getBugreportzInternal () Внутренний вспомогательный метод для получения zip-файла bugreportz как ERROR(/File) . |
IRunUtil | getRunUtil () Получите экземпляр RunUtil для использования. |
String | internalGetProperty (String propName, String fastbootVar, String description) Получите свойство устройства из кэша ddmlib по умолчанию и вернитесь к `adb Shell getprop` или `fastboot getvar` в зависимости от того, находится ли устройство в режиме Fastboot или нет. |
boolean | isNewer (File localFile, IFileEntry entry) Возвращайте true если локальный файл новее удаленного файла. |
boolean | performDeviceAction (String actionDescription, com.android.tradefed.device.NativeDevice.DeviceAction action, int retryAttempts) Выполняет действие на этом устройстве. |
void | postAdbReboot () Возможные дополнительные действия, которые можно предпринять после перезагрузки. |
void | prePostBootSetup () Позволяет каждому типу устройства (AndroidNativeDevice, TestDevice) переопределить этот метод для конкретной настройки после загрузки. |
void | setClock (Clock clock) Установите экземпляр Clock для использования. |
void | setLogStartDelay (int delay) Устанавливает время ожидания в мс перед началом захвата logcat для подключенного к сети устройства. |
void | waitForDeviceNotAvailable (String operationDesc, long time) |
Константы
INVALID_USER_ID
public static final int INVALID_USER_ID
Значение, возвращаемое для любого недействительного/не найденного идентификатора пользователя: UserHandle определил значение -10000.
Постоянное значение: -10000 (0xffffd8f0)
MAX_HOST_DEVICE_TIME_OFFSET
protected static final long MAX_HOST_DEVICE_TIME_OFFSET
Постоянное значение: 5000 (0x0000000000001388)
MAX_RETRY_ATTEMPTS
protected static final int MAX_RETRY_ATTEMPTS
количество попыток повтора команды по умолчанию
Постоянное значение: 2 (0x00000002)
Поля
SD CARD
protected static final String SD_CARD
STORAGE_EMULATED
protected static final String STORAGE_EMULATED
mОпции
protected TestDeviceOptions mOptions
mStateMonitor
protected final IDeviceStateMonitor mStateMonitor
Общественные конструкторы
РодноеУстройство
public NativeDevice (IDevice device,
IDeviceStateMonitor stateMonitor,
IDeviceMonitor allocationMonitor)
Создает TestDevice
.
Параметры |
---|
device | IDevice : связанный IDevice |
stateMonitor | IDeviceStateMonitor : используемый механизм IDeviceStateMonitor . |
allocationMonitor | IDeviceMonitor : IDeviceMonitor для информирования об изменениях состояния распределения. Может быть нулевым |
Публичные методы
проверкаApiLevelAgainstNextRelease
public boolean checkApiLevelAgainstNextRelease (int strictMinLevel)
Параметры |
---|
strictMinLevel | int |
Броски |
---|
DeviceNotAvailableException | |
checkConnectivity
public boolean checkConnectivity ()
Броски |
---|
DeviceNotAvailableException | |
ClearErrorDialogs
public boolean clearErrorDialogs ()
Броски |
---|
DeviceNotAvailableException | |
ClearLastConnectedWiFiNetwork
public void clearLastConnectedWifiNetwork ()
очиститьLogcat
public void clearLogcat ()
ConnectToWiFiNetwork
public boolean connectToWifiNetwork (String wifiSsid,
String wifiPsk)
Параметры |
---|
wifiSsid | String |
wifiPsk | String |
Броски |
---|
DeviceNotAvailableException | |
ConnectToWiFiNetwork
public boolean connectToWifiNetwork (String wifiSsid,
String wifiPsk,
boolean scanSsid)
Параметры |
---|
wifiSsid | String |
wifiPsk | String |
scanSsid | boolean |
Броски |
---|
DeviceNotAvailableException | |
ConnectToWifiNetworkIfNeeded
public boolean connectToWifiNetworkIfNeeded (String wifiSsid,
String wifiPsk,
boolean scanSsid)
Параметры |
---|
wifiSsid | String |
wifiPsk | String |
scanSsid | boolean |
Броски |
---|
DeviceNotAvailableException | |
ConnectToWifiNetworkIfNeeded
public boolean connectToWifiNetworkIfNeeded (String wifiSsid,
String wifiPsk)
Параметры |
---|
wifiSsid | String |
wifiPsk | String |
Броски |
---|
DeviceNotAvailableException | |
Создать пользователя
public int createUser (String name,
boolean guest,
boolean ephemeral)
Параметры |
---|
name | String |
guest | boolean |
ephemeral | boolean |
Броски |
---|
DeviceNotAvailableException | |
Создать пользователя
public int createUser (String name)
Броски |
---|
DeviceNotAvailableException | |
createUserNoThrow
public int createUserNoThrow (String name)
Броски |
---|
DeviceNotAvailableException | |
удалить файл
public void deleteFile (String deviceFilePath)
Параметры |
---|
deviceFilePath | String |
Броски |
---|
DeviceNotAvailableException | |
устройствоSoftRestarted
public boolean deviceSoftRestarted (ProcessInfo prevSystemServerProcess)
Параметры |
---|
prevSystemServerProcess | ProcessInfo |
Броски |
---|
DeviceNotAvailableException | |
устройствоSoftRestartedSince
public boolean deviceSoftRestartedSince (long utcEpochTime,
TimeUnit timeUnit)
Параметры |
---|
utcEpochTime | long |
timeUnit | TimeUnit |
Броски |
---|
DeviceNotAvailableException | |
отключитьAdbRoot
public boolean disableAdbRoot ()
Броски |
---|
DeviceNotAvailableException | |
отключитьKeyguard
public void disableKeyguard ()
Броски |
---|
DeviceNotAvailableException | |
отключитьNetworkMonitor
public boolean disableNetworkMonitor ()
Броски |
---|
DeviceNotAvailableException | |
отключить от Wi-Fi
public boolean disconnectFromWifi ()
Броски |
---|
DeviceNotAvailableException | |
делаетFileExist
public boolean doesFileExist (String deviceFilePath)
Параметры |
---|
deviceFilePath | String |
Броски |
---|
DeviceNotAvailableException | |
дампКуча
public File dumpHeap (String process,
String devicePath)
Параметры |
---|
process | String |
devicePath | String |
Броски |
---|
DeviceNotAvailableException | |
включитьAdbRoot
public boolean enableAdbRoot ()
Броски |
---|
DeviceNotAvailableException | |
включитьNetworkMonitor
public boolean enableNetworkMonitor ()
Броски |
---|
DeviceNotAvailableException | |
шифроватьустройство
public boolean encryptDevice (boolean inplace)
Параметры |
---|
inplace | boolean |
Броски |
---|
DeviceNotAvailableException | |
выполнитьAdbCommand
public String executeAdbCommand (long timeout,
String... cmdArgs)
Параметры |
---|
timeout | long |
cmdArgs | String |
Броски |
---|
DeviceNotAvailableException | |
выполнитьAdbCommand
public String executeAdbCommand (String... cmdArgs)
Броски |
---|
DeviceNotAvailableException | |
выполнитьFastbootCommand
public CommandResult executeFastbootCommand (String... cmdArgs)
Броски |
---|
DeviceNotAvailableException | |
выполнитьFastbootCommand
public CommandResult executeFastbootCommand (long timeout,
String... cmdArgs)
Параметры |
---|
timeout | long |
cmdArgs | String |
Броски |
---|
DeviceNotAvailableException | |
выполнитьLongFastbootCommand
public CommandResult executeLongFastbootCommand (String... cmdArgs)
Броски |
---|
DeviceNotAvailableException | |
выполнитьShellCommand
public String executeShellCommand (String command)
Броски |
---|
DeviceNotAvailableException | |
выполнитьShellCommand
public void executeShellCommand (String command,
IShellOutputReceiver receiver,
long maxTimeToOutputShellResponse,
TimeUnit timeUnit,
int retryAttempts)
Параметры |
---|
command | String |
receiver | IShellOutputReceiver |
maxTimeToOutputShellResponse | long |
timeUnit | TimeUnit |
retryAttempts | int |
Броски |
---|
DeviceNotAvailableException | |
выполнитьShellCommand
public void executeShellCommand (String command,
IShellOutputReceiver receiver,
long maxTimeoutForCommand,
long maxTimeToOutputShellResponse,
TimeUnit timeUnit,
int retryAttempts)
Параметры |
---|
command | String |
receiver | IShellOutputReceiver |
maxTimeoutForCommand | long |
maxTimeToOutputShellResponse | long |
timeUnit | TimeUnit |
retryAttempts | int |
Броски |
---|
DeviceNotAvailableException | |
выполнитьShellCommand
public void executeShellCommand (String command,
IShellOutputReceiver receiver)
Параметры |
---|
command | String |
receiver | IShellOutputReceiver |
Броски |
---|
DeviceNotAvailableException | |
выполнитьShellV2Command
public CommandResult executeShellV2Command (String cmd)
Броски |
---|
DeviceNotAvailableException | |
выполнитьShellV2Command
public CommandResult executeShellV2Command (String cmd,
OutputStream pipeToOutput)
Параметры |
---|
cmd | String |
pipeToOutput | OutputStream |
Броски |
---|
DeviceNotAvailableException | |
выполнитьShellV2Command
public CommandResult executeShellV2Command (String cmd,
File pipeAsInput)
Параметры |
---|
cmd | String |
pipeAsInput | File |
Броски |
---|
DeviceNotAvailableException | |
выполнитьShellV2Command
public CommandResult executeShellV2Command (String cmd,
long maxTimeoutForCommand,
TimeUnit timeUnit,
int retryAttempts)
Параметры |
---|
cmd | String |
maxTimeoutForCommand | long |
timeUnit | TimeUnit |
retryAttempts | int |
Броски |
---|
DeviceNotAvailableException | |
выполнитьShellV2Command
public CommandResult executeShellV2Command (String cmd,
long maxTimeoutForCommand,
TimeUnit timeUnit)
Параметры |
---|
cmd | String |
maxTimeoutForCommand | long |
timeUnit | TimeUnit |
Броски |
---|
DeviceNotAvailableException | |
выполнитьShellV2Command
public CommandResult executeShellV2Command (String cmd,
File pipeAsInput,
OutputStream pipeToOutput,
long maxTimeoutForCommand,
TimeUnit timeUnit,
int retryAttempts)
Параметры |
---|
cmd | String |
pipeAsInput | File |
pipeToOutput | OutputStream |
maxTimeoutForCommand | long |
timeUnit | TimeUnit |
retryAttempts | int |
Броски |
---|
DeviceNotAvailableException | |
выполнитьShellV2Command
public CommandResult executeShellV2Command (String cmd,
File pipeAsInput,
OutputStream pipeToOutput,
OutputStream pipeToError,
long maxTimeoutForCommand,
TimeUnit timeUnit,
int retryAttempts)
Параметры |
---|
cmd | String |
pipeAsInput | File |
pipeToOutput | OutputStream |
pipeToError | OutputStream |
maxTimeoutForCommand | long |
timeUnit | TimeUnit |
retryAttempts | int |
Броски |
---|
DeviceNotAvailableException | |
fastbootWipePartition
public CommandResult fastbootWipePartition (String partition)
Параметры |
---|
partition | String |
Броски |
---|
DeviceNotAvailableException | |
getActiveApexes
public getActiveApexes ()
Броски |
---|
DeviceNotAvailableException | |
получить все настройки
public getAllSettings (String namespace)
Параметры |
---|
namespace | String |
Броски |
---|
DeviceNotAvailableException | |
getAllocationState
public DeviceAllocationState getAllocationState ()
Возврат |
---|
DeviceAllocationState | |
получитьAndroidId
public String getAndroidId (int userId)
Броски |
---|
DeviceNotAvailableException | |
получитьAndroidIds
public getAndroidIds ()
Броски |
---|
DeviceNotAvailableException | |
getApiLevel
public int getApiLevel ()
Броски |
---|
DeviceNotAvailableException | |
getAppPackageInfo
public PackageInfo getAppPackageInfo (String packageName)
Параметры |
---|
packageName | String |
Броски |
---|
DeviceNotAvailableException | |
getAppPackageInfos
public getAppPackageInfos ()
Броски |
---|
DeviceNotAvailableException | |
getBasebandVersion
public String getBasebandVersion ()
Броски |
---|
DeviceNotAvailableException | |
getBattery
public Integer getBattery ()
getBooleanProperty
public boolean getBooleanProperty (String name,
boolean defaultValue)
Параметры |
---|
name | String |
defaultValue | boolean |
Броски |
---|
DeviceNotAvailableException | |
getBootHistory
public getBootHistory ()
Броски |
---|
DeviceNotAvailableException | |
getBootHistorySince
public getBootHistorySince (long utcEpochTime,
TimeUnit timeUnit)
Параметры |
---|
utcEpochTime | long |
timeUnit | TimeUnit |
Броски |
---|
DeviceNotAvailableException | |
getBootloaderVersion
public String getBootloaderVersion ()
Броски |
---|
DeviceNotAvailableException | |
getBugreport
public InputStreamSource getBugreport ()
Возврат |
---|
InputStreamSource | |
getBugreportz
public InputStreamSource getBugreportz ()
Возврат |
---|
InputStreamSource | |
getBuildAlias
public String getBuildAlias ()
Броски |
---|
DeviceNotAvailableException | |
getBuildFlavor
public String getBuildFlavor ()
Броски |
---|
DeviceNotAvailableException | |
getBuildId
public String getBuildId ()
Броски |
---|
DeviceNotAvailableException | |
getBuildSigningKeys
public String getBuildSigningKeys ()
Броски |
---|
DeviceNotAvailableException | |
getCachedDeviceDescriptor
public DeviceDescriptor getCachedDeviceDescriptor ()
getChildren
public String[] getChildren (String path)
Броски |
---|
DeviceNotAvailableException | |
getCurrentFoldableState
public DeviceFoldableState getCurrentFoldableState ()
Возврат |
---|
DeviceFoldableState | |
Броски |
---|
DeviceNotAvailableException | |
getCurrentUser
public int getCurrentUser ()
Броски |
---|
DeviceNotAvailableException | |
GetDeviceClass
public String getDeviceClass ()
getDeviceDate
public long getDeviceDate ()
Броски |
---|
DeviceNotAvailableException | |
getDeviceDescriptor
public DeviceDescriptor getDeviceDescriptor ()
getDeviceState
public TestDeviceState getDeviceState ()
getDeviceTimeOffset
public long getDeviceTimeOffset (Date date)
Броски |
---|
DeviceNotAvailableException | |
getEmulatorOutput
public InputStreamSource getEmulatorOutput ()
Возврат |
---|
InputStreamSource | |
GetEmulatorProcess
public Process getEmulatorProcess ()
getExternalStoreFreeSpace
public long getExternalStoreFreeSpace ()
Броски |
---|
DeviceNotAvailableException | |
получитьFastbootPath
public String getFastbootPath ()
getFastbootProductType
public String getFastbootProductType ()
Броски |
---|
DeviceNotAvailableException | |
получитьFastbootProductVariant
public String getFastbootProductVariant ()
Броски |
---|
DeviceNotAvailableException | |
ПолучитьFastbootSerialNumber
public String getFastbootSerialNumber ()
получитьFastbootVariable
public String getFastbootVariable (String variableName)
Параметры |
---|
variableName | String |
Броски |
---|
DeviceNotAvailableException | |
получитьFastbootVersion
public String getFastbootVersion ()
getFileEntry
public IFileEntry getFileEntry (String path)
Броски |
---|
DeviceNotAvailableException | |
getFileEntry
public IFileEntry getFileEntry (FileListingService.FileEntry entry)
Неофициальный помощник для получения FileEntry
по некорневому пути. ИСПРАВЛЕНИЕ: Реорганизуйте систему FileEntry, чтобы она была доступна по любому пути. (даже без root).
Параметры |
---|
entry | FileListingService.FileEntry : FileEntry не обязательно является корневым, как того требует Ddmlib. |
Броски |
---|
DeviceNotAvailableException | |
getFoldableStates
public getFoldableStates ()
Броски |
---|
DeviceNotAvailableException | |
getIDevice
public IDevice getIDevice ()
getInstalledPackageNames
public getInstalledPackageNames ()
Броски |
---|
DeviceNotAvailableException | |
getIntProperty
public long getIntProperty (String name,
long defaultValue)
Параметры |
---|
name | String |
defaultValue | long |
Броски |
---|
DeviceNotAvailableException | |
получитьIpAddress
public String getIpAddress ()
Броски |
---|
DeviceNotAvailableException | |
getKeyguardState
public KeyguardControllerState getKeyguardState ()
Возврат |
---|
KeyguardControllerState | |
Броски |
---|
DeviceNotAvailableException | |
getLastExpectedRebootTimeMillis
public long getLastExpectedRebootTimeMillis ()
getLaunchApiLevel
public int getLaunchApiLevel ()
Броски |
---|
DeviceNotAvailableException | |
getLogcat
public InputStreamSource getLogcat ()
Возврат |
---|
InputStreamSource | |
getLogcat
public InputStreamSource getLogcat (int maxBytes)
Возврат |
---|
InputStreamSource | |
getLogcatDump
public InputStreamSource getLogcatDump ()
Возврат |
---|
InputStreamSource | |
getLogcatSince
public InputStreamSource getLogcatSince (long date)
Возврат |
---|
InputStreamSource | |
получитьMacAddress
public String getMacAddress ()
getMainlineModuleInfo
public getMainlineModuleInfo ()
Броски |
---|
DeviceNotAvailableException | |
public int getMaxNumberOfRunningUsersSupported ()
Броски |
---|
DeviceNotAvailableException | |
public int getMaxNumberOfUsersSupported ()
Броски |
---|
DeviceNotAvailableException | |
getMonitor
public IDeviceStateMonitor getMonitor ()
Возврат |
---|
IDeviceStateMonitor | |
getMountPoint
public String getMountPoint (String mountName)
Параметры |
---|
mountName | String |
getMountPointInfo
public ITestDevice.MountPointInfo getMountPointInfo (String mountpoint)
Параметры |
---|
mountpoint | String |
Возврат |
---|
ITestDevice.MountPointInfo | |
Броски |
---|
DeviceNotAvailableException | |
getMountPointInfo
public getMountPointInfo ()
Броски |
---|
DeviceNotAvailableException | |
getOptions
public TestDeviceOptions getOptions ()
Возврат |
---|
TestDeviceOptions | |
getPartitionFreeSpace
public long getPartitionFreeSpace (String partition)
Параметры |
---|
partition | String |
Броски |
---|
DeviceNotAvailableException | |
получитьPrimaryUserId
public Integer getPrimaryUserId ()
Броски |
---|
DeviceNotAvailableException | |
getProcessByName
public ProcessInfo getProcessByName (String processName)
Параметры |
---|
processName | String |
Броски |
---|
DeviceNotAvailableException | |
getProcessPid
public String getProcessPid (String process)
Броски |
---|
DeviceNotAvailableException | |
getProductType
public String getProductType ()
Броски |
---|
DeviceNotAvailableException | |
GetProductVariant
public String getProductVariant ()
Броски |
---|
DeviceNotAvailableException | |
getProperty
public String getProperty (String name)
Броски |
---|
DeviceNotAvailableException | |
getRecoveryMode
public ITestDevice.RecoveryMode getRecoveryMode ()
Возврат |
---|
ITestDevice.RecoveryMode | |
getScreenshot
public InputStreamSource getScreenshot (String format)
Возврат |
---|
InputStreamSource | |
Броски |
---|
DeviceNotAvailableException | |
getScreenshot
public InputStreamSource getScreenshot (long displayId)
Возврат |
---|
InputStreamSource | |
Броски |
---|
DeviceNotAvailableException | |
getScreenshot
public InputStreamSource getScreenshot (String format,
boolean rescale)
Параметры |
---|
format | String |
rescale | boolean |
Возврат |
---|
InputStreamSource | |
Броски |
---|
DeviceNotAvailableException | |
getScreenshot
public InputStreamSource getScreenshot ()
Возврат |
---|
InputStreamSource | |
Броски |
---|
DeviceNotAvailableException | |
получитьсерийный номер
public String getSerialNumber ()
getSetting
public String getSetting (int userId,
String namespace,
String key)
Параметры |
---|
userId | int |
namespace | String |
key | String |
Броски |
---|
DeviceNotAvailableException | |
getSetting
public String getSetting (String namespace,
String key)
Параметры |
---|
namespace | String |
key | String |
Броски |
---|
DeviceNotAvailableException | |
getSimOperator
public String getSimOperator ()
getSimState
public String getSimState ()
получить надгробия
public getTombstones ()
Броски |
---|
DeviceNotAvailableException | |
getTotalMemory
public long getTotalMemory ()
getUninstallablePackageNames
public getUninstallablePackageNames ()
Броски |
---|
DeviceNotAvailableException | |
getUseFastbootErase
public boolean getUseFastbootErase ()
getUserFlags
public int getUserFlags (int userId)
Броски |
---|
DeviceNotAvailableException | |
getUserInfos
public getUserInfos ()
Броски |
---|
DeviceNotAvailableException | |
getUserSerialNumber
public int getUserSerialNumber (int userId)
Броски |
---|
DeviceNotAvailableException | |
handleAllocationEvent
public IManagedTestDevice.DeviceEventResponse handleAllocationEvent (DeviceEvent event)
Обработайте DeviceEvent, который может перевести или не перевести это устройство в новое состояние распределения.
Параметры |
---|
event | DeviceEvent |
Возврат |
---|
IManagedTestDevice.DeviceEventResponse | |
имеет особенность
public boolean hasFeature (String feature)
Броски |
---|
DeviceNotAvailableException | |
установитьПакет
public String installPackage (File packageFile,
boolean reinstall,
String... extraArgs)
Параметры |
---|
packageFile | File |
reinstall | boolean |
extraArgs | String |
Броски |
---|
DeviceNotAvailableException | |
установитьПакет
public String installPackage (File packageFile,
boolean reinstall,
boolean grantPermissions,
String... extraArgs)
Параметры |
---|
packageFile | File |
reinstall | boolean |
grantPermissions | boolean |
extraArgs | String |
Броски |
---|
DeviceNotAvailableException | |
installPackageForUser
public String installPackageForUser (File packageFile,
boolean reinstall,
int userId,
String... extraArgs)
Параметры |
---|
packageFile | File |
reinstall | boolean |
userId | int |
extraArgs | String |
Броски |
---|
DeviceNotAvailableException | |
installPackageForUser
public String installPackageForUser (File packageFile,
boolean reinstall,
boolean grantPermissions,
int userId,
String... extraArgs)
Параметры |
---|
packageFile | File |
reinstall | boolean |
grantPermissions | boolean |
userId | int |
extraArgs | String |
Броски |
---|
DeviceNotAvailableException | |
isAdbRoot
public boolean isAdbRoot ()
Броски |
---|
DeviceNotAvailableException | |
isAdbTcp
public boolean isAdbTcp ()
isAppEnumerationSupported
public boolean isAppEnumerationSupported ()
Броски |
---|
DeviceNotAvailableException | |
isDeviceEncrypted
public boolean isDeviceEncrypted ()
Броски |
---|
DeviceNotAvailableException | |
isDirectory
public boolean isDirectory (String path)
Броски |
---|
DeviceNotAvailableException | |
исенаблеадбрут
public boolean isEnableAdbRoot ()
Возврат |
---|
boolean | true , если на устройстве должен быть включен adb root |
isEncryptionSupported
public boolean isEncryptionSupported ()
Броски |
---|
DeviceNotAvailableException | |
isExecutable
public boolean isExecutable (String fullPath)
Параметры |
---|
fullPath | String |
Броски |
---|
DeviceNotAvailableException | |
isFastbootEnabled
public boolean isFastbootEnabled ()
isHeadless
public boolean isHeadless ()
Броски |
---|
DeviceNotAvailableException | |
isMultiUserSupported
public boolean isMultiUserSupported ()
Броски |
---|
DeviceNotAvailableException | |
isPackageInstalled
public boolean isPackageInstalled (String packageName,
String userId)
Параметры |
---|
packageName | String |
userId | String |
Броски |
---|
DeviceNotAvailableException | |
isPackageInstalled
public boolean isPackageInstalled (String packageName)
Параметры |
---|
packageName | String |
Броски |
---|
DeviceNotAvailableException | |
isRuntimePermissionSupported
public boolean isRuntimePermissionSupported ()
Броски |
---|
DeviceNotAvailableException | |
isStateBootloaderOrFastbootd
public boolean isStateBootloaderOrFastbootd ()
isUserRunning
public boolean isUserRunning (int userId)
Броски |
---|
DeviceNotAvailableException | |
isUserSecondary
public boolean isUserSecondary (int userId)
Броски |
---|
DeviceNotAvailableException | |
isWiFiEnabled
public boolean isWifiEnabled ()
Броски |
---|
DeviceNotAvailableException | |
списокдисплейидс
public listDisplayIds ()
Броски |
---|
DeviceNotAvailableException | |
списокПользователи
public listUsers ()
Броски |
---|
DeviceNotAvailableException | |
журнал ошибок
public boolean logBugreport (String dataName,
ITestLogger listener)
Параметры |
---|
dataName | String |
listener | ITestLogger |
войти надевице
public void logOnDevice (String tag,
Log.LogLevel level,
String format,
Object... args)
Параметры |
---|
tag | String |
level | Log.LogLevel |
format | String |
args | Object |
неблокирующая перезагрузка
public void nonBlockingReboot ()
Броски |
---|
DeviceNotAvailableException | |
постAdbRootAction
public void postAdbRootAction ()
Переопределить, если устройству необходимо выполнить какие-то определенные действия после получения root-доступа adb и до того, как устройство снова подключится к сети. Реализация по умолчанию не включает никаких дополнительных действий. На этом этапе не гарантируется, что adb root будет включен.
Броски |
---|
DeviceNotAvailableException | |
постAdbUnrootAction
public void postAdbUnrootAction ()
Переопределить, если устройству необходимо выполнить какие-то определенные действия после отключения adb и до того, как устройство снова подключится к сети. Реализация по умолчанию не включает никаких дополнительных действий. На этом этапе adb root не обязательно будет отключен.
Броски |
---|
DeviceNotAvailableException | |
постBootSetup
public void postBootSetup ()
Броски |
---|
DeviceNotAvailableException | |
постПризывСнос
public void postInvocationTearDown (Throwable exception)
Параметры |
---|
exception | Throwable |
предвызовНастройка
public void preInvocationSetup (IBuildInfo info,
MultiMap<String, String> attributes)
Параметры |
---|
info | IBuildInfo |
attributes | MultiMap |
Броски |
---|
DeviceNotAvailableException | |
TargetSetupError | |
pullDir
public boolean pullDir (String deviceFilePath,
File localDir)
Параметры |
---|
deviceFilePath | String |
localDir | File |
Броски |
---|
DeviceNotAvailableException | |
вытащить файл
public boolean pullFile (String remoteFilePath,
File localFile)
Параметры |
---|
remoteFilePath | String |
localFile | File |
Броски |
---|
DeviceNotAvailableException | |
вытащить файл
public File pullFile (String remoteFilePath)
Параметры |
---|
remoteFilePath | String |
Броски |
---|
DeviceNotAvailableException | |
pullFileContents
public String pullFileContents (String remoteFilePath)
Параметры |
---|
remoteFilePath | String |
Броски |
---|
DeviceNotAvailableException | |
вытащить филефромекстернал
public File pullFileFromExternal (String remoteFilePath)
Параметры |
---|
remoteFilePath | String |
Броски |
---|
DeviceNotAvailableException | |
pushDir
public boolean pushDir (File localFileDir,
String deviceFilePath,
excludedDirectories)
Параметры |
---|
localFileDir | File |
deviceFilePath | String |
excludedDirectories | |
Броски |
---|
DeviceNotAvailableException | |
pushDir
public boolean pushDir (File localFileDir,
String deviceFilePath)
Параметры |
---|
localFileDir | File |
deviceFilePath | String |
Броски |
---|
DeviceNotAvailableException | |
pushFile
public boolean pushFile (File localFile,
String remoteFilePath)
Параметры |
---|
localFile | File |
remoteFilePath | String |
Броски |
---|
DeviceNotAvailableException | |
pushString
public boolean pushString (String contents,
String remoteFilePath)
Параметры |
---|
contents | String |
remoteFilePath | String |
Броски |
---|
DeviceNotAvailableException | |
перезагрузить
public void reboot (String reason)
Броски |
---|
DeviceNotAvailableException | |
перезагрузить
public void reboot ()
Броски |
---|
DeviceNotAvailableException | |
перезагрузкаIntoBootloader
public void rebootIntoBootloader ()
Броски |
---|
DeviceNotAvailableException | |
перезагрузкаIntoFastbootd
public void rebootIntoFastbootd ()
Броски |
---|
DeviceNotAvailableException | |
перезагрузкаIntoRecovery
public void rebootIntoRecovery ()
Броски |
---|
DeviceNotAvailableException | |
перезагрузкаIntoSideload
public void rebootIntoSideload ()
Броски |
---|
DeviceNotAvailableException | |
перезагрузкаIntoSideload
public void rebootIntoSideload (boolean autoReboot)
Параметры |
---|
autoReboot | boolean |
Броски |
---|
DeviceNotAvailableException | |
перезагрузкаUntilOnline
public void rebootUntilOnline ()
Броски |
---|
DeviceNotAvailableException | |
перезагрузкаUntilOnline
public void rebootUntilOnline (String reason)
Броски |
---|
DeviceNotAvailableException | |
перезагрузкаПространство пользователя
public void rebootUserspace ()
Броски |
---|
DeviceNotAvailableException | |
перезагрузкаUserspaceUntilOnline
public void rebootUserspaceUntilOnline ()
Броски |
---|
DeviceNotAvailableException | |
восстановить устройство
public void recoverDevice ()
Попытки восстановить связь с устройством.
Броски |
---|
DeviceNotAvailableException | если устройство больше не доступно |
remountSystemWritable
public void remountSystemWritable ()
Броски |
---|
DeviceNotAvailableException | |
перемонтироватьVendorWritable
public void remountVendorWritable ()
Броски |
---|
DeviceNotAvailableException | |
удалить администратора
public boolean removeAdmin (String componentName,
int userId)
Параметры |
---|
componentName | String |
userId | int |
Броски |
---|
DeviceNotAvailableException | |
удалить владельцев
public void removeOwners ()
Броски |
---|
DeviceNotAvailableException | |
удалить пользователя
public boolean removeUser (int userId)
Броски |
---|
DeviceNotAvailableException | |
сбросКонтентпровидерсетуп
public void resetContentProviderSetup ()
Сбросьте флаг настройки поставщика контента, чтобы активировать его снова.
запуститьInstrumentationTests
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner,
ITestLifeCycleReceiver... listeners)
Параметры |
---|
runner | IRemoteAndroidTestRunner |
listeners | ITestLifeCycleReceiver |
Броски |
---|
DeviceNotAvailableException | |
запуститьInstrumentationTests
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner,
listeners)
Параметры |
---|
runner | IRemoteAndroidTestRunner |
listeners | |
Броски |
---|
DeviceNotAvailableException | |
запуститьInstrumentationTestsAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner,
int userId,
ITestLifeCycleReceiver... listeners)
Параметры |
---|
runner | IRemoteAndroidTestRunner |
userId | int |
listeners | ITestLifeCycleReceiver |
Броски |
---|
DeviceNotAvailableException | |
запуститьInstrumentationTestsAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner,
int userId,
listeners)
Параметры |
---|
runner | IRemoteAndroidTestRunner |
userId | int |
listeners | |
Броски |
---|
DeviceNotAvailableException | |
setConfiguration
public void setConfiguration (IConfiguration configuration)
Внедряет используемый IConfiguration
.
Параметры |
---|
configuration | IConfiguration |
УстановитьДата
public void setDate (Date date)
Броски |
---|
DeviceNotAvailableException | |
setDeviceOwner
public boolean setDeviceOwner (String componentName,
int userId)
Параметры |
---|
componentName | String |
userId | int |
Броски |
---|
DeviceNotAvailableException | |
setDeviceState
public void setDeviceState (TestDeviceState deviceState)
Параметры |
---|
deviceState | TestDeviceState |
setEmulatorOutputStream
public void setEmulatorOutputStream (SizeLimitedOutputStream output)
Для эмулятора установите SizeLimitedOutputStream
для регистрации вывода
Параметры |
---|
output | SizeLimitedOutputStream : для регистрации вывода |
setEmulatorProcess
public void setEmulatorProcess (Process p)
установитьFastbootEnabled
public void setFastbootEnabled (boolean fastbootEnabled)
Параметры |
---|
fastbootEnabled | boolean |
установитьFastbootPath
public void setFastbootPath (String fastbootPath)
Параметры |
---|
fastbootPath | String |
setIDevice
public void setIDevice (IDevice newDevice)
Параметры |
---|
newDevice | IDevice |
УстановитьОпции
public void setOptions (TestDeviceOptions options)
Параметры |
---|
options | TestDeviceOptions |
setProperty
public boolean setProperty (String propKey,
String propValue)
Параметры |
---|
propKey | String |
propValue | String |
Броски |
---|
DeviceNotAvailableException | |
setRecovery
public void setRecovery (IDeviceRecovery recovery)
Параметры |
---|
recovery | IDeviceRecovery |
setRecoveryMode
public void setRecoveryMode (ITestDevice.RecoveryMode mode)
Параметры |
---|
mode | ITestDevice.RecoveryMode |
УстановитьНастройки
public void setSetting (String namespace,
String key,
String value)
Параметры |
---|
namespace | String |
key | String |
value | String |
Броски |
---|
DeviceNotAvailableException | |
УстановитьНастройки
public void setSetting (int userId,
String namespace,
String key,
String value)
Параметры |
---|
userId | int |
namespace | String |
key | String |
value | String |
Броски |
---|
DeviceNotAvailableException | |
setUseFastbootErase
public void setUseFastbootErase (boolean useFastbootErase)
Параметры |
---|
useFastbootErase | boolean |
startLogcat
public void startLogcat ()
startUser
public boolean startUser (int userId)
Броски |
---|
DeviceNotAvailableException | |
startUser
public boolean startUser (int userId,
boolean waitFlag)
Параметры |
---|
userId | int |
waitFlag | boolean |
Броски |
---|
DeviceNotAvailableException | |
остановитьEmulatorOutput
public void stopEmulatorOutput ()
стопLogcat
public void stopLogcat ()
стоппользователь
public boolean stopUser (int userId)
Броски |
---|
DeviceNotAvailableException | |
стоппользователь
public boolean stopUser (int userId,
boolean waitFlag,
boolean forceFlag)
Параметры |
---|
userId | int |
waitFlag | boolean |
forceFlag | boolean |
Броски |
---|
DeviceNotAvailableException | |
переключательToAdbTcp
public String switchToAdbTcp ()
Броски |
---|
DeviceNotAvailableException | |
переключательToAdbUsb
public boolean switchToAdbUsb ()
Броски |
---|
DeviceNotAvailableException | |
поменять пользователя
public boolean switchUser (int userId)
Броски |
---|
DeviceNotAvailableException | |
поменять пользователя
public boolean switchUser (int userId,
long timeout)
Параметры |
---|
userId | int |
timeout | long |
Броски |
---|
DeviceNotAvailableException | |
синхронизировать файлы
public boolean syncFiles (File localFileDir,
String deviceFilePath)
Параметры |
---|
localFileDir | File |
deviceFilePath | String |
Броски |
---|
DeviceNotAvailableException | |
взятьBugreport
public Bugreport takeBugreport ()
unencryptDevice
public boolean unencryptDevice ()
Броски |
---|
DeviceNotAvailableException | |
удалить пакет
public String uninstallPackage (String packageName)
Параметры |
---|
packageName | String |
Броски |
---|
DeviceNotAvailableException | |
деинсталлироватьПакажефорюсер
public String uninstallPackageForUser (String packageName,
int userId)
Параметры |
---|
packageName | String |
userId | int |
Броски |
---|
DeviceNotAvailableException | |
разблокировать устройство
public boolean unlockDevice ()
Броски |
---|
DeviceNotAvailableException | |
ждатьForBootComplete
public boolean waitForBootComplete (long timeOut)
Броски |
---|
DeviceNotAvailableException | |
waitForDeviceAvailable
public void waitForDeviceAvailable ()
Броски |
---|
DeviceNotAvailableException | |
waitForDeviceAvailable
public void waitForDeviceAvailable (long waitTime)
Броски |
---|
DeviceNotAvailableException | |
waitForDeviceInRecovery
public boolean waitForDeviceInRecovery (long waitTime)
waitForDeviceInSideload
public boolean waitForDeviceInSideload (long waitTime)
waitForDeviceNotAvailable
public boolean waitForDeviceNotAvailable (long waitTime)
ждатьForDeviceOnline
public void waitForDeviceOnline ()
Броски |
---|
DeviceNotAvailableException | |
ждатьForDeviceOnline
public void waitForDeviceOnline (long waitTime)
Броски |
---|
DeviceNotAvailableException | |
waitForDeviceShell
public boolean waitForDeviceShell (long waitTime)
Защищенные методы
проверитьApiLevelAgainst
protected void checkApiLevelAgainst (String feature,
int strictMinLevel)
Параметры |
---|
feature | String |
strictMinLevel | int |
doAdbReboot
protected void doAdbReboot (NativeDevice.RebootMode rebootMode,
String reason)
Выполните перезагрузку adb.
Параметры |
---|
rebootMode | NativeDevice.RebootMode : режим этой перезагрузки. |
reason | String : для этой перезагрузки. |
Броски |
---|
DeviceNotAvailableException | |
обеспеченияРунтаймеПермиссионПоддерживаемый
protected void ensureRuntimePermissionSupported ()
вспомогательный метод для создания исключения, если разрешение времени выполнения не поддерживается
Броски |
---|
DeviceNotAvailableException | |
getBugreportInternal
protected InputStreamSource getBugreportInternal ()
Возврат |
---|
InputStreamSource | |
getBugreportzInternal
protected File getBugreportzInternal ()
Внутренний вспомогательный метод для получения zip-файла bugreportz как ERROR(/File)
.
getRunUtil
protected IRunUtil getRunUtil ()
Получите экземпляр RunUtil
для использования.
внутреннийGetProperty
protected String internalGetProperty (String propName,
String fastbootVar,
String description)
Получите свойство устройства из кэша ddmlib по умолчанию и вернитесь к `adb Shell getprop` или `fastboot getvar` в зависимости от того, находится ли устройство в режиме Fastboot или нет.
Параметры |
---|
propName | String : имя свойства устройства, возвращаемое `adb Shell getprop`. |
fastbootVar | String : имя эквивалентной переменной fastboot для запроса. если null , запрос на быструю загрузку выполняться не будет. |
description | String : простое описание переменной. Первая буква должна быть заглавной. |
Возврат |
---|
String | Строка, возможно, null или пустая, содержащая значение данного свойства. |
Броски |
---|
DeviceNotAvailableException | |
isNewer
protected boolean isNewer (File localFile,
IFileEntry entry)
Возвращайте true
если локальный файл новее удаленного файла. IFileEntry
с точностью до минуты, в случае равенства времени файл будет считаться более новым.
Параметры |
---|
localFile | File |
entry | IFileEntry |
protected boolean performDeviceAction (String actionDescription,
com.android.tradefed.device.NativeDevice.DeviceAction action,
int retryAttempts)
Выполняет действие на этом устройстве. Пытается восстановить устройство и, при необходимости, повторить команду, если действие не удалось.
Параметры |
---|
actionDescription | String : краткое описание действия, которое необходимо выполнить. Используется только для целей регистрации. |
action | com.android.tradefed.device.NativeDevice.DeviceAction : действие, которое необходимо выполнить. |
retryAttempts | int : повторная попытка пытается выполнить действие в случае неудачи, но восстановление завершается успешно. |
Возврат |
---|
boolean | true , если действие было выполнено успешно |
Броски |
---|
DeviceNotAvailableException | если попытка восстановления не удалась или максимальное количество попыток выполнено безуспешно |
postAdbReboot
protected void postAdbReboot ()
Возможные дополнительные действия, которые можно предпринять после перезагрузки.
Броски |
---|
DeviceNotAvailableException | |
prePostBootSetup
protected void prePostBootSetup ()
Позволяет каждому типу устройства (AndroidNativeDevice, TestDevice) переопределить этот метод для конкретной настройки после загрузки.
Броски |
---|
DeviceNotAvailableException | |
setClock
protected void setClock (Clock clock)
Установите экземпляр Clock для использования.
setLogStartDelay
protected void setLogStartDelay (int delay)
Устанавливает время ожидания в мс перед началом захвата logcat для подключенного к сети устройства.
Параметры |
---|
delay | int : задержка в мс |
waitForDeviceNotAvailable
protected void waitForDeviceNotAvailable (String operationDesc,
long time)
Параметры |
---|
operationDesc | String |
time | long |
Контент и образцы кода на этой странице предоставлены по лицензиям. Java и OpenJDK – это зарегистрированные товарные знаки корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2023-12-01 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Отсутствует нужная мне информация"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Слишком сложен/слишком много шагов"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Устарел"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"Проблема с переводом текста"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Проблемы образцов/кода"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Другое"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Прост для понимания"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Помог мне решить мою проблему"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Другое"
}]