Classes aninhadas |
---|
class | NativeDevice.AdbAction Uma DeviceAction para executar um comando 'adb ....' do sistema operacional. |
class | NativeDevice.AdbShellAction |
class | NativeDevice.RebootDeviceAction DeviceAction para reiniciar um dispositivo. |
enum | NativeDevice.RebootMode Um modo de reinicialização. |
Métodos públicos |
---|
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 () O log que contém todos os logs 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) Ajudante não oficial para obter um FileEntry de um caminho não raiz. |
| 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) Processe o DeviceEvent, que pode ou não fazer a transição deste dispositivo para um novo estado de alocação. |
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 () Substitua se o dispositivo precisar que algumas ações específicas sejam executadas após o adb root e antes de o dispositivo ficar on-line novamente. |
void | postAdbUnrootAction () Substitua se o dispositivo precisar que algumas ações específicas sejam executadas após o adb desenraizar e antes que o dispositivo esteja online novamente. |
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 () Tentativas de recuperar a comunicação do dispositivo. |
void | remountSystemWritable () |
void | remountVendorWritable () |
boolean | removeAdmin (String componentName, int userId) |
void | removeOwners () |
boolean | removeUser (int userId) |
void | resetContentProviderSetup () Redefina o sinalizador de configuração do provedor de conteúdo para acioná-lo novamente. |
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) Injeta o IConfiguration em uso. |
void | setDate (Date date) |
boolean | setDeviceOwner (String componentName, int userId) |
void | setDeviceState (TestDeviceState deviceState) |
void | setEmulatorOutputStream ( SizeLimitedOutputStream output) Para o emulador, defina SizeLimitedOutputStream para registrar a saída |
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) |
Métodos protegidos |
---|
void | checkApiLevelAgainst (String feature, int strictMinLevel) |
NativeDevice.RebootDeviceAction | createRebootDeviceAction ( NativeDevice.RebootMode rebootMode, String reason) Crie um RebootDeviceAction para ser usado ao executar uma ação de reinicialização. |
void | doAdbReboot ( NativeDevice.RebootMode rebootMode, String reason) Execute uma reinicialização do adb. |
void | ensureRuntimePermissionSupported () método auxiliar para lançar exceção se a permissão de tempo de execução não for suportada |
InputStreamSource | getBugreportInternal () |
File | getBugreportzInternal () Método auxiliar interno para obter o arquivo zip bugreportz como um ERROR(/File) . |
IRunUtil | getRunUtil () Obtenha a instância RunUtil para usar. |
String | internalGetProperty (String propName, String fastbootVar, String description) Busque uma propriedade de dispositivo, do cache ddmlib por padrão, e volte para `adb shell getprop` ou `fastboot getvar` dependendo se o dispositivo está em Fastboot ou não. |
boolean | isNewer (File localFile, IFileEntry entry) Retorne true se o arquivo local for mais recente que o arquivo remoto. |
boolean | performDeviceAction (String actionDescription, com.android.tradefed.device.NativeDevice.DeviceAction action, int retryAttempts) Executa uma ação neste dispositivo. |
void | postAdbReboot () Possíveis ações extras que podem ser executadas após uma reinicialização. |
void | prePostBootSetup () Permite que cada tipo de dispositivo (AndroidNativeDevice, TestDevice) substitua esse método para configuração específica pós-inicialização. |
void | setClock (Clock clock) Defina a instância de Clock a ser usada. |
void | setLogStartDelay (int delay) Define o tempo em ms de espera antes de iniciar a captura do logcat para um dispositivo online. |
void | waitForDeviceNotAvailable (String operationDesc, long time) |
Constantes
INVALID_USER_ID
public static final int INVALID_USER_ID
Valor retornado para qualquer ID de usuário inválido/não encontrado: UserHandle definiu o valor -10000
Valor Constante: -10000 (0xffffd8f0)
MAX_HOST_DEVICE_TIME_OFFSET
protected static final long MAX_HOST_DEVICE_TIME_OFFSET
Valor Constante: 5000 (0x000000000001388)
MAX_RETRY_ATTEMPTS
protected static final int MAX_RETRY_ATTEMPTS
o número padrão de tentativas de repetição de comando para executar
Valor Constante: 2 (0x00000002)
Campos
CARTÃO SD
protected static final String SD_CARD
ARMAZENAMENTO_EMULADO
protected static final String STORAGE_EMULATED
mOpções
protected TestDeviceOptions mOptions
mStateMonitor
protected final IDeviceStateMonitor mStateMonitor
Construtores públicos
Dispositivo nativo
public NativeDevice (IDevice device,
IDeviceStateMonitor stateMonitor,
IDeviceMonitor allocationMonitor)
Cria um TestDevice
.
Parâmetros |
---|
device | IDevice : o IDevice associado |
stateMonitor | IDeviceStateMonitor : o mecanismo IDeviceStateMonitor a ser usado |
allocationMonitor | IDeviceMonitor : o IDeviceMonitor para informar sobre alterações de estado de alocação. Pode ser nulo |
Métodos públicos
checkApiLevelAgainstNextRelease
public boolean checkApiLevelAgainstNextRelease (int strictMinLevel)
Parâmetros |
---|
strictMinLevel | int |
Lança |
---|
DeviceNotAvailableException | |
verificar conectividade
public boolean checkConnectivity ()
Lança |
---|
DeviceNotAvailableException | |
clearErrorDialogs
public boolean clearErrorDialogs ()
Lança |
---|
DeviceNotAvailableException | |
limparLastConnectedWifiNetwork
public void clearLastConnectedWifiNetwork ()
limparLogcat
public void clearLogcat ()
conectarToWifiNetwork
public boolean connectToWifiNetwork (String wifiSsid,
String wifiPsk)
Parâmetros |
---|
wifiSsid | String |
wifiPsk | String |
Lança |
---|
DeviceNotAvailableException | |
conectarToWifiNetwork
public boolean connectToWifiNetwork (String wifiSsid,
String wifiPsk,
boolean scanSsid)
Parâmetros |
---|
wifiSsid | String |
wifiPsk | String |
scanSsid | boolean |
Lança |
---|
DeviceNotAvailableException | |
connectToWifiNetworkIfNeeded
public boolean connectToWifiNetworkIfNeeded (String wifiSsid,
String wifiPsk,
boolean scanSsid)
Parâmetros |
---|
wifiSsid | String |
wifiPsk | String |
scanSsid | boolean |
Lança |
---|
DeviceNotAvailableException | |
connectToWifiNetworkIfNeeded
public boolean connectToWifiNetworkIfNeeded (String wifiSsid,
String wifiPsk)
Parâmetros |
---|
wifiSsid | String |
wifiPsk | String |
Lança |
---|
DeviceNotAvailableException | |
criarUsuário
public int createUser (String name,
boolean guest,
boolean ephemeral)
Parâmetros |
---|
name | String |
guest | boolean |
ephemeral | boolean |
Lança |
---|
DeviceNotAvailableException | |
criarUsuário
public int createUser (String name)
Lança |
---|
DeviceNotAvailableException | |
createUserNoThrow
public int createUserNoThrow (String name)
Lança |
---|
DeviceNotAvailableException | |
excluir arquivo
public void deleteFile (String deviceFilePath)
Parâmetros |
---|
deviceFilePath | String |
Lança |
---|
DeviceNotAvailableException | |
dispositivoSoftRestarted
public boolean deviceSoftRestarted (ProcessInfo prevSystemServerProcess)
Parâmetros |
---|
prevSystemServerProcess | ProcessInfo |
Lança |
---|
DeviceNotAvailableException | |
dispositivoSoftRestartedSince
public boolean deviceSoftRestartedSince (long utcEpochTime,
TimeUnit timeUnit)
Parâmetros |
---|
utcEpochTime | long |
timeUnit | TimeUnit |
Lança |
---|
DeviceNotAvailableException | |
desativarAdbRoot
public boolean disableAdbRoot ()
Lança |
---|
DeviceNotAvailableException | |
desabilitarKeyguard
public void disableKeyguard ()
Lança |
---|
DeviceNotAvailableException | |
desativarNetworkMonitor
public boolean disableNetworkMonitor ()
Lança |
---|
DeviceNotAvailableException | |
desconectarFromWifi
public boolean disconnectFromWifi ()
Lança |
---|
DeviceNotAvailableException | |
fazFileExist
public boolean doesFileExist (String deviceFilePath)
Parâmetros |
---|
deviceFilePath | String |
Lança |
---|
DeviceNotAvailableException | |
dumpHeap
public File dumpHeap (String process,
String devicePath)
Parâmetros |
---|
process | String |
devicePath | String |
Lança |
---|
DeviceNotAvailableException | |
ativarAdbRoot
public boolean enableAdbRoot ()
Lança |
---|
DeviceNotAvailableException | |
habilitarNetworkMonitor
public boolean enableNetworkMonitor ()
Lança |
---|
DeviceNotAvailableException | |
criptografar dispositivo
public boolean encryptDevice (boolean inplace)
Parâmetros |
---|
inplace | boolean |
Lança |
---|
DeviceNotAvailableException | |
executeAdbCommand
public String executeAdbCommand (long timeout,
String... cmdArgs)
Parâmetros |
---|
timeout | long |
cmdArgs | String |
Lança |
---|
DeviceNotAvailableException | |
executeAdbCommand
public String executeAdbCommand (String... cmdArgs)
Parâmetros |
---|
cmdArgs | String |
Lança |
---|
DeviceNotAvailableException | |
executeFastbootCommand
public CommandResult executeFastbootCommand (String... cmdArgs)
Parâmetros |
---|
cmdArgs | String |
Lança |
---|
DeviceNotAvailableException | |
executeFastbootCommand
public CommandResult executeFastbootCommand (long timeout,
String... cmdArgs)
Parâmetros |
---|
timeout | long |
cmdArgs | String |
Lança |
---|
DeviceNotAvailableException | |
executeLongFastbootCommand
public CommandResult executeLongFastbootCommand (String... cmdArgs)
Parâmetros |
---|
cmdArgs | String |
Lança |
---|
DeviceNotAvailableException | |
executeShellCommand
public String executeShellCommand (String command)
Parâmetros |
---|
command | String |
Lança |
---|
DeviceNotAvailableException | |
executeShellCommand
public void executeShellCommand (String command,
IShellOutputReceiver receiver,
long maxTimeToOutputShellResponse,
TimeUnit timeUnit,
int retryAttempts)
Parâmetros |
---|
command | String |
receiver | IShellOutputReceiver |
maxTimeToOutputShellResponse | long |
timeUnit | TimeUnit |
retryAttempts | int |
Lança |
---|
DeviceNotAvailableException | |
executeShellCommand
public void executeShellCommand (String command,
IShellOutputReceiver receiver,
long maxTimeoutForCommand,
long maxTimeToOutputShellResponse,
TimeUnit timeUnit,
int retryAttempts)
Parâmetros |
---|
command | String |
receiver | IShellOutputReceiver |
maxTimeoutForCommand | long |
maxTimeToOutputShellResponse | long |
timeUnit | TimeUnit |
retryAttempts | int |
Lança |
---|
DeviceNotAvailableException | |
executeShellCommand
public void executeShellCommand (String command,
IShellOutputReceiver receiver)
Parâmetros |
---|
command | String |
receiver | IShellOutputReceiver |
Lança |
---|
DeviceNotAvailableException | |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd)
Lança |
---|
DeviceNotAvailableException | |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd,
OutputStream pipeToOutput)
Parâmetros |
---|
cmd | String |
pipeToOutput | OutputStream |
Lança |
---|
DeviceNotAvailableException | |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd,
File pipeAsInput)
Parâmetros |
---|
cmd | String |
pipeAsInput | File |
Lança |
---|
DeviceNotAvailableException | |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd,
long maxTimeoutForCommand,
TimeUnit timeUnit,
int retryAttempts)
Parâmetros |
---|
cmd | String |
maxTimeoutForCommand | long |
timeUnit | TimeUnit |
retryAttempts | int |
Lança |
---|
DeviceNotAvailableException | |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd,
long maxTimeoutForCommand,
TimeUnit timeUnit)
Parâmetros |
---|
cmd | String |
maxTimeoutForCommand | long |
timeUnit | TimeUnit |
Lança |
---|
DeviceNotAvailableException | |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd,
File pipeAsInput,
OutputStream pipeToOutput,
long maxTimeoutForCommand,
TimeUnit timeUnit,
int retryAttempts)
Parâmetros |
---|
cmd | String |
pipeAsInput | File |
pipeToOutput | OutputStream |
maxTimeoutForCommand | long |
timeUnit | TimeUnit |
retryAttempts | int |
Lança |
---|
DeviceNotAvailableException | |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd,
File pipeAsInput,
OutputStream pipeToOutput,
OutputStream pipeToError,
long maxTimeoutForCommand,
TimeUnit timeUnit,
int retryAttempts)
Parâmetros |
---|
cmd | String |
pipeAsInput | File |
pipeToOutput | OutputStream |
pipeToError | OutputStream |
maxTimeoutForCommand | long |
timeUnit | TimeUnit |
retryAttempts | int |
Lança |
---|
DeviceNotAvailableException | |
fastbootWipePartition
public CommandResult fastbootWipePartition (String partition)
Parâmetros |
---|
partition | String |
Lança |
---|
DeviceNotAvailableException | |
getActiveApexes
public getActiveApexes ()
Lança |
---|
DeviceNotAvailableException | |
getAllSettings
public getAllSettings (String namespace)
Parâmetros |
---|
namespace | String |
Lança |
---|
DeviceNotAvailableException | |
getAllocationState
public DeviceAllocationState getAllocationState ()
Devoluções |
---|
DeviceAllocationState | |
obterAndroidId
public String getAndroidId (int userId)
Lança |
---|
DeviceNotAvailableException | |
obterAndroidIds
public getAndroidIds ()
Lança |
---|
DeviceNotAvailableException | |
getApiLevel
public int getApiLevel ()
Lança |
---|
DeviceNotAvailableException | |
getAppPackageInfo
public PackageInfo getAppPackageInfo (String packageName)
Parâmetros |
---|
packageName | String |
Lança |
---|
DeviceNotAvailableException | |
getAppPackageInfos
public getAppPackageInfos ()
Lança |
---|
DeviceNotAvailableException | |
getBasebandVersion
public String getBasebandVersion ()
Lança |
---|
DeviceNotAvailableException | |
obter bateria
public Integer getBattery ()
getBooleanProperty
public boolean getBooleanProperty (String name,
boolean defaultValue)
Parâmetros |
---|
name | String |
defaultValue | boolean |
Lança |
---|
DeviceNotAvailableException | |
getBootHistory
public getBootHistory ()
Lança |
---|
DeviceNotAvailableException | |
getBootHistorySince
public getBootHistorySince (long utcEpochTime,
TimeUnit timeUnit)
Parâmetros |
---|
utcEpochTime | long |
timeUnit | TimeUnit |
Lança |
---|
DeviceNotAvailableException | |
getBootloaderVersion
public String getBootloaderVersion ()
Lança |
---|
DeviceNotAvailableException | |
getBugreport
public InputStreamSource getBugreport ()
Devoluções |
---|
InputStreamSource | |
getBugreportz
public InputStreamSource getBugreportz ()
Devoluções |
---|
InputStreamSource | |
getBuildAlias
public String getBuildAlias ()
Lança |
---|
DeviceNotAvailableException | |
getBuildFlavor
public String getBuildFlavor ()
Lança |
---|
DeviceNotAvailableException | |
getBuildId
public String getBuildId ()
Lança |
---|
DeviceNotAvailableException | |
getBuildSigningKeys
public String getBuildSigningKeys ()
Lança |
---|
DeviceNotAvailableException | |
getCachedDeviceDescriptor
public DeviceDescriptor getCachedDeviceDescriptor ()
Devoluções |
---|
DeviceDescriptor | |
obterCrianças
public String[] getChildren (String path)
Lança |
---|
DeviceNotAvailableException | |
getCurrentFoldableState
public DeviceFoldableState getCurrentFoldableState ()
Devoluções |
---|
DeviceFoldableState | |
Lança |
---|
DeviceNotAvailableException | |
getCurrentUser
public int getCurrentUser ()
Lança |
---|
DeviceNotAvailableException | |
getDeviceClass
public String getDeviceClass ()
getDeviceDate
public long getDeviceDate ()
Lança |
---|
DeviceNotAvailableException | |
getDeviceDescriptor
public DeviceDescriptor getDeviceDescriptor ()
Devoluções |
---|
DeviceDescriptor | |
getDeviceState
public TestDeviceState getDeviceState ()
Devoluções |
---|
TestDeviceState | |
getDeviceTimeOffset
public long getDeviceTimeOffset (Date date)
Lança |
---|
DeviceNotAvailableException | |
getEmulatorOutput
public InputStreamSource getEmulatorOutput ()
Devoluções |
---|
InputStreamSource | |
getEmulatorProcess
public Process getEmulatorProcess ()
getExternalStoreFreeSpace
public long getExternalStoreFreeSpace ()
Lança |
---|
DeviceNotAvailableException | |
getFastbootPath
public String getFastbootPath ()
getFastbootProductType
public String getFastbootProductType ()
Lança |
---|
DeviceNotAvailableException | |
getFastbootProductVariant
public String getFastbootProductVariant ()
Lança |
---|
DeviceNotAvailableException | |
getFastbootSerialNumber
public String getFastbootSerialNumber ()
getFastbootVariável
public String getFastbootVariable (String variableName)
Parâmetros |
---|
variableName | String |
Lança |
---|
DeviceNotAvailableException | |
getFastbootVersion
public String getFastbootVersion ()
getFileEntry
public IFileEntry getFileEntry (String path)
Lança |
---|
DeviceNotAvailableException | |
getFileEntry
public IFileEntry getFileEntry (FileListingService.FileEntry entry)
Ajudante não oficial para obter um FileEntry
de um caminho não raiz. FIXME: Refatore o sistema FileEntry para disponibilizá-lo em qualquer caminho. (mesmo não root).
Parâmetros |
---|
entry | FileListingService.FileEntry : um FileEntry não necessariamente root conforme exigido pelo Ddmlib. |
Lança |
---|
DeviceNotAvailableException | |
getFoldableStates
public getFoldableStates ()
Lança |
---|
DeviceNotAvailableException | |
getIDevice
public IDevice getIDevice ()
getInstalledPackageNames
public getInstalledPackageNames ()
Lança |
---|
DeviceNotAvailableException | |
getIntProperty
public long getIntProperty (String name,
long defaultValue)
Parâmetros |
---|
name | String |
defaultValue | long |
Lança |
---|
DeviceNotAvailableException | |
getIpAddress
public String getIpAddress ()
Lança |
---|
DeviceNotAvailableException | |
getKeyguardState
public KeyguardControllerState getKeyguardState ()
Devoluções |
---|
KeyguardControllerState | |
Lança |
---|
DeviceNotAvailableException | |
getLastExpectedRebootTimeMillis
public long getLastExpectedRebootTimeMillis ()
getLaunchApiLevel
public int getLaunchApiLevel ()
Lança |
---|
DeviceNotAvailableException | |
getLogcat
public InputStreamSource getLogcat ()
Devoluções |
---|
InputStreamSource | |
getLogcat
public InputStreamSource getLogcat (int maxBytes)
Devoluções |
---|
InputStreamSource | |
getLogcatDump
public InputStreamSource getLogcatDump ()
Devoluções |
---|
InputStreamSource | |
getLogcatSince
public InputStreamSource getLogcatSince (long date)
Devoluções |
---|
InputStreamSource | |
getMacAddress
public String getMacAddress ()
getMainlineModuleInfo
public getMainlineModuleInfo ()
Lança |
---|
DeviceNotAvailableException | |
public int getMaxNumberOfRunningUsersSupported ()
Lança |
---|
DeviceNotAvailableException | |
public int getMaxNumberOfUsersSupported ()
Lança |
---|
DeviceNotAvailableException | |
getMonitor
public IDeviceStateMonitor getMonitor ()
Devoluções |
---|
IDeviceStateMonitor | |
obterMountPoint
public String getMountPoint (String mountName)
Parâmetros |
---|
mountName | String |
getMountPointInfo
public ITestDevice.MountPointInfo getMountPointInfo (String mountpoint)
Parâmetros |
---|
mountpoint | String |
Devoluções |
---|
ITestDevice.MountPointInfo | |
Lança |
---|
DeviceNotAvailableException | |
getMountPointInfo
public getMountPointInfo ()
Lança |
---|
DeviceNotAvailableException | |
getOpções
public TestDeviceOptions getOptions ()
Devoluções |
---|
TestDeviceOptions | |
getPartitionFreeSpace
public long getPartitionFreeSpace (String partition)
Parâmetros |
---|
partition | String |
Lança |
---|
DeviceNotAvailableException | |
getPrimaryUserId
public Integer getPrimaryUserId ()
Lança |
---|
DeviceNotAvailableException | |
getProcessByName
public ProcessInfo getProcessByName (String processName)
Parâmetros |
---|
processName | String |
Lança |
---|
DeviceNotAvailableException | |
getProcessPid
public String getProcessPid (String process)
Parâmetros |
---|
process | String |
Lança |
---|
DeviceNotAvailableException | |
getProductType
public String getProductType ()
Lança |
---|
DeviceNotAvailableException | |
getProductVariant
public String getProductVariant ()
Lança |
---|
DeviceNotAvailableException | |
obterPropriedade
public String getProperty (String name)
Lança |
---|
DeviceNotAvailableException | |
getRecoveryMode
public ITestDevice.RecoveryMode getRecoveryMode ()
Devoluções |
---|
ITestDevice.RecoveryMode | |
obter captura de tela
public InputStreamSource getScreenshot (String format)
Devoluções |
---|
InputStreamSource | |
Lança |
---|
DeviceNotAvailableException | |
obter captura de tela
public InputStreamSource getScreenshot (long displayId)
Parâmetros |
---|
displayId | long |
Devoluções |
---|
InputStreamSource | |
Lança |
---|
DeviceNotAvailableException | |
obter captura de tela
public InputStreamSource getScreenshot (String format,
boolean rescale)
Parâmetros |
---|
format | String |
rescale | boolean |
Devoluções |
---|
InputStreamSource | |
Lança |
---|
DeviceNotAvailableException | |
obter captura de tela
public InputStreamSource getScreenshot ()
Devoluções |
---|
InputStreamSource | |
Lança |
---|
DeviceNotAvailableException | |
obter número de série
public String getSerialNumber ()
getSetting
public String getSetting (int userId,
String namespace,
String key)
Parâmetros |
---|
userId | int |
namespace | String |
key | String |
Lança |
---|
DeviceNotAvailableException | |
getSetting
public String getSetting (String namespace,
String key)
Parâmetros |
---|
namespace | String |
key | String |
Lança |
---|
DeviceNotAvailableException | |
getSimOperator
public String getSimOperator ()
getSimState
public String getSimState ()
obterTombstones
public getTombstones ()
Lança |
---|
DeviceNotAvailableException | |
getTotalMemory
public long getTotalMemory ()
getUninstallablePackageNames
public getUninstallablePackageNames ()
Lança |
---|
DeviceNotAvailableException | |
getUseFastbootErase
public boolean getUseFastbootErase ()
getUserFlags
public int getUserFlags (int userId)
Lança |
---|
DeviceNotAvailableException | |
getUserInfos
public getUserInfos ()
Lança |
---|
DeviceNotAvailableException | |
getUserSerialNumber
public int getUserSerialNumber (int userId)
Lança |
---|
DeviceNotAvailableException | |
handleAllocationEvent
public IManagedTestDevice.DeviceEventResponse handleAllocationEvent (DeviceEvent event)
Processe o DeviceEvent, que pode ou não fazer a transição deste dispositivo para um novo estado de alocação.
Parâmetros |
---|
event | DeviceEvent |
Devoluções |
---|
IManagedTestDevice.DeviceEventResponse | |
temRecurso
public boolean hasFeature (String feature)
Parâmetros |
---|
feature | String |
Lança |
---|
DeviceNotAvailableException | |
instalarPacote
public String installPackage (File packageFile,
boolean reinstall,
String... extraArgs)
Parâmetros |
---|
packageFile | File |
reinstall | boolean |
extraArgs | String |
Lança |
---|
DeviceNotAvailableException | |
instalarPacote
public String installPackage (File packageFile,
boolean reinstall,
boolean grantPermissions,
String... extraArgs)
Parâmetros |
---|
packageFile | File |
reinstall | boolean |
grantPermissions | boolean |
extraArgs | String |
Lança |
---|
DeviceNotAvailableException | |
instalarPackageForUser
public String installPackageForUser (File packageFile,
boolean reinstall,
int userId,
String... extraArgs)
Parâmetros |
---|
packageFile | File |
reinstall | boolean |
userId | int |
extraArgs | String |
Lança |
---|
DeviceNotAvailableException | |
instalarPackageForUser
public String installPackageForUser (File packageFile,
boolean reinstall,
boolean grantPermissions,
int userId,
String... extraArgs)
Parâmetros |
---|
packageFile | File |
reinstall | boolean |
grantPermissions | boolean |
userId | int |
extraArgs | String |
Lança |
---|
DeviceNotAvailableException | |
isAdbRoot
public boolean isAdbRoot ()
Lança |
---|
DeviceNotAvailableException | |
isAdbTcp
public boolean isAdbTcp ()
isAppEnumerationSupported
public boolean isAppEnumerationSupported ()
Lança |
---|
DeviceNotAvailableException | |
isDeviceEncrypted
public boolean isDeviceEncrypted ()
Lança |
---|
DeviceNotAvailableException | |
éDiretório
public boolean isDirectory (String path)
Lança |
---|
DeviceNotAvailableException | |
isEnableAdbRoot
public boolean isEnableAdbRoot ()
Devoluções |
---|
boolean | true se o adb root deve estar habilitado no dispositivo |
isEncryptionSupported
public boolean isEncryptionSupported ()
Lança |
---|
DeviceNotAvailableException | |
éExecutável
public boolean isExecutable (String fullPath)
Parâmetros |
---|
fullPath | String |
Lança |
---|
DeviceNotAvailableException | |
isFastbootEnabled
public boolean isFastbootEnabled ()
é sem cabeça
public boolean isHeadless ()
Lança |
---|
DeviceNotAvailableException | |
isMultiUserSupportado
public boolean isMultiUserSupported ()
Lança |
---|
DeviceNotAvailableException | |
isPackageInstalled
public boolean isPackageInstalled (String packageName,
String userId)
Parâmetros |
---|
packageName | String |
userId | String |
Lança |
---|
DeviceNotAvailableException | |
isPackageInstalled
public boolean isPackageInstalled (String packageName)
Parâmetros |
---|
packageName | String |
Lança |
---|
DeviceNotAvailableException | |
isRuntimePermissionSupported
public boolean isRuntimePermissionSupported ()
Lança |
---|
DeviceNotAvailableException | |
isStateBootloaderOrFastbootd
public boolean isStateBootloaderOrFastbootd ()
isUserRunning
public boolean isUserRunning (int userId)
Lança |
---|
DeviceNotAvailableException | |
isUserSecondary
public boolean isUserSecondary (int userId)
Lança |
---|
DeviceNotAvailableException | |
isWifiEnabled
public boolean isWifiEnabled ()
Lança |
---|
DeviceNotAvailableException | |
listaDisplayIds
public listDisplayIds ()
Lança |
---|
DeviceNotAvailableException | |
listaUsuários
public listUsers ()
Lança |
---|
DeviceNotAvailableException | |
logBugreport
public boolean logBugreport (String dataName,
ITestLogger listener)
Parâmetros |
---|
dataName | String |
listener | ITestLogger |
logOnDevice
public void logOnDevice (String tag,
Log.LogLevel level,
String format,
Object... args)
Parâmetros |
---|
tag | String |
level | Log.LogLevel |
format | String |
args | Object |
NonBlockingReboot
public void nonBlockingReboot ()
Lança |
---|
DeviceNotAvailableException | |
postAdbRootAction
public void postAdbRootAction ()
Substitua se o dispositivo precisar que algumas ações específicas sejam executadas após o adb root e antes de o dispositivo ficar on-line novamente. A implementação padrão não inclui ações adicionais. Não há garantia de que adb root esteja habilitado neste estágio.
Lança |
---|
DeviceNotAvailableException | |
postAdbUnrootAction
public void postAdbUnrootAction ()
Substitua se o dispositivo precisar que algumas ações específicas sejam executadas após o adb desenraizar e antes que o dispositivo esteja online novamente. A implementação padrão não inclui ações adicionais. Não há garantia de que adb root esteja desabilitado neste estágio.
Lança |
---|
DeviceNotAvailableException | |
postBootSetup
public void postBootSetup ()
Lança |
---|
DeviceNotAvailableException | |
postInvocationTearDown
public void postInvocationTearDown (Throwable exception)
Parâmetros |
---|
exception | Throwable |
preInvocationSetup
public void preInvocationSetup (IBuildInfo info,
MultiMap<String, String> attributes)
Parâmetros |
---|
info | IBuildInfo |
attributes | MultiMap |
Lança |
---|
DeviceNotAvailableException | |
TargetSetupError | |
pullDir
public boolean pullDir (String deviceFilePath,
File localDir)
Parâmetros |
---|
deviceFilePath | String |
localDir | File |
Lança |
---|
DeviceNotAvailableException | |
pullFile
public boolean pullFile (String remoteFilePath,
File localFile)
Parâmetros |
---|
remoteFilePath | String |
localFile | File |
Lança |
---|
DeviceNotAvailableException | |
pullFile
public File pullFile (String remoteFilePath)
Parâmetros |
---|
remoteFilePath | String |
Lança |
---|
DeviceNotAvailableException | |
pullFileContents
public String pullFileContents (String remoteFilePath)
Parâmetros |
---|
remoteFilePath | String |
Lança |
---|
DeviceNotAvailableException | |
pullFileFromExternal
public File pullFileFromExternal (String remoteFilePath)
Parâmetros |
---|
remoteFilePath | String |
Lança |
---|
DeviceNotAvailableException | |
pushDir
public boolean pushDir (File localFileDir,
String deviceFilePath,
excludedDirectories)
Parâmetros |
---|
localFileDir | File |
deviceFilePath | String |
excludedDirectories | |
Lança |
---|
DeviceNotAvailableException | |
pushDir
public boolean pushDir (File localFileDir,
String deviceFilePath)
Parâmetros |
---|
localFileDir | File |
deviceFilePath | String |
Lança |
---|
DeviceNotAvailableException | |
arquivo push
public boolean pushFile (File localFile,
String remoteFilePath)
Parâmetros |
---|
localFile | File |
remoteFilePath | String |
Lança |
---|
DeviceNotAvailableException | |
pushString
public boolean pushString (String contents,
String remoteFilePath)
Parâmetros |
---|
contents | String |
remoteFilePath | String |
Lança |
---|
DeviceNotAvailableException | |
reinício
public void reboot (String reason)
Lança |
---|
DeviceNotAvailableException | |
reinício
public void reboot ()
Lança |
---|
DeviceNotAvailableException | |
reiniciarIntoBootloader
public void rebootIntoBootloader ()
Lança |
---|
DeviceNotAvailableException | |
reiniciarIntoFastbootd
public void rebootIntoFastbootd ()
Lança |
---|
DeviceNotAvailableException | |
reiniciarIntoRecovery
public void rebootIntoRecovery ()
Lança |
---|
DeviceNotAvailableException | |
reiniciarIntoSideload
public void rebootIntoSideload ()
Lança |
---|
DeviceNotAvailableException | |
reiniciarIntoSideload
public void rebootIntoSideload (boolean autoReboot)
Parâmetros |
---|
autoReboot | boolean |
Lança |
---|
DeviceNotAvailableException | |
reiniciarUntilOnline
public void rebootUntilOnline ()
Lança |
---|
DeviceNotAvailableException | |
reiniciarUntilOnline
public void rebootUntilOnline (String reason)
Lança |
---|
DeviceNotAvailableException | |
reiniciarUserspace
public void rebootUserspace ()
Lança |
---|
DeviceNotAvailableException | |
reiniciarUserspaceUntilOnline
public void rebootUserspaceUntilOnline ()
Lança |
---|
DeviceNotAvailableException | |
recuperar dispositivo
public void recoverDevice ()
Tentativas de recuperar a comunicação do dispositivo.
Lança |
---|
DeviceNotAvailableException | se o dispositivo não estiver mais disponível |
remontarSystemWritable
public void remountSystemWritable ()
Lança |
---|
DeviceNotAvailableException | |
remontarVendorWritable
public void remountVendorWritable ()
Lança |
---|
DeviceNotAvailableException | |
removerAdmin
public boolean removeAdmin (String componentName,
int userId)
Parâmetros |
---|
componentName | String |
userId | int |
Lança |
---|
DeviceNotAvailableException | |
removerProprietários
public void removeOwners ()
Lança |
---|
DeviceNotAvailableException | |
removerUsuário
public boolean removeUser (int userId)
Lança |
---|
DeviceNotAvailableException | |
resetContentProviderSetup
public void resetContentProviderSetup ()
Redefina o sinalizador de configuração do provedor de conteúdo para acioná-lo novamente.
executar testes de instrumentação
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner,
ITestLifeCycleReceiver... listeners)
Parâmetros |
---|
runner | IRemoteAndroidTestRunner |
listeners | ITestLifeCycleReceiver |
Lança |
---|
DeviceNotAvailableException | |
executar testes de instrumentação
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner,
listeners)
Parâmetros |
---|
runner | IRemoteAndroidTestRunner |
listeners | |
Lança |
---|
DeviceNotAvailableException | |
runInstrumentationTestsAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner,
int userId,
ITestLifeCycleReceiver... listeners)
Parâmetros |
---|
runner | IRemoteAndroidTestRunner |
userId | int |
listeners | ITestLifeCycleReceiver |
Lança |
---|
DeviceNotAvailableException | |
runInstrumentationTestsAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner,
int userId,
listeners)
Parâmetros |
---|
runner | IRemoteAndroidTestRunner |
userId | int |
listeners | |
Lança |
---|
DeviceNotAvailableException | |
setConfiguração
public void setConfiguration (IConfiguration configuration)
Injeta o IConfiguration
em uso.
Parâmetros |
---|
configuration | IConfiguration |
definirData
public void setDate (Date date)
Lança |
---|
DeviceNotAvailableException | |
setDeviceOwner
public boolean setDeviceOwner (String componentName,
int userId)
Parâmetros |
---|
componentName | String |
userId | int |
Lança |
---|
DeviceNotAvailableException | |
setDeviceState
public void setDeviceState (TestDeviceState deviceState)
Parâmetros |
---|
deviceState | TestDeviceState |
setEmulatorOutputStream
public void setEmulatorOutputStream (SizeLimitedOutputStream output)
Para o emulador, defina SizeLimitedOutputStream
para registrar a saída
Parâmetros |
---|
output | SizeLimitedOutputStream : para registrar a saída |
setEmulatorProcess
public void setEmulatorProcess (Process p)
setFastbootEnabled
public void setFastbootEnabled (boolean fastbootEnabled)
Parâmetros |
---|
fastbootEnabled | boolean |
definirFastbootPath
public void setFastbootPath (String fastbootPath)
Parâmetros |
---|
fastbootPath | String |
setIDevice
public void setIDevice (IDevice newDevice)
Parâmetros |
---|
newDevice | IDevice |
setOptions
public void setOptions (TestDeviceOptions options)
Parâmetros |
---|
options | TestDeviceOptions |
definirPropriedade
public boolean setProperty (String propKey,
String propValue)
Parâmetros |
---|
propKey | String |
propValue | String |
Lança |
---|
DeviceNotAvailableException | |
setRecovery
public void setRecovery (IDeviceRecovery recovery)
Parâmetros |
---|
recovery | IDeviceRecovery |
setRecoveryMode
public void setRecoveryMode (ITestDevice.RecoveryMode mode)
Parâmetros |
---|
mode | ITestDevice.RecoveryMode |
definirConfiguração
public void setSetting (String namespace,
String key,
String value)
Parâmetros |
---|
namespace | String |
key | String |
value | String |
Lança |
---|
DeviceNotAvailableException | |
definirConfiguração
public void setSetting (int userId,
String namespace,
String key,
String value)
Parâmetros |
---|
userId | int |
namespace | String |
key | String |
value | String |
Lança |
---|
DeviceNotAvailableException | |
setUseFastbootErase
public void setUseFastbootErase (boolean useFastbootErase)
Parâmetros |
---|
useFastbootErase | boolean |
iniciarLogcat
public void startLogcat ()
usuário inicial
public boolean startUser (int userId)
Lança |
---|
DeviceNotAvailableException | |
usuário inicial
public boolean startUser (int userId,
boolean waitFlag)
Parâmetros |
---|
userId | int |
waitFlag | boolean |
Lança |
---|
DeviceNotAvailableException | |
stopEmulatorOutput
public void stopEmulatorOutput ()
pararLogcat
public void stopLogcat ()
pararUsuário
public boolean stopUser (int userId)
Lança |
---|
DeviceNotAvailableException | |
pararUsuário
public boolean stopUser (int userId,
boolean waitFlag,
boolean forceFlag)
Parâmetros |
---|
userId | int |
waitFlag | boolean |
forceFlag | boolean |
Lança |
---|
DeviceNotAvailableException | |
switchToAdbTcp
public String switchToAdbTcp ()
Lança |
---|
DeviceNotAvailableException | |
switchToAdbUsb
public boolean switchToAdbUsb ()
Lança |
---|
DeviceNotAvailableException | |
mudar de utilizador
public boolean switchUser (int userId)
Lança |
---|
DeviceNotAvailableException | |
mudar de utilizador
public boolean switchUser (int userId,
long timeout)
Parâmetros |
---|
userId | int |
timeout | long |
Lança |
---|
DeviceNotAvailableException | |
arquivos de sincronização
public boolean syncFiles (File localFileDir,
String deviceFilePath)
Parâmetros |
---|
localFileDir | File |
deviceFilePath | String |
Lança |
---|
DeviceNotAvailableException | |
pegueBugreport
public Bugreport takeBugreport ()
desencriptar dispositivo
public boolean unencryptDevice ()
Lança |
---|
DeviceNotAvailableException | |
desinstalarPackage
public String uninstallPackage (String packageName)
Parâmetros |
---|
packageName | String |
Lança |
---|
DeviceNotAvailableException | |
desinstalarPackageForUser
public String uninstallPackageForUser (String packageName,
int userId)
Parâmetros |
---|
packageName | String |
userId | int |
Lança |
---|
DeviceNotAvailableException | |
desbloquear dispositivo
public boolean unlockDevice ()
Lança |
---|
DeviceNotAvailableException | |
waitForBootComplete
public boolean waitForBootComplete (long timeOut)
Lança |
---|
DeviceNotAvailableException | |
waitForDeviceAvailable
public void waitForDeviceAvailable ()
Lança |
---|
DeviceNotAvailableException | |
waitForDeviceAvailable
public void waitForDeviceAvailable (long waitTime)
Lança |
---|
DeviceNotAvailableException | |
waitForDeviceInRecovery
public boolean waitForDeviceInRecovery (long waitTime)
waitForDeviceInSideload
public boolean waitForDeviceInSideload (long waitTime)
waitForDeviceNotAvailable
public boolean waitForDeviceNotAvailable (long waitTime)
waitForDeviceOnline
public void waitForDeviceOnline ()
Lança |
---|
DeviceNotAvailableException | |
waitForDeviceOnline
public void waitForDeviceOnline (long waitTime)
Lança |
---|
DeviceNotAvailableException | |
espereForDeviceShell
public boolean waitForDeviceShell (long waitTime)
Métodos protegidos
checkApiLevelAgainst
protected void checkApiLevelAgainst (String feature,
int strictMinLevel)
Parâmetros |
---|
feature | String |
strictMinLevel | int |
doAdbReboot
protected void doAdbReboot (NativeDevice.RebootMode rebootMode,
String reason)
Execute uma reinicialização do adb.
Parâmetros |
---|
rebootMode | NativeDevice.RebootMode : um modo desta reinicialização. |
reason | String : para esta reinicialização. |
Lança |
---|
DeviceNotAvailableException | |
garantirRuntimePermissionSupported
protected void ensureRuntimePermissionSupported ()
método auxiliar para lançar exceção se a permissão de tempo de execução não for suportada
Lança |
---|
DeviceNotAvailableException | |
getBugreportInternal
protected InputStreamSource getBugreportInternal ()
Devoluções |
---|
InputStreamSource | |
getBugreportzInternal
protected File getBugreportzInternal ()
Método auxiliar interno para obter o arquivo zip bugreportz como um ERROR(/File)
.
getRunUtil
protected IRunUtil getRunUtil ()
Obtenha a instância RunUtil
para usar.
internalGetProperty
protected String internalGetProperty (String propName,
String fastbootVar,
String description)
Busque uma propriedade de dispositivo, do cache ddmlib por padrão, e volte para `adb shell getprop` ou `fastboot getvar` dependendo se o dispositivo está em Fastboot ou não.
Parâmetros |
---|
propName | String : O nome da propriedade do dispositivo conforme retornado por `adb shell getprop` |
fastbootVar | String : O nome da variável fastboot equivalente a ser consultada. se null , a consulta fastboot não será tentada |
description | String : uma descrição simples da variável. A primeira letra deve ser maiúscula. |
Devoluções |
---|
String | Uma string, possivelmente null ou vazia, contendo o valor da propriedade fornecida |
Lança |
---|
DeviceNotAvailableException | |
é mais recente
protected boolean isNewer (File localFile,
IFileEntry entry)
Retorne true
se o arquivo local for mais recente que o arquivo remoto. Sendo IFileEntry
com precisão de minuto, em caso de tempos iguais, o arquivo será considerado mais recente.
Parâmetros |
---|
localFile | File |
entry | IFileEntry |
protected boolean performDeviceAction (String actionDescription,
com.android.tradefed.device.NativeDevice.DeviceAction action,
int retryAttempts)
Executa uma ação neste dispositivo. Tenta recuperar o dispositivo e, opcionalmente, tentar novamente o comando se a ação falhar.
Parâmetros |
---|
actionDescription | String : uma breve descrição da ação a ser executada. Usado apenas para fins de registro. |
action | com.android.tradefed.device.NativeDevice.DeviceAction : a ação a ser executada |
retryAttempts | int : a nova tentativa tenta executar uma ação se falhar, mas a recuperação for bem-sucedida |
Devoluções |
---|
boolean | true se a ação foi executada com sucesso |
Lança |
---|
DeviceNotAvailableException | se a tentativa de recuperação falhar ou o máximo de tentativas realizadas sem sucesso |
postAdbReboot
protected void postAdbReboot ()
Possíveis ações extras que podem ser executadas após uma reinicialização.
Lança |
---|
DeviceNotAvailableException | |
prePostBootSetup
protected void prePostBootSetup ()
Permite que cada tipo de dispositivo (AndroidNativeDevice, TestDevice) substitua esse método para configuração específica pós-inicialização.
Lança |
---|
DeviceNotAvailableException | |
definir relógio
protected void setClock (Clock clock)
Defina a instância de Clock a ser usada.
setLogStartDelay
protected void setLogStartDelay (int delay)
Define o tempo em ms de espera antes de iniciar a captura do logcat para um dispositivo online.
Parâmetros |
---|
delay | int : o atraso em ms |
waitForDeviceNotAvailable
protected void waitForDeviceNotAvailable (String operationDesc,
long time)
Parâmetros |
---|
operationDesc | String |
time | long |
O conteúdo e os exemplos de código nesta página estão sujeitos às licenças descritas na Licença de conteúdo. Java e OpenJDK são marcas registradas da Oracle e/ou suas afiliadas.
Última atualização 2023-12-01 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Não contém as informações de que eu preciso"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Muito complicado / etapas demais"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Desatualizado"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"Problema na tradução"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Problema com as amostras / o código"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Outro"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Fácil de entender"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Meu problema foi resolvido"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Outro"
}]