Dispositivo nativo

public class NativeDevice
extends Object implements IManagedTestDevice, IConfigurationReceiver

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


Implementação padrão de dispositivos Android ITestDevice não full stack.

Resumo

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.

Constantes

int INVALID_USER_ID

Valor retornado para qualquer ID de usuário inválido/não encontrado: UserHandle definiu o valor -10000

long MAX_HOST_DEVICE_TIME_OFFSET

int MAX_RETRY_ATTEMPTS

o número padrão de tentativas de repetição de comando para executar

Campos

protected static final String SD_CARD

protected static final String STORAGE_EMULATED

protected TestDeviceOptions mOptions

protected final IDeviceStateMonitor mStateMonitor

Construtores públicos

NativeDevice (IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)

Cria um TestDevice .

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

Devoluções
boolean

Lança
DeviceNotAvailableException

verificar conectividade

public boolean checkConnectivity ()

Devoluções
boolean

Lança
DeviceNotAvailableException

clearErrorDialogs

public boolean clearErrorDialogs ()

Devoluções
boolean

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

Devoluções
boolean

Lança
DeviceNotAvailableException

conectarToWifiNetwork

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

Parâmetros
wifiSsid String

wifiPsk String

scanSsid boolean

Devoluções
boolean

Lança
DeviceNotAvailableException

connectToWifiNetworkIfNeeded

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

Parâmetros
wifiSsid String

wifiPsk String

scanSsid boolean

Devoluções
boolean

Lança
DeviceNotAvailableException

connectToWifiNetworkIfNeeded

public boolean connectToWifiNetworkIfNeeded (String wifiSsid, 
                String wifiPsk)

Parâmetros
wifiSsid String

wifiPsk String

Devoluções
boolean

Lança
DeviceNotAvailableException

criarUsuário

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

Parâmetros
name String

guest boolean

ephemeral boolean

Devoluções
int

Lança
DeviceNotAvailableException

criarUsuário

public int createUser (String name)

Parâmetros
name String

Devoluções
int

Lança
DeviceNotAvailableException

createUserNoThrow

public int createUserNoThrow (String name)

Parâmetros
name String

Devoluções
int

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

Devoluções
boolean

Lança
DeviceNotAvailableException

dispositivoSoftRestartedSince

public boolean deviceSoftRestartedSince (long utcEpochTime, 
                TimeUnit timeUnit)

Parâmetros
utcEpochTime long

timeUnit TimeUnit

Devoluções
boolean

Lança
DeviceNotAvailableException

desativarAdbRoot

public boolean disableAdbRoot ()

Devoluções
boolean

Lança
DeviceNotAvailableException

desabilitarKeyguard

public void disableKeyguard ()

Lança
DeviceNotAvailableException

desativarNetworkMonitor

public boolean disableNetworkMonitor ()

Devoluções
boolean

Lança
DeviceNotAvailableException

desconectarFromWifi

public boolean disconnectFromWifi ()

Devoluções
boolean

Lança
DeviceNotAvailableException

fazFileExist

public boolean doesFileExist (String deviceFilePath)

Parâmetros
deviceFilePath String

Devoluções
boolean

Lança
DeviceNotAvailableException

dumpHeap

public File dumpHeap (String process, 
                String devicePath)

Parâmetros
process String

devicePath String

Devoluções
File

Lança
DeviceNotAvailableException

ativarAdbRoot

public boolean enableAdbRoot ()

Devoluções
boolean

Lança
DeviceNotAvailableException

habilitarNetworkMonitor

public boolean enableNetworkMonitor ()

Devoluções
boolean

Lança
DeviceNotAvailableException

criptografar dispositivo

public boolean encryptDevice (boolean inplace)

Parâmetros
inplace boolean

Devoluções
boolean

Lança
DeviceNotAvailableException

executeAdbCommand

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

Parâmetros
timeout long

cmdArgs String

Devoluções
String

Lança
DeviceNotAvailableException

executeAdbCommand

public String executeAdbCommand (String... cmdArgs)

Parâmetros
cmdArgs String

Devoluções
String

Lança
DeviceNotAvailableException

executeFastbootCommand

public CommandResult executeFastbootCommand (String... cmdArgs)

Parâmetros
cmdArgs String

Devoluções
CommandResult

Lança
DeviceNotAvailableException

executeFastbootCommand

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

Parâmetros
timeout long

cmdArgs String

Devoluções
CommandResult

Lança
DeviceNotAvailableException

executeLongFastbootCommand

public CommandResult executeLongFastbootCommand (String... cmdArgs)

Parâmetros
cmdArgs String

Devoluções
CommandResult

Lança
DeviceNotAvailableException

executeShellCommand

public String executeShellCommand (String command)

Parâmetros
command String

Devoluções
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)

Parâmetros
cmd String

Devoluções
CommandResult

Lança
DeviceNotAvailableException

executeShellV2Command

public CommandResult executeShellV2Command (String cmd, 
                OutputStream pipeToOutput)

Parâmetros
cmd String

pipeToOutput OutputStream

Devoluções
CommandResult

Lança
DeviceNotAvailableException

executeShellV2Command

public CommandResult executeShellV2Command (String cmd, 
                File pipeAsInput)

Parâmetros
cmd String

pipeAsInput File

Devoluções
CommandResult

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

Devoluções
CommandResult

Lança
DeviceNotAvailableException

executeShellV2Command

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

Parâmetros
cmd String

maxTimeoutForCommand long

timeUnit TimeUnit

Devoluções
CommandResult

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

Devoluções
CommandResult

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

Devoluções
CommandResult

Lança
DeviceNotAvailableException

fastbootWipePartition

public CommandResult fastbootWipePartition (String partition)

Parâmetros
partition String

Devoluções
CommandResult

Lança
DeviceNotAvailableException

getActiveApexes

public  getActiveApexes ()

Devoluções

Lança
DeviceNotAvailableException

getAllSettings

public  getAllSettings (String namespace)

Parâmetros
namespace String

Devoluções

Lança
DeviceNotAvailableException

getAllocationState

public DeviceAllocationState getAllocationState ()

Devoluções
DeviceAllocationState

obterAndroidId

public String getAndroidId (int userId)

Parâmetros
userId int

Devoluções
String

Lança
DeviceNotAvailableException

obterAndroidIds

public  getAndroidIds ()

Devoluções

Lança
DeviceNotAvailableException

getApiLevel

public int getApiLevel ()

Devoluções
int

Lança
DeviceNotAvailableException

getAppPackageInfo

public PackageInfo getAppPackageInfo (String packageName)

Parâmetros
packageName String

Devoluções
PackageInfo

Lança
DeviceNotAvailableException

getAppPackageInfos

public  getAppPackageInfos ()

Devoluções

Lança
DeviceNotAvailableException

getBasebandVersion

public String getBasebandVersion ()

Devoluções
String

Lança
DeviceNotAvailableException

obter bateria

public Integer getBattery ()

Devoluções
Integer

getBooleanProperty

public boolean getBooleanProperty (String name, 
                boolean defaultValue)

Parâmetros
name String

defaultValue boolean

Devoluções
boolean

Lança
DeviceNotAvailableException

getBootHistory

public  getBootHistory ()

Devoluções

Lança
DeviceNotAvailableException

getBootHistorySince

public  getBootHistorySince (long utcEpochTime, 
                TimeUnit timeUnit)

Parâmetros
utcEpochTime long

timeUnit TimeUnit

Devoluções

Lança
DeviceNotAvailableException

getBootloaderVersion

public String getBootloaderVersion ()

Devoluções
String

Lança
DeviceNotAvailableException

getBugreport

public InputStreamSource getBugreport ()

Devoluções
InputStreamSource

getBugreportz

public InputStreamSource getBugreportz ()

Devoluções
InputStreamSource

getBuildAlias

public String getBuildAlias ()

Devoluções
String

Lança
DeviceNotAvailableException

getBuildFlavor

public String getBuildFlavor ()

Devoluções
String

Lança
DeviceNotAvailableException

getBuildId

public String getBuildId ()

Devoluções
String

Lança
DeviceNotAvailableException

getBuildSigningKeys

public String getBuildSigningKeys ()

Devoluções
String

Lança
DeviceNotAvailableException

getCachedDeviceDescriptor

public DeviceDescriptor getCachedDeviceDescriptor ()

Devoluções
DeviceDescriptor

obterCrianças

public String[] getChildren (String path)

Parâmetros
path String

Devoluções
String[]

Lança
DeviceNotAvailableException

getCurrentFoldableState

public DeviceFoldableState getCurrentFoldableState ()

Devoluções
DeviceFoldableState

Lança
DeviceNotAvailableException

getCurrentUser

public int getCurrentUser ()

Devoluções
int

Lança
DeviceNotAvailableException

getDeviceClass

public String getDeviceClass ()

Devoluções
String

getDeviceDate

public long getDeviceDate ()

Devoluções
long

Lança
DeviceNotAvailableException

getDeviceDescriptor

public DeviceDescriptor getDeviceDescriptor ()

Devoluções
DeviceDescriptor

getDeviceState

public TestDeviceState getDeviceState ()

Devoluções
TestDeviceState

getDeviceTimeOffset

public long getDeviceTimeOffset (Date date)

Parâmetros
date Date

Devoluções
long

Lança
DeviceNotAvailableException

getEmulatorOutput

public InputStreamSource getEmulatorOutput ()

Devoluções
InputStreamSource

getEmulatorProcess

public Process getEmulatorProcess ()

Devoluções
Process

getExecuteShellCommandLog

public final File getExecuteShellCommandLog ()

O log que contém todos os logs executeShellCommand(String) .

Devoluções
File

getExternalStoreFreeSpace

public long getExternalStoreFreeSpace ()

Devoluções
long

Lança
DeviceNotAvailableException

getFastbootPath

public String getFastbootPath ()

Devoluções
String

getFastbootProductType

public String getFastbootProductType ()

Devoluções
String

Lança
DeviceNotAvailableException

getFastbootProductVariant

public String getFastbootProductVariant ()

Devoluções
String

Lança
DeviceNotAvailableException

getFastbootSerialNumber

public String getFastbootSerialNumber ()

Devoluções
String

getFastbootVariável

public String getFastbootVariable (String variableName)

Parâmetros
variableName String

Devoluções
String

Lança
DeviceNotAvailableException

getFastbootVersion

public String getFastbootVersion ()

Devoluções
String

getFileEntry

public IFileEntry getFileEntry (String path)

Parâmetros
path String

Devoluções
IFileEntry

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.

Devoluções
IFileEntry um FileEntryWrapper representando o FileEntry.

Lança
DeviceNotAvailableException

getFoldableStates

public  getFoldableStates ()

Devoluções

Lança
DeviceNotAvailableException

getIDevice

public IDevice getIDevice ()

Devoluções
IDevice

getInstalledPackageNames

public  getInstalledPackageNames ()

Devoluções

Lança
DeviceNotAvailableException

getIntProperty

public long getIntProperty (String name, 
                long defaultValue)

Parâmetros
name String

defaultValue long

Devoluções
long

Lança
DeviceNotAvailableException

getIpAddress

public String getIpAddress ()

Devoluções
String

Lança
DeviceNotAvailableException

getKeyguardState

public KeyguardControllerState getKeyguardState ()

Devoluções
KeyguardControllerState

Lança
DeviceNotAvailableException

getLastExpectedRebootTimeMillis

public long getLastExpectedRebootTimeMillis ()

Devoluções
long

getLaunchApiLevel

public int getLaunchApiLevel ()

Devoluções
int

Lança
DeviceNotAvailableException

getLogcat

public InputStreamSource getLogcat ()

Devoluções
InputStreamSource

getLogcat

public InputStreamSource getLogcat (int maxBytes)

Parâmetros
maxBytes int

Devoluções
InputStreamSource

getLogcatDump

public InputStreamSource getLogcatDump ()

Devoluções
InputStreamSource

getLogcatSince

public InputStreamSource getLogcatSince (long date)

Parâmetros
date long

Devoluções
InputStreamSource

getMacAddress

public String getMacAddress ()

Devoluções
String

getMainlineModuleInfo

public  getMainlineModuleInfo ()

Devoluções

Lança
DeviceNotAvailableException

getMaxNumberOfRunningUsers suportados

public int getMaxNumberOfRunningUsersSupported ()

Devoluções
int

Lança
DeviceNotAvailableException

getMaxNumberOfUsers suportados

public int getMaxNumberOfUsersSupported ()

Devoluções
int

Lança
DeviceNotAvailableException

getMonitor

public IDeviceStateMonitor getMonitor ()

Devoluções
IDeviceStateMonitor

obterMountPoint

public String getMountPoint (String mountName)

Parâmetros
mountName String

Devoluções
String

getMountPointInfo

public ITestDevice.MountPointInfo getMountPointInfo (String mountpoint)

Parâmetros
mountpoint String

Devoluções
ITestDevice.MountPointInfo

Lança
DeviceNotAvailableException

getMountPointInfo

public  getMountPointInfo ()

Devoluções

Lança
DeviceNotAvailableException

getOpções

public TestDeviceOptions getOptions ()

Devoluções
TestDeviceOptions

getPartitionFreeSpace

public long getPartitionFreeSpace (String partition)

Parâmetros
partition String

Devoluções
long

Lança
DeviceNotAvailableException

getPrimaryUserId

public Integer getPrimaryUserId ()

Devoluções
Integer

Lança
DeviceNotAvailableException

getProcessByName

public ProcessInfo getProcessByName (String processName)

Parâmetros
processName String

Devoluções
ProcessInfo

Lança
DeviceNotAvailableException

getProcessPid

public String getProcessPid (String process)

Parâmetros
process String

Devoluções
String

Lança
DeviceNotAvailableException

getProductType

public String getProductType ()

Devoluções
String

Lança
DeviceNotAvailableException

getProductVariant

public String getProductVariant ()

Devoluções
String

Lança
DeviceNotAvailableException

obterPropriedade

public String getProperty (String name)

Parâmetros
name String

Devoluções
String

Lança
DeviceNotAvailableException

getRecoveryMode

public ITestDevice.RecoveryMode getRecoveryMode ()

Devoluções
ITestDevice.RecoveryMode

obter captura de tela

public InputStreamSource getScreenshot (String format)

Parâmetros
format String

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 ()

Devoluções
String

getSetting

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

Parâmetros
userId int

namespace String

key String

Devoluções
String

Lança
DeviceNotAvailableException

getSetting

public String getSetting (String namespace, 
                String key)

Parâmetros
namespace String

key String

Devoluções
String

Lança
DeviceNotAvailableException

getSimOperator

public String getSimOperator ()

Devoluções
String

getSimState

public String getSimState ()

Devoluções
String

obterTombstones

public  getTombstones ()

Devoluções

Lança
DeviceNotAvailableException

getTotalMemory

public long getTotalMemory ()

Devoluções
long

getUninstallablePackageNames

public  getUninstallablePackageNames ()

Devoluções

Lança
DeviceNotAvailableException

getUseFastbootErase

public boolean getUseFastbootErase ()

Devoluções
boolean

getUserFlags

public int getUserFlags (int userId)

Parâmetros
userId int

Devoluções
int

Lança
DeviceNotAvailableException

getUserInfos

public  getUserInfos ()

Devoluções

Lança
DeviceNotAvailableException

getUserSerialNumber

public int getUserSerialNumber (int userId)

Parâmetros
userId int

Devoluções
int

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

Devoluções
boolean

Lança
DeviceNotAvailableException

instalarPacote

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

Parâmetros
packageFile File

reinstall boolean

extraArgs String

Devoluções
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

Devoluções
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

Devoluções
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

Devoluções
String

Lança
DeviceNotAvailableException

isAdbRoot

public boolean isAdbRoot ()

Devoluções
boolean

Lança
DeviceNotAvailableException

isAdbTcp

public boolean isAdbTcp ()

Devoluções
boolean

isAppEnumerationSupported

public boolean isAppEnumerationSupported ()

Devoluções
boolean

Lança
DeviceNotAvailableException

isDeviceEncrypted

public boolean isDeviceEncrypted ()

Devoluções
boolean

Lança
DeviceNotAvailableException

éDiretório

public boolean isDirectory (String path)

Parâmetros
path String

Devoluções
boolean

Lança
DeviceNotAvailableException

isEnableAdbRoot

public boolean isEnableAdbRoot ()

Devoluções
boolean true se o adb root deve estar habilitado no dispositivo

isEncryptionSupported

public boolean isEncryptionSupported ()

Devoluções
boolean

Lança
DeviceNotAvailableException

éExecutável

public boolean isExecutable (String fullPath)

Parâmetros
fullPath String

Devoluções
boolean

Lança
DeviceNotAvailableException

isFastbootEnabled

public boolean isFastbootEnabled ()

Devoluções
boolean

é sem cabeça

public boolean isHeadless ()

Devoluções
boolean

Lança
DeviceNotAvailableException

isMultiUserSupportado

public boolean isMultiUserSupported ()

Devoluções
boolean

Lança
DeviceNotAvailableException

isPackageInstalled

public boolean isPackageInstalled (String packageName, 
                String userId)

Parâmetros
packageName String

userId String

Devoluções
boolean

Lança
DeviceNotAvailableException

isPackageInstalled

public boolean isPackageInstalled (String packageName)

Parâmetros
packageName String

Devoluções
boolean

Lança
DeviceNotAvailableException

isRuntimePermissionSupported

public boolean isRuntimePermissionSupported ()

Devoluções
boolean

Lança
DeviceNotAvailableException

isStateBootloaderOrFastbootd

public boolean isStateBootloaderOrFastbootd ()

Devoluções
boolean

isUserRunning

public boolean isUserRunning (int userId)

Parâmetros
userId int

Devoluções
boolean

Lança
DeviceNotAvailableException

isUserSecondary

public boolean isUserSecondary (int userId)

Parâmetros
userId int

Devoluções
boolean

Lança
DeviceNotAvailableException

isWifiEnabled

public boolean isWifiEnabled ()

Devoluções
boolean

Lança
DeviceNotAvailableException

listaDisplayIds

public  listDisplayIds ()

Devoluções

Lança
DeviceNotAvailableException

listaUsuários

public  listUsers ()

Devoluções

Lança
DeviceNotAvailableException

logBugreport

public boolean logBugreport (String dataName, 
                ITestLogger listener)

Parâmetros
dataName String

listener ITestLogger

Devoluções
boolean

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

Devoluções
boolean

Lança
DeviceNotAvailableException

pullFile

public boolean pullFile (String remoteFilePath, 
                File localFile)

Parâmetros
remoteFilePath String

localFile File

Devoluções
boolean

Lança
DeviceNotAvailableException

pullFile

public File pullFile (String remoteFilePath)

Parâmetros
remoteFilePath String

Devoluções
File

Lança
DeviceNotAvailableException

pullFileContents

public String pullFileContents (String remoteFilePath)

Parâmetros
remoteFilePath String

Devoluções
String

Lança
DeviceNotAvailableException

pullFileFromExternal

public File pullFileFromExternal (String remoteFilePath)

Parâmetros
remoteFilePath String

Devoluções
File

Lança
DeviceNotAvailableException

pushDir

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

Parâmetros
localFileDir File

deviceFilePath String

excludedDirectories

Devoluções
boolean

Lança
DeviceNotAvailableException

pushDir

public boolean pushDir (File localFileDir, 
                String deviceFilePath)

Parâmetros
localFileDir File

deviceFilePath String

Devoluções
boolean

Lança
DeviceNotAvailableException

arquivo push

public boolean pushFile (File localFile, 
                String remoteFilePath)

Parâmetros
localFile File

remoteFilePath String

Devoluções
boolean

Lança
DeviceNotAvailableException

pushString

public boolean pushString (String contents, 
                String remoteFilePath)

Parâmetros
contents String

remoteFilePath String

Devoluções
boolean

Lança
DeviceNotAvailableException

reinício

public void reboot (String reason)

Parâmetros
reason String

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)

Parâmetros
reason String

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

Devoluções
boolean

Lança
DeviceNotAvailableException

removerProprietários

public void removeOwners ()

Lança
DeviceNotAvailableException

removerUsuário

public boolean removeUser (int userId)

Parâmetros
userId int

Devoluções
boolean

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

Devoluções
boolean

Lança
DeviceNotAvailableException

executar testes de instrumentação

public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner, 
                 listeners)

Parâmetros
runner IRemoteAndroidTestRunner

listeners

Devoluções
boolean

Lança
DeviceNotAvailableException

runInstrumentationTestsAsUser

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

Parâmetros
runner IRemoteAndroidTestRunner

userId int

listeners ITestLifeCycleReceiver

Devoluções
boolean

Lança
DeviceNotAvailableException

runInstrumentationTestsAsUser

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

Parâmetros
runner IRemoteAndroidTestRunner

userId int

listeners

Devoluções
boolean

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)

Parâmetros
date Date

Lança
DeviceNotAvailableException

setDeviceOwner

public boolean setDeviceOwner (String componentName, 
                int userId)

Parâmetros
componentName String

userId int

Devoluções
boolean

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)

Parâmetros
p Process

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

Devoluções
boolean

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)

Parâmetros
userId int

Devoluções
boolean

Lança
DeviceNotAvailableException

usuário inicial

public boolean startUser (int userId, 
                boolean waitFlag)

Parâmetros
userId int

waitFlag boolean

Devoluções
boolean

Lança
DeviceNotAvailableException

stopEmulatorOutput

public void stopEmulatorOutput ()

pararLogcat

public void stopLogcat ()

pararUsuário

public boolean stopUser (int userId)

Parâmetros
userId int

Devoluções
boolean

Lança
DeviceNotAvailableException

pararUsuário

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

Parâmetros
userId int

waitFlag boolean

forceFlag boolean

Devoluções
boolean

Lança
DeviceNotAvailableException

switchToAdbTcp

public String switchToAdbTcp ()

Devoluções
String

Lança
DeviceNotAvailableException

switchToAdbUsb

public boolean switchToAdbUsb ()

Devoluções
boolean

Lança
DeviceNotAvailableException

mudar de utilizador

public boolean switchUser (int userId)

Parâmetros
userId int

Devoluções
boolean

Lança
DeviceNotAvailableException

mudar de utilizador

public boolean switchUser (int userId, 
                long timeout)

Parâmetros
userId int

timeout long

Devoluções
boolean

Lança
DeviceNotAvailableException

arquivos de sincronização

public boolean syncFiles (File localFileDir, 
                String deviceFilePath)

Parâmetros
localFileDir File

deviceFilePath String

Devoluções
boolean

Lança
DeviceNotAvailableException

pegueBugreport

public Bugreport takeBugreport ()

Devoluções
Bugreport

desencriptar dispositivo

public boolean unencryptDevice ()

Devoluções
boolean

Lança
DeviceNotAvailableException

desinstalarPackage

public String uninstallPackage (String packageName)

Parâmetros
packageName String

Devoluções
String

Lança
DeviceNotAvailableException

desinstalarPackageForUser

public String uninstallPackageForUser (String packageName, 
                int userId)

Parâmetros
packageName String

userId int

Devoluções
String

Lança
DeviceNotAvailableException

desbloquear dispositivo

public boolean unlockDevice ()

Devoluções
boolean

Lança
DeviceNotAvailableException

waitForBootComplete

public boolean waitForBootComplete (long timeOut)

Parâmetros
timeOut long

Devoluções
boolean

Lança
DeviceNotAvailableException

waitForDeviceAvailable

public void waitForDeviceAvailable ()

Lança
DeviceNotAvailableException

waitForDeviceAvailable

public void waitForDeviceAvailable (long waitTime)

Parâmetros
waitTime long

Lança
DeviceNotAvailableException

waitForDeviceInRecovery

public boolean waitForDeviceInRecovery (long waitTime)

Parâmetros
waitTime long

Devoluções
boolean

waitForDeviceInSideload

public boolean waitForDeviceInSideload (long waitTime)

Parâmetros
waitTime long

Devoluções
boolean

waitForDeviceNotAvailable

public boolean waitForDeviceNotAvailable (long waitTime)

Parâmetros
waitTime long

Devoluções
boolean

waitForDeviceOnline

public void waitForDeviceOnline ()

Lança
DeviceNotAvailableException

waitForDeviceOnline

public void waitForDeviceOnline (long waitTime)

Parâmetros
waitTime long

Lança
DeviceNotAvailableException

espereForDeviceShell

public boolean waitForDeviceShell (long waitTime)

Parâmetros
waitTime long

Devoluções
boolean

Métodos protegidos

checkApiLevelAgainst

protected void checkApiLevelAgainst (String feature, 
                int strictMinLevel)

Parâmetros
feature String

strictMinLevel int

createRebootDeviceAction

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

Crie um RebootDeviceAction para ser usado ao executar uma ação de reinicialização.

Parâmetros
rebootMode NativeDevice.RebootMode : um modo desta reinicialização.

reason String : para esta reinicialização.

Devoluções
NativeDevice.RebootDeviceAction o RebootDeviceAction criado.

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) .

Devoluções
File

getRunUtil

protected IRunUtil getRunUtil ()

Obtenha a instância RunUtil para usar.

Devoluções
IRunUtil

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

Devoluções
boolean

performDeviceAction

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.

Parâmetros
clock Clock

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