РодноеУстройство
public class NativeDevice
extends Object
implements IManagedTestDevice, IConfigurationReceiver
java.lang.Объект | |
↳ | com.android.tradefed.device.NativeDevice |
Реализация по умолчанию ITestDevice
Неполноценные устройства Android.
Краткое содержание
Вложенные классы | |
---|---|
class | NativeDevice.AdbAction |
class | NativeDevice.AdbShellAction |
class | NativeDevice.RebootDeviceAction |
enum | NativeDevice.RebootMode Режим перезагрузки. |
Константы | |
---|---|
int | INVALID_USER_ID Значение, возвращаемое для любого недействительного/не найденного идентификатора пользователя: UserHandle определил значение -10000. |
long | MAX_HOST_DEVICE_TIME_OFFSET |
int | MAX_RETRY_ATTEMPTS количество попыток повтора команды по умолчанию |
Поля | |
---|---|
protected static final String | SD_CARD |
protected static final String | STORAGE_EMULATED |
protected TestDeviceOptions | mOptions |
protected final IDeviceStateMonitor | mStateMonitor
|
Общественные конструкторы | |
---|---|
NativeDevice (IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor) Создает |
Публичные методы | |
---|---|
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 () Журнал, содержащий все журналы |
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) Неофициальный помощник для получения |
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) Внедряет используемый |
void | setDate (Date date) |
boolean | setDeviceOwner (String componentName, int userId) |
void | setDeviceState (TestDeviceState deviceState) |
void | setEmulatorOutputStream ( SizeLimitedOutputStream output) Для эмулятора установите |
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) Создайте |
void | doAdbReboot ( NativeDevice.RebootMode rebootMode, String reason) Выполните перезагрузку adb. |
void | ensureRuntimePermissionSupported () вспомогательный метод для создания исключения, если разрешение времени выполнения не поддерживается |
InputStreamSource | getBugreportInternal () |
File | getBugreportzInternal () Внутренний вспомогательный метод для получения zip-файла bugreportz как |
IRunUtil | getRunUtil () Получите экземпляр |
String | internalGetProperty (String propName, String fastbootVar, String description) Получите свойство устройства из кэша ddmlib по умолчанию и вернитесь к `adb Shell getprop` или `fastboot getvar` в зависимости от того, находится ли устройство в режиме Fastboot или нет. |
boolean | isNewer (File localFile, IFileEntry entry) Возвращайте |
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_КАРТА
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 |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
checkConnectivity
public boolean checkConnectivity ()
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
ClearErrorDialogs
public boolean clearErrorDialogs ()
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
ClearLastConnectedWiFiNetwork
public void clearLastConnectedWifiNetwork ()
очиститьLogcat
public void clearLogcat ()
ConnectToWiFiNetwork
public boolean connectToWifiNetwork (String wifiSsid, String wifiPsk)
Параметры | |
---|---|
wifiSsid | String |
wifiPsk | String |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
ConnectToWiFiNetwork
public boolean connectToWifiNetwork (String wifiSsid, String wifiPsk, boolean scanSsid)
Параметры | |
---|---|
wifiSsid | String |
wifiPsk | String |
scanSsid | boolean |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
ConnectToWifiNetworkIfNeeded
public boolean connectToWifiNetworkIfNeeded (String wifiSsid, String wifiPsk, boolean scanSsid)
Параметры | |
---|---|
wifiSsid | String |
wifiPsk | String |
scanSsid | boolean |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
ConnectToWifiNetworkIfNeeded
public boolean connectToWifiNetworkIfNeeded (String wifiSsid, String wifiPsk)
Параметры | |
---|---|
wifiSsid | String |
wifiPsk | String |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
создать пользователя
public int createUser (String name, boolean guest, boolean ephemeral)
Параметры | |
---|---|
name | String |
guest | boolean |
ephemeral | boolean |
Возврат | |
---|---|
int |
Броски | |
---|---|
DeviceNotAvailableException |
создать пользователя
public int createUser (String name)
Параметры | |
---|---|
name | String |
Возврат | |
---|---|
int |
Броски | |
---|---|
DeviceNotAvailableException |
createUserNoThrow
public int createUserNoThrow (String name)
Параметры | |
---|---|
name | String |
Возврат | |
---|---|
int |
Броски | |
---|---|
DeviceNotAvailableException |
удалить файл
public void deleteFile (String deviceFilePath)
Параметры | |
---|---|
deviceFilePath | String |
Броски | |
---|---|
DeviceNotAvailableException |
устройствоSoftRestarted
public boolean deviceSoftRestarted (ProcessInfo prevSystemServerProcess)
Параметры | |
---|---|
prevSystemServerProcess | ProcessInfo |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
устройствоSoftRestartedSince
public boolean deviceSoftRestartedSince (long utcEpochTime, TimeUnit timeUnit)
Параметры | |
---|---|
utcEpochTime | long |
timeUnit | TimeUnit |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
отключитьAdbRoot
public boolean disableAdbRoot ()
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
отключитьKeyguard
public void disableKeyguard ()
Броски | |
---|---|
DeviceNotAvailableException |
отключитьNetworkMonitor
public boolean disableNetworkMonitor ()
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
отключить от Wi-Fi
public boolean disconnectFromWifi ()
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
делаетFileExist
public boolean doesFileExist (String deviceFilePath)
Параметры | |
---|---|
deviceFilePath | String |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
дампКуча
public File dumpHeap (String process, String devicePath)
Параметры | |
---|---|
process | String |
devicePath | String |
Возврат | |
---|---|
File |
Броски | |
---|---|
DeviceNotAvailableException |
включитьAdbRoot
public boolean enableAdbRoot ()
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
включитьNetworkMonitor
public boolean enableNetworkMonitor ()
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
шифроватьустройство
public boolean encryptDevice (boolean inplace)
Параметры | |
---|---|
inplace | boolean |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
выполнитьAdbCommand
public String executeAdbCommand (long timeout, String... cmdArgs)
Параметры | |
---|---|
timeout | long |
cmdArgs | String |
Возврат | |
---|---|
String |
Броски | |
---|---|
DeviceNotAvailableException |
выполнитьAdbCommand
public String executeAdbCommand (String... cmdArgs)
Параметры | |
---|---|
cmdArgs | String |
Возврат | |
---|---|
String |
Броски | |
---|---|
DeviceNotAvailableException |
выполнитьFastbootCommand
public CommandResult executeFastbootCommand (String... cmdArgs)
Параметры | |
---|---|
cmdArgs | String |
Возврат | |
---|---|
CommandResult |
Броски | |
---|---|
DeviceNotAvailableException |
выполнитьFastbootCommand
public CommandResult executeFastbootCommand (long timeout, String... cmdArgs)
Параметры | |
---|---|
timeout | long |
cmdArgs | String |
Возврат | |
---|---|
CommandResult |
Броски | |
---|---|
DeviceNotAvailableException |
выполнитьLongFastbootCommand
public CommandResult executeLongFastbootCommand (String... cmdArgs)
Параметры | |
---|---|
cmdArgs | String |
Возврат | |
---|---|
CommandResult |
Броски | |
---|---|
DeviceNotAvailableException |
выполнитьShellCommand
public String executeShellCommand (String command)
Параметры | |
---|---|
command | String |
Возврат | |
---|---|
String |
Броски | |
---|---|
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)
Параметры | |
---|---|
cmd | String |
Возврат | |
---|---|
CommandResult |
Броски | |
---|---|
DeviceNotAvailableException |
выполнитьShellV2Command
public CommandResult executeShellV2Command (String cmd, OutputStream pipeToOutput)
Параметры | |
---|---|
cmd | String |
pipeToOutput | OutputStream |
Возврат | |
---|---|
CommandResult |
Броски | |
---|---|
DeviceNotAvailableException |
выполнитьShellV2Command
public CommandResult executeShellV2Command (String cmd, File pipeAsInput)
Параметры | |
---|---|
cmd | String |
pipeAsInput | File |
Возврат | |
---|---|
CommandResult |
Броски | |
---|---|
DeviceNotAvailableException |
выполнитьShellV2Command
public CommandResult executeShellV2Command (String cmd, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
Параметры | |
---|---|
cmd | String |
maxTimeoutForCommand | long |
timeUnit | TimeUnit |
retryAttempts | int |
Возврат | |
---|---|
CommandResult |
Броски | |
---|---|
DeviceNotAvailableException |
выполнитьShellV2Command
public CommandResult executeShellV2Command (String cmd, long maxTimeoutForCommand, TimeUnit timeUnit)
Параметры | |
---|---|
cmd | String |
maxTimeoutForCommand | long |
timeUnit | TimeUnit |
Возврат | |
---|---|
CommandResult |
Броски | |
---|---|
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 |
Возврат | |
---|---|
CommandResult |
Броски | |
---|---|
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 |
Возврат | |
---|---|
CommandResult |
Броски | |
---|---|
DeviceNotAvailableException |
fastbootWipePartition
public CommandResult fastbootWipePartition (String partition)
Параметры | |
---|---|
partition | String |
Возврат | |
---|---|
CommandResult |
Броски | |
---|---|
DeviceNotAvailableException |
getActiveApexes
publicgetActiveApexes ()
Возврат | |
---|---|
Броски | |
---|---|
DeviceNotAvailableException |
получить все настройки
publicgetAllSettings (String namespace)
Параметры | |
---|---|
namespace | String |
Возврат | |
---|---|
Броски | |
---|---|
DeviceNotAvailableException |
getAllocationState
public DeviceAllocationState getAllocationState ()
Возврат | |
---|---|
DeviceAllocationState |
получитьAndroidId
public String getAndroidId (int userId)
Параметры | |
---|---|
userId | int |
Возврат | |
---|---|
String |
Броски | |
---|---|
DeviceNotAvailableException |
получитьAndroidIds
publicgetAndroidIds ()
Возврат | |
---|---|
Броски | |
---|---|
DeviceNotAvailableException |
getApiLevel
public int getApiLevel ()
Возврат | |
---|---|
int |
Броски | |
---|---|
DeviceNotAvailableException |
getAppPackageInfo
public PackageInfo getAppPackageInfo (String packageName)
Параметры | |
---|---|
packageName | String |
Возврат | |
---|---|
PackageInfo |
Броски | |
---|---|
DeviceNotAvailableException |
getAppPackageInfos
publicgetAppPackageInfos ()
Возврат | |
---|---|
Броски | |
---|---|
DeviceNotAvailableException |
getBasebandVersion
public String getBasebandVersion ()
Возврат | |
---|---|
String |
Броски | |
---|---|
DeviceNotAvailableException |
getBattery
public Integer getBattery ()
Возврат | |
---|---|
Integer |
getBooleanProperty
public boolean getBooleanProperty (String name, boolean defaultValue)
Параметры | |
---|---|
name | String |
defaultValue | boolean |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
getBootHistory
publicgetBootHistory ()
Возврат | |
---|---|
Броски | |
---|---|
DeviceNotAvailableException |
getBootHistorySince
publicgetBootHistorySince (long utcEpochTime, TimeUnit timeUnit)
Параметры | |
---|---|
utcEpochTime | long |
timeUnit | TimeUnit |
Возврат | |
---|---|
Броски | |
---|---|
DeviceNotAvailableException |
getBootloaderVersion
public String getBootloaderVersion ()
Возврат | |
---|---|
String |
Броски | |
---|---|
DeviceNotAvailableException |
getBugreport
public InputStreamSource getBugreport ()
Возврат | |
---|---|
InputStreamSource |
getBugreportz
public InputStreamSource getBugreportz ()
Возврат | |
---|---|
InputStreamSource |
getBuildAlias
public String getBuildAlias ()
Возврат | |
---|---|
String |
Броски | |
---|---|
DeviceNotAvailableException |
getBuildFlavor
public String getBuildFlavor ()
Возврат | |
---|---|
String |
Броски | |
---|---|
DeviceNotAvailableException |
getBuildId
public String getBuildId ()
Возврат | |
---|---|
String |
Броски | |
---|---|
DeviceNotAvailableException |
getBuildSigningKeys
public String getBuildSigningKeys ()
Возврат | |
---|---|
String |
Броски | |
---|---|
DeviceNotAvailableException |
getCachedDeviceDescriptor
public DeviceDescriptor getCachedDeviceDescriptor ()
Возврат | |
---|---|
DeviceDescriptor |
getChildren
public String[] getChildren (String path)
Параметры | |
---|---|
path | String |
Возврат | |
---|---|
String[] |
Броски | |
---|---|
DeviceNotAvailableException |
getCurrentFoldableState
public DeviceFoldableState getCurrentFoldableState ()
Возврат | |
---|---|
DeviceFoldableState |
Броски | |
---|---|
DeviceNotAvailableException |
getCurrentUser
public int getCurrentUser ()
Возврат | |
---|---|
int |
Броски | |
---|---|
DeviceNotAvailableException |
GetDeviceClass
public String getDeviceClass ()
Возврат | |
---|---|
String |
getDeviceDate
public long getDeviceDate ()
Возврат | |
---|---|
long |
Броски | |
---|---|
DeviceNotAvailableException |
getDeviceDescriptor
public DeviceDescriptor getDeviceDescriptor ()
Возврат | |
---|---|
DeviceDescriptor |
getDeviceState
public TestDeviceState getDeviceState ()
Возврат | |
---|---|
TestDeviceState |
getDeviceTimeOffset
public long getDeviceTimeOffset (Date date)
Параметры | |
---|---|
date | Date |
Возврат | |
---|---|
long |
Броски | |
---|---|
DeviceNotAvailableException |
getEmulatorOutput
public InputStreamSource getEmulatorOutput ()
Возврат | |
---|---|
InputStreamSource |
GetEmulatorProcess
public Process getEmulatorProcess ()
Возврат | |
---|---|
Process |
getExecuteShellCommandLog
public final File getExecuteShellCommandLog ()
Журнал, содержащий все журналы executeShellCommand(String)
.
Возврат | |
---|---|
File |
getExternalStoreFreeSpace
public long getExternalStoreFreeSpace ()
Возврат | |
---|---|
long |
Броски | |
---|---|
DeviceNotAvailableException |
получитьFastbootPath
public String getFastbootPath ()
Возврат | |
---|---|
String |
getFastbootProductType
public String getFastbootProductType ()
Возврат | |
---|---|
String |
Броски | |
---|---|
DeviceNotAvailableException |
получитьFastbootProductVariant
public String getFastbootProductVariant ()
Возврат | |
---|---|
String |
Броски | |
---|---|
DeviceNotAvailableException |
ПолучитьFastbootSerialNumber
public String getFastbootSerialNumber ()
Возврат | |
---|---|
String |
получитьFastbootVariable
public String getFastbootVariable (String variableName)
Параметры | |
---|---|
variableName | String |
Возврат | |
---|---|
String |
Броски | |
---|---|
DeviceNotAvailableException |
получитьFastbootVersion
public String getFastbootVersion ()
Возврат | |
---|---|
String |
getFileEntry
public IFileEntry getFileEntry (String path)
Параметры | |
---|---|
path | String |
Возврат | |
---|---|
IFileEntry |
Броски | |
---|---|
DeviceNotAvailableException |
getFileEntry
public IFileEntry getFileEntry (FileListingService.FileEntry entry)
Неофициальный помощник для получения FileEntry
по некорневому пути. ИСПРАВЛЕНИЕ: Реорганизуйте систему FileEntry, чтобы она была доступна по любому пути. (даже без root).
Параметры | |
---|---|
entry | FileListingService.FileEntry : FileEntry не обязательно является корневым, как того требует Ddmlib. |
Возврат | |
---|---|
IFileEntry | FileEntryWrapper представляющий FileEntry. |
Броски | |
---|---|
DeviceNotAvailableException |
getFoldableStates
publicgetFoldableStates ()
Возврат | |
---|---|
Броски | |
---|---|
DeviceNotAvailableException |
getIDevice
public IDevice getIDevice ()
Возврат | |
---|---|
IDevice |
getInstalledPackageNames
publicgetInstalledPackageNames ()
Возврат | |
---|---|
Броски | |
---|---|
DeviceNotAvailableException |
getIntProperty
public long getIntProperty (String name, long defaultValue)
Параметры | |
---|---|
name | String |
defaultValue | long |
Возврат | |
---|---|
long |
Броски | |
---|---|
DeviceNotAvailableException |
получитьIpAddress
public String getIpAddress ()
Возврат | |
---|---|
String |
Броски | |
---|---|
DeviceNotAvailableException |
getKeyguardState
public KeyguardControllerState getKeyguardState ()
Возврат | |
---|---|
KeyguardControllerState |
Броски | |
---|---|
DeviceNotAvailableException |
getLastExpectedRebootTimeMillis
public long getLastExpectedRebootTimeMillis ()
Возврат | |
---|---|
long |
getLaunchApiLevel
public int getLaunchApiLevel ()
Возврат | |
---|---|
int |
Броски | |
---|---|
DeviceNotAvailableException |
getLogcat
public InputStreamSource getLogcat ()
Возврат | |
---|---|
InputStreamSource |
getLogcat
public InputStreamSource getLogcat (int maxBytes)
Параметры | |
---|---|
maxBytes | int |
Возврат | |
---|---|
InputStreamSource |
getLogcatDump
public InputStreamSource getLogcatDump ()
Возврат | |
---|---|
InputStreamSource |
getLogcatSince
public InputStreamSource getLogcatSince (long date)
Параметры | |
---|---|
date | long |
Возврат | |
---|---|
InputStreamSource |
получитьMacAddress
public String getMacAddress ()
Возврат | |
---|---|
String |
getMainlineModuleInfo
publicgetMainlineModuleInfo ()
Возврат | |
---|---|
Броски | |
---|---|
DeviceNotAvailableException |
getMaxNumberOfRunningUsersSupported
public int getMaxNumberOfRunningUsersSupported ()
Возврат | |
---|---|
int |
Броски | |
---|---|
DeviceNotAvailableException |
getMaxNumberOfUsersSupported
public int getMaxNumberOfUsersSupported ()
Возврат | |
---|---|
int |
Броски | |
---|---|
DeviceNotAvailableException |
getMonitor
public IDeviceStateMonitor getMonitor ()
Возврат | |
---|---|
IDeviceStateMonitor |
getMountPoint
public String getMountPoint (String mountName)
Параметры | |
---|---|
mountName | String |
Возврат | |
---|---|
String |
getMountPointInfo
public ITestDevice.MountPointInfo getMountPointInfo (String mountpoint)
Параметры | |
---|---|
mountpoint | String |
Возврат | |
---|---|
ITestDevice.MountPointInfo |
Броски | |
---|---|
DeviceNotAvailableException |
getMountPointInfo
publicgetMountPointInfo ()
Возврат | |
---|---|
Броски | |
---|---|
DeviceNotAvailableException |
getOptions
public TestDeviceOptions getOptions ()
Возврат | |
---|---|
TestDeviceOptions |
getPartitionFreeSpace
public long getPartitionFreeSpace (String partition)
Параметры | |
---|---|
partition | String |
Возврат | |
---|---|
long |
Броски | |
---|---|
DeviceNotAvailableException |
получитьPrimaryUserId
public Integer getPrimaryUserId ()
Возврат | |
---|---|
Integer |
Броски | |
---|---|
DeviceNotAvailableException |
getProcessByName
public ProcessInfo getProcessByName (String processName)
Параметры | |
---|---|
processName | String |
Возврат | |
---|---|
ProcessInfo |
Броски | |
---|---|
DeviceNotAvailableException |
getProcessPid
public String getProcessPid (String process)
Параметры | |
---|---|
process | String |
Возврат | |
---|---|
String |
Броски | |
---|---|
DeviceNotAvailableException |
getProductType
public String getProductType ()
Возврат | |
---|---|
String |
Броски | |
---|---|
DeviceNotAvailableException |
GetProductVariant
public String getProductVariant ()
Возврат | |
---|---|
String |
Броски | |
---|---|
DeviceNotAvailableException |
getProperty
public String getProperty (String name)
Параметры | |
---|---|
name | String |
Возврат | |
---|---|
String |
Броски | |
---|---|
DeviceNotAvailableException |
getRecoveryMode
public ITestDevice.RecoveryMode getRecoveryMode ()
Возврат | |
---|---|
ITestDevice.RecoveryMode |
getScreenshot
public InputStreamSource getScreenshot (String format)
Параметры | |
---|---|
format | String |
Возврат | |
---|---|
InputStreamSource |
Броски | |
---|---|
DeviceNotAvailableException |
getScreenshot
public InputStreamSource getScreenshot (long displayId)
Параметры | |
---|---|
displayId | long |
Возврат | |
---|---|
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 ()
Возврат | |
---|---|
String |
getSetting
public String getSetting (int userId, String namespace, String key)
Параметры | |
---|---|
userId | int |
namespace | String |
key | String |
Возврат | |
---|---|
String |
Броски | |
---|---|
DeviceNotAvailableException |
getSetting
public String getSetting (String namespace, String key)
Параметры | |
---|---|
namespace | String |
key | String |
Возврат | |
---|---|
String |
Броски | |
---|---|
DeviceNotAvailableException |
getSimOperator
public String getSimOperator ()
Возврат | |
---|---|
String |
getSimState
public String getSimState ()
Возврат | |
---|---|
String |
получить надгробия
publicgetTombstones ()
Возврат | |
---|---|
Броски | |
---|---|
DeviceNotAvailableException |
getTotalMemory
public long getTotalMemory ()
Возврат | |
---|---|
long |
getUninstallablePackageNames
publicgetUninstallablePackageNames ()
Возврат | |
---|---|
Броски | |
---|---|
DeviceNotAvailableException |
getUseFastbootErase
public boolean getUseFastbootErase ()
Возврат | |
---|---|
boolean |
getUserFlags
public int getUserFlags (int userId)
Параметры | |
---|---|
userId | int |
Возврат | |
---|---|
int |
Броски | |
---|---|
DeviceNotAvailableException |
getUserInfos
publicgetUserInfos ()
Возврат | |
---|---|
Броски | |
---|---|
DeviceNotAvailableException |
getUserSerialNumber
public int getUserSerialNumber (int userId)
Параметры | |
---|---|
userId | int |
Возврат | |
---|---|
int |
Броски | |
---|---|
DeviceNotAvailableException |
handleAllocationEvent
public IManagedTestDevice.DeviceEventResponse handleAllocationEvent (DeviceEvent event)
Обработайте DeviceEvent, который может перевести или не перевести это устройство в новое состояние распределения.
Параметры | |
---|---|
event | DeviceEvent |
Возврат | |
---|---|
IManagedTestDevice.DeviceEventResponse |
имеет особенность
public boolean hasFeature (String feature)
Параметры | |
---|---|
feature | String |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
установитьПакет
public String installPackage (File packageFile, boolean reinstall, String... extraArgs)
Параметры | |
---|---|
packageFile | File |
reinstall | boolean |
extraArgs | String |
Возврат | |
---|---|
String |
Броски | |
---|---|
DeviceNotAvailableException |
установитьПакет
public String installPackage (File packageFile, boolean reinstall, boolean grantPermissions, String... extraArgs)
Параметры | |
---|---|
packageFile | File |
reinstall | boolean |
grantPermissions | boolean |
extraArgs | String |
Возврат | |
---|---|
String |
Броски | |
---|---|
DeviceNotAvailableException |
installPackageForUser
public String installPackageForUser (File packageFile, boolean reinstall, int userId, String... extraArgs)
Параметры | |
---|---|
packageFile | File |
reinstall | boolean |
userId | int |
extraArgs | String |
Возврат | |
---|---|
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 |
Возврат | |
---|---|
String |
Броски | |
---|---|
DeviceNotAvailableException |
isAdbRoot
public boolean isAdbRoot ()
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
isAdbTcp
public boolean isAdbTcp ()
Возврат | |
---|---|
boolean |
isAppEnumerationSupported
public boolean isAppEnumerationSupported ()
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
isDeviceEncrypted
public boolean isDeviceEncrypted ()
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
isDirectory
public boolean isDirectory (String path)
Параметры | |
---|---|
path | String |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
исенаблеадбрут
public boolean isEnableAdbRoot ()
Возврат | |
---|---|
boolean | true , если на устройстве должен быть включен adb root |
isEncryptionSupported
public boolean isEncryptionSupported ()
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
isExecutable
public boolean isExecutable (String fullPath)
Параметры | |
---|---|
fullPath | String |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
isFastbootEnabled
public boolean isFastbootEnabled ()
Возврат | |
---|---|
boolean |
isHeadless
public boolean isHeadless ()
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
isMultiUserSupported
public boolean isMultiUserSupported ()
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
isPackageInstalled
public boolean isPackageInstalled (String packageName, String userId)
Параметры | |
---|---|
packageName | String |
userId | String |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
isPackageInstalled
public boolean isPackageInstalled (String packageName)
Параметры | |
---|---|
packageName | String |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
isRuntimePermissionSupported
public boolean isRuntimePermissionSupported ()
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
isStateBootloaderOrFastbootd
public boolean isStateBootloaderOrFastbootd ()
Возврат | |
---|---|
boolean |
isUserRunning
public boolean isUserRunning (int userId)
Параметры | |
---|---|
userId | int |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
isUserSecondary
public boolean isUserSecondary (int userId)
Параметры | |
---|---|
userId | int |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
isWiFiEnabled
public boolean isWifiEnabled ()
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
списокдисплейидс
publiclistDisplayIds ()
Возврат | |
---|---|
Броски | |
---|---|
DeviceNotAvailableException |
списокПользователи
publiclistUsers ()
Возврат | |
---|---|
Броски | |
---|---|
DeviceNotAvailableException |
журнал ошибок
public boolean logBugreport (String dataName, ITestLogger listener)
Параметры | |
---|---|
dataName | String |
listener | ITestLogger |
Возврат | |
---|---|
boolean |
войти надевице
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 |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
вытащить файл
public boolean pullFile (String remoteFilePath, File localFile)
Параметры | |
---|---|
remoteFilePath | String |
localFile | File |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
вытащить файл
public File pullFile (String remoteFilePath)
Параметры | |
---|---|
remoteFilePath | String |
Возврат | |
---|---|
File |
Броски | |
---|---|
DeviceNotAvailableException |
pullFileContents
public String pullFileContents (String remoteFilePath)
Параметры | |
---|---|
remoteFilePath | String |
Возврат | |
---|---|
String |
Броски | |
---|---|
DeviceNotAvailableException |
вытащить филефромекстернал
public File pullFileFromExternal (String remoteFilePath)
Параметры | |
---|---|
remoteFilePath | String |
Возврат | |
---|---|
File |
Броски | |
---|---|
DeviceNotAvailableException |
pushDir
public boolean pushDir (File localFileDir, String deviceFilePath,excludedDirectories)
Параметры | |
---|---|
localFileDir | File |
deviceFilePath | String |
excludedDirectories |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
pushDir
public boolean pushDir (File localFileDir, String deviceFilePath)
Параметры | |
---|---|
localFileDir | File |
deviceFilePath | String |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
pushFile
public boolean pushFile (File localFile, String remoteFilePath)
Параметры | |
---|---|
localFile | File |
remoteFilePath | String |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
pushString
public boolean pushString (String contents, String remoteFilePath)
Параметры | |
---|---|
contents | String |
remoteFilePath | String |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
перезагрузить
public void reboot (String reason)
Параметры | |
---|---|
reason | String |
Броски | |
---|---|
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)
Параметры | |
---|---|
reason | String |
Броски | |
---|---|
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 |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
удалить владельцев
public void removeOwners ()
Броски | |
---|---|
DeviceNotAvailableException |
удалить пользователя
public boolean removeUser (int userId)
Параметры | |
---|---|
userId | int |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
сбросКонтентпровидерсетуп
public void resetContentProviderSetup ()
Сбросьте флаг настройки поставщика контента, чтобы активировать его снова.
запуститьInstrumentationTests
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner, ITestLifeCycleReceiver... listeners)
Параметры | |
---|---|
runner | IRemoteAndroidTestRunner |
listeners | ITestLifeCycleReceiver |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
запуститьInstrumentationTests
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner,listeners)
Параметры | |
---|---|
runner | IRemoteAndroidTestRunner |
listeners |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
запуститьInstrumentationTestsAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, ITestLifeCycleReceiver... listeners)
Параметры | |
---|---|
runner | IRemoteAndroidTestRunner |
userId | int |
listeners | ITestLifeCycleReceiver |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
запуститьInstrumentationTestsAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId,listeners)
Параметры | |
---|---|
runner | IRemoteAndroidTestRunner |
userId | int |
listeners |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
setConfiguration
public void setConfiguration (IConfiguration configuration)
Внедряет используемый IConfiguration
.
Параметры | |
---|---|
configuration | IConfiguration |
УстановитьДата
public void setDate (Date date)
Параметры | |
---|---|
date | Date |
Броски | |
---|---|
DeviceNotAvailableException |
setDeviceOwner
public boolean setDeviceOwner (String componentName, int userId)
Параметры | |
---|---|
componentName | String |
userId | int |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
setDeviceState
public void setDeviceState (TestDeviceState deviceState)
Параметры | |
---|---|
deviceState | TestDeviceState |
setEmulatorOutputStream
public void setEmulatorOutputStream (SizeLimitedOutputStream output)
Для эмулятора установите SizeLimitedOutputStream
для регистрации вывода
Параметры | |
---|---|
output | SizeLimitedOutputStream : для регистрации вывода |
setEmulatorProcess
public void setEmulatorProcess (Process p)
Параметры | |
---|---|
p | Process |
установить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 |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
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)
Параметры | |
---|---|
userId | int |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
startUser
public boolean startUser (int userId, boolean waitFlag)
Параметры | |
---|---|
userId | int |
waitFlag | boolean |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
остановитьEmulatorOutput
public void stopEmulatorOutput ()
стопLogcat
public void stopLogcat ()
стоппользователь
public boolean stopUser (int userId)
Параметры | |
---|---|
userId | int |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
стоппользователь
public boolean stopUser (int userId, boolean waitFlag, boolean forceFlag)
Параметры | |
---|---|
userId | int |
waitFlag | boolean |
forceFlag | boolean |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
переключательToAdbTcp
public String switchToAdbTcp ()
Возврат | |
---|---|
String |
Броски | |
---|---|
DeviceNotAvailableException |
переключательToAdbUsb
public boolean switchToAdbUsb ()
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
переключательПользователь
public boolean switchUser (int userId)
Параметры | |
---|---|
userId | int |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
переключательПользователь
public boolean switchUser (int userId, long timeout)
Параметры | |
---|---|
userId | int |
timeout | long |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
синхронизировать файлы
public boolean syncFiles (File localFileDir, String deviceFilePath)
Параметры | |
---|---|
localFileDir | File |
deviceFilePath | String |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
взятьBugreport
public Bugreport takeBugreport ()
Возврат | |
---|---|
Bugreport |
unencryptDevice
public boolean unencryptDevice ()
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
удалить пакет
public String uninstallPackage (String packageName)
Параметры | |
---|---|
packageName | String |
Возврат | |
---|---|
String |
Броски | |
---|---|
DeviceNotAvailableException |
деинсталлироватьПакажефорюсер
public String uninstallPackageForUser (String packageName, int userId)
Параметры | |
---|---|
packageName | String |
userId | int |
Возврат | |
---|---|
String |
Броски | |
---|---|
DeviceNotAvailableException |
разблокировать устройство
public boolean unlockDevice ()
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
ждатьForBootComplete
public boolean waitForBootComplete (long timeOut)
Параметры | |
---|---|
timeOut | long |
Возврат | |
---|---|
boolean |
Броски | |
---|---|
DeviceNotAvailableException |
waitForDeviceAvailable
public void waitForDeviceAvailable ()
Броски | |
---|---|
DeviceNotAvailableException |
waitForDeviceAvailable
public void waitForDeviceAvailable (long waitTime)
Параметры | |
---|---|
waitTime | long |
Броски | |
---|---|
DeviceNotAvailableException |
waitForDeviceInRecovery
public boolean waitForDeviceInRecovery (long waitTime)
Параметры | |
---|---|
waitTime | long |
Возврат | |
---|---|
boolean |
waitForDeviceInSideload
public boolean waitForDeviceInSideload (long waitTime)
Параметры | |
---|---|
waitTime | long |
Возврат | |
---|---|
boolean |
waitForDeviceNotAvailable
public boolean waitForDeviceNotAvailable (long waitTime)
Параметры | |
---|---|
waitTime | long |
Возврат | |
---|---|
boolean |
ждатьForDeviceOnline
public void waitForDeviceOnline ()
Броски | |
---|---|
DeviceNotAvailableException |
ждатьForDeviceOnline
public void waitForDeviceOnline (long waitTime)
Параметры | |
---|---|
waitTime | long |
Броски | |
---|---|
DeviceNotAvailableException |
waitForDeviceShell
public boolean waitForDeviceShell (long waitTime)
Параметры | |
---|---|
waitTime | long |
Возврат | |
---|---|
boolean |
Защищенные методы
проверитьApiLevelAgainst
protected void checkApiLevelAgainst (String feature, int strictMinLevel)
Параметры | |
---|---|
feature | String |
strictMinLevel | int |
createRebootDeviceAction
protected NativeDevice.RebootDeviceAction createRebootDeviceAction (NativeDevice.RebootMode rebootMode, String reason)
Создайте RebootDeviceAction
, который будет использоваться при выполнении действия перезагрузки.
Параметры | |
---|---|
rebootMode | NativeDevice.RebootMode : режим этой перезагрузки. |
reason | String : для этой перезагрузки. |
Возврат | |
---|---|
NativeDevice.RebootDeviceAction | созданное RebootDeviceAction . |
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)
.
Возврат | |
---|---|
File |
getRunUtil
protected IRunUtil getRunUtil ()
Получите экземпляр RunUtil
для использования.
Возврат | |
---|---|
IRunUtil |
внутренний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 |
Возврат | |
---|---|
boolean |
выполнитьDeviceAction
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 для использования.
Параметры | |
---|---|
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 и ее аффилированных лиц.
Последнее обновление: 2025-03-26 UTC.