Dispositivo nativo

public class NativeDevice
extends Object implements IManagedTestDevice, IConfigurationReceiver

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


Implementación predeterminada de un ITestDevice Dispositivos Android que no son de pila completa.

Resumen

clases anidadas

class NativeDevice.AdbAction

Una DeviceAction para ejecutar un comando 'adb ....' del sistema operativo.

class NativeDevice.AdbShellAction

class NativeDevice.RebootDeviceAction

DeviceAction para reiniciar un dispositivo.

enum NativeDevice.RebootMode

Un modo de reinicio.

Constantes

int INVALID_USER_ID

Valor devuelto para cualquier identificación de usuario no válida o no encontrada: UserHandle definió el valor -10000

long MAX_HOST_DEVICE_TIME_OFFSET

int MAX_RETRY_ATTEMPTS

el número predeterminado de intentos de reintento de comando para realizar

Campos

protected static final String SD_CARD

protected static final String STORAGE_EMULATED

protected TestDeviceOptions mOptions

protected final IDeviceStateMonitor mStateMonitor

Constructores públicos

NativeDevice (IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)

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

El registro que contiene todos los registros 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)

Ayudante no oficial para obtener un FileEntry desde una ruta no raíz.

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)

Procese el DeviceEvent, que puede o no hacer la transición de este dispositivo a un nuevo estado de asignación.

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

Anule si el dispositivo necesita que se realicen algunas acciones específicas después de adb root y antes de que el dispositivo vuelva a estar en línea.

void postAdbUnrootAction ()

Anule si el dispositivo necesita que se realicen algunas acciones específicas después de desrootear adb y antes de que el dispositivo vuelva a estar en línea.

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

Intenta recuperar la comunicación del dispositivo.

void remountSystemWritable ()

void remountVendorWritable ()

boolean removeAdmin (String componentName, int userId)

void removeOwners ()

boolean removeUser (int userId)

void resetContentProviderSetup ()

Restablezca el indicador para la configuración del proveedor de contenido para activarlo nuevamente.

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)

Inyecta la IConfiguration en uso.

void setDate (Date date)

boolean setDeviceOwner (String componentName, int userId)

void setDeviceState (TestDeviceState deviceState)

void setEmulatorOutputStream ( SizeLimitedOutputStream output)

Para el emulador, configure SizeLimitedOutputStream para registrar la salida

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)

Cree una RebootDeviceAction para usarla al realizar una acción de reinicio.

void doAdbReboot ( NativeDevice.RebootMode rebootMode, String reason)

Realice un reinicio de adb.

void ensureRuntimePermissionSupported ()

método auxiliar para lanzar una excepción si el permiso de tiempo de ejecución no es compatible

InputStreamSource getBugreportInternal ()
File getBugreportzInternal ()

Método de ayuda interna para obtener el archivo zip del informe de error como ERROR(/File) .

IRunUtil getRunUtil ()

Obtenga la instancia RunUtil para usar.

String internalGetProperty (String propName, String fastbootVar, String description)

Obtenga una propiedad del dispositivo, desde la caché ddmlib de forma predeterminada, y recurra a `adb shell getprop` o `fastboot getvar` dependiendo de si el dispositivo está en Fastboot o no.

boolean isNewer (File localFile, IFileEntry entry)

Devuelve true si el archivo local es más nuevo que el archivo remoto.

boolean performDeviceAction (String actionDescription, com.android.tradefed.device.NativeDevice.DeviceAction action, int retryAttempts)

Realiza una acción en este dispositivo.

void postAdbReboot ()

Posibles acciones adicionales que se pueden realizar después de reiniciar.

void prePostBootSetup ()

Permite que cada tipo de dispositivo (AndroidNativeDevice, TestDevice) anule este método para una configuración posterior al arranque específica.

void setClock (Clock clock)

Configure la instancia de reloj que se utilizará.

void setLogStartDelay (int delay)

Establece el tiempo en ms que se debe esperar antes de iniciar la captura de logcat para un dispositivo en línea.

void waitForDeviceNotAvailable (String operationDesc, long time)

Constantes

ID DE USUARIO INVALIDO

public static final int INVALID_USER_ID

Valor devuelto para cualquier identificación de usuario no válida o no encontrada: UserHandle definió el valor -10000

Valor constante: -10000 (0xffffd8f0)

MAX_HOST_DEVICE_TIME_OFFSET

protected static final long MAX_HOST_DEVICE_TIME_OFFSET

Valor constante: 5000 (0x0000000000001388)

MAX_RETRY_ATTEMPTS

protected static final int MAX_RETRY_ATTEMPTS

el número predeterminado de intentos de reintento de comando para realizar

Valor constante: 2 (0x00000002)

Campos

TARJETA SD

protected static final String SD_CARD

ALMACENAMIENTO_EMULADO

protected static final String STORAGE_EMULATED

mOpciones

protected TestDeviceOptions mOptions

mStateMonitor

protected final IDeviceStateMonitor mStateMonitor

Constructores públicos

Dispositivo nativo

public NativeDevice (IDevice device, 
                IDeviceStateMonitor stateMonitor, 
                IDeviceMonitor allocationMonitor)

Crea un TestDevice .

Parámetros
device IDevice : el IDevice asociado

stateMonitor IDeviceStateMonitor : el mecanismo IDeviceStateMonitor a utilizar

allocationMonitor IDeviceMonitor : el IDeviceMonitor para informar de los cambios en el estado de asignación. Puede ser nulo

Métodos públicos

checkApiLevelAgainstNextRelease

public boolean checkApiLevelAgainstNextRelease (int strictMinLevel)

Parámetros
strictMinLevel int

Devoluciones
boolean

Lanza
DeviceNotAvailableException

checkConectividad

public boolean checkConnectivity ()

Devoluciones
boolean

Lanza
DeviceNotAvailableException

clearErrorDiálogos

public boolean clearErrorDialogs ()

Devoluciones
boolean

Lanza
DeviceNotAvailableException

borrarÚltimoConectadoRedWifi

public void clearLastConnectedWifiNetwork ()

borrarLogcat

public void clearLogcat ()

conectarse a la red wifi

public boolean connectToWifiNetwork (String wifiSsid, 
                String wifiPsk)

Parámetros
wifiSsid String

wifiPsk String

Devoluciones
boolean

Lanza
DeviceNotAvailableException

conectarse a la red wifi

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

Parámetros
wifiSsid String

wifiPsk String

scanSsid boolean

Devoluciones
boolean

Lanza
DeviceNotAvailableException

conectarse a la red Wifi si es necesario

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

Parámetros
wifiSsid String

wifiPsk String

scanSsid boolean

Devoluciones
boolean

Lanza
DeviceNotAvailableException

conectarse a la red Wifi si es necesario

public boolean connectToWifiNetworkIfNeeded (String wifiSsid, 
                String wifiPsk)

Parámetros
wifiSsid String

wifiPsk String

Devoluciones
boolean

Lanza
DeviceNotAvailableException

crear usuario

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

Parámetros
name String

guest boolean

ephemeral boolean

Devoluciones
int

Lanza
DeviceNotAvailableException

crear usuario

public int createUser (String name)

Parámetros
name String

Devoluciones
int

Lanza
DeviceNotAvailableException

crearUsuarioNoThrow

public int createUserNoThrow (String name)

Parámetros
name String

Devoluciones
int

Lanza
DeviceNotAvailableException

borrar archivo

public void deleteFile (String deviceFilePath)

Parámetros
deviceFilePath String

Lanza
DeviceNotAvailableException

dispositivoSoftRestarted

public boolean deviceSoftRestarted (ProcessInfo prevSystemServerProcess)

Parámetros
prevSystemServerProcess ProcessInfo

Devoluciones
boolean

Lanza
DeviceNotAvailableException

dispositivoSoftRestartedDesde

public boolean deviceSoftRestartedSince (long utcEpochTime, 
                TimeUnit timeUnit)

Parámetros
utcEpochTime long

timeUnit TimeUnit

Devoluciones
boolean

Lanza
DeviceNotAvailableException

desactivarAdbRoot

public boolean disableAdbRoot ()

Devoluciones
boolean

Lanza
DeviceNotAvailableException

desactivar Keyguard

public void disableKeyguard ()

Lanza
DeviceNotAvailableException

desactivarNetworkMonitor

public boolean disableNetworkMonitor ()

Devoluciones
boolean

Lanza
DeviceNotAvailableException

desconectarse de Wifi

public boolean disconnectFromWifi ()

Devoluciones
boolean

Lanza
DeviceNotAvailableException

¿Existe el archivo?

public boolean doesFileExist (String deviceFilePath)

Parámetros
deviceFilePath String

Devoluciones
boolean

Lanza
DeviceNotAvailableException

montón de volcado

public File dumpHeap (String process, 
                String devicePath)

Parámetros
process String

devicePath String

Devoluciones
File

Lanza
DeviceNotAvailableException

habilitarAdbRoot

public boolean enableAdbRoot ()

Devoluciones
boolean

Lanza
DeviceNotAvailableException

habilitarNetworkMonitor

public boolean enableNetworkMonitor ()

Devoluciones
boolean

Lanza
DeviceNotAvailableException

cifrar dispositivo

public boolean encryptDevice (boolean inplace)

Parámetros
inplace boolean

Devoluciones
boolean

Lanza
DeviceNotAvailableException

ejecutarAdbCommand

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

Parámetros
timeout long

cmdArgs String

Devoluciones
String

Lanza
DeviceNotAvailableException

ejecutarAdbCommand

public String executeAdbCommand (String... cmdArgs)

Parámetros
cmdArgs String

Devoluciones
String

Lanza
DeviceNotAvailableException

ejecutar FastbootCommand

public CommandResult executeFastbootCommand (String... cmdArgs)

Parámetros
cmdArgs String

Devoluciones
CommandResult

Lanza
DeviceNotAvailableException

ejecutar FastbootCommand

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

Parámetros
timeout long

cmdArgs String

Devoluciones
CommandResult

Lanza
DeviceNotAvailableException

ejecutar LongFastbootCommand

public CommandResult executeLongFastbootCommand (String... cmdArgs)

Parámetros
cmdArgs String

Devoluciones
CommandResult

Lanza
DeviceNotAvailableException

ejecutar ShellCommand

public String executeShellCommand (String command)

Parámetros
command String

Devoluciones
String

Lanza
DeviceNotAvailableException

ejecutar ShellCommand

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

Lanza
DeviceNotAvailableException

ejecutar ShellCommand

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

Lanza
DeviceNotAvailableException

ejecutar ShellCommand

public void executeShellCommand (String command, 
                IShellOutputReceiver receiver)

Parámetros
command String

receiver IShellOutputReceiver

Lanza
DeviceNotAvailableException

ejecutarShellV2Command

public CommandResult executeShellV2Command (String cmd)

Parámetros
cmd String

Devoluciones
CommandResult

Lanza
DeviceNotAvailableException

ejecutarShellV2Command

public CommandResult executeShellV2Command (String cmd, 
                OutputStream pipeToOutput)

Parámetros
cmd String

pipeToOutput OutputStream

Devoluciones
CommandResult

Lanza
DeviceNotAvailableException

ejecutarShellV2Command

public CommandResult executeShellV2Command (String cmd, 
                File pipeAsInput)

Parámetros
cmd String

pipeAsInput File

Devoluciones
CommandResult

Lanza
DeviceNotAvailableException

ejecutarShellV2Command

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

Parámetros
cmd String

maxTimeoutForCommand long

timeUnit TimeUnit

retryAttempts int

Devoluciones
CommandResult

Lanza
DeviceNotAvailableException

ejecutarShellV2Command

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

Parámetros
cmd String

maxTimeoutForCommand long

timeUnit TimeUnit

Devoluciones
CommandResult

Lanza
DeviceNotAvailableException

ejecutarShellV2Command

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

Devoluciones
CommandResult

Lanza
DeviceNotAvailableException

ejecutarShellV2Command

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

Devoluciones
CommandResult

Lanza
DeviceNotAvailableException

fastbootWipePartición

public CommandResult fastbootWipePartition (String partition)

Parámetros
partition String

Devoluciones
CommandResult

Lanza
DeviceNotAvailableException

getActiveApexes

public  getActiveApexes ()

Devoluciones

Lanza
DeviceNotAvailableException

obtener todas las configuraciones

public  getAllSettings (String namespace)

Parámetros
namespace String

Devoluciones

Lanza
DeviceNotAvailableException

obtener estado de asignación

public DeviceAllocationState getAllocationState ()

Devoluciones
DeviceAllocationState

obtenerID de Android

public String getAndroidId (int userId)

Parámetros
userId int

Devoluciones
String

Lanza
DeviceNotAvailableException

obtenerIds de Android

public  getAndroidIds ()

Devoluciones

Lanza
DeviceNotAvailableException

obtenerApiLevel

public int getApiLevel ()

Devoluciones
int

Lanza
DeviceNotAvailableException

getAppPackageInfo

public PackageInfo getAppPackageInfo (String packageName)

Parámetros
packageName String

Devoluciones
PackageInfo

Lanza
DeviceNotAvailableException

getAppPackageInfos

public  getAppPackageInfos ()

Devoluciones

Lanza
DeviceNotAvailableException

getBasebandVersion

public String getBasebandVersion ()

Devoluciones
String

Lanza
DeviceNotAvailableException

obtener batería

public Integer getBattery ()

Devoluciones
Integer

obtener propiedad booleana

public boolean getBooleanProperty (String name, 
                boolean defaultValue)

Parámetros
name String

defaultValue boolean

Devoluciones
boolean

Lanza
DeviceNotAvailableException

obtenerHistorial de arranque

public  getBootHistory ()

Devoluciones

Lanza
DeviceNotAvailableException

getBootHistoryDesde

public  getBootHistorySince (long utcEpochTime, 
                TimeUnit timeUnit)

Parámetros
utcEpochTime long

timeUnit TimeUnit

Devoluciones

Lanza
DeviceNotAvailableException

obtener la versión del cargador de arranque

public String getBootloaderVersion ()

Devoluciones
String

Lanza
DeviceNotAvailableException

obtener informe de errores

public InputStreamSource getBugreport ()

Devoluciones
InputStreamSource

getBugreportz

public InputStreamSource getBugreportz ()

Devoluciones
InputStreamSource

getBuildAlias

public String getBuildAlias ()

Devoluciones
String

Lanza
DeviceNotAvailableException

getBuildFlavor

public String getBuildFlavor ()

Devoluciones
String

Lanza
DeviceNotAvailableException

obtener ID de compilación

public String getBuildId ()

Devoluciones
String

Lanza
DeviceNotAvailableException

obtener claves de firma de compilación

public String getBuildSigningKeys ()

Devoluciones
String

Lanza
DeviceNotAvailableException

getCachedDeviceDescriptor

public DeviceDescriptor getCachedDeviceDescriptor ()

Devoluciones
DeviceDescriptor

obtener niños

public String[] getChildren (String path)

Parámetros
path String

Devoluciones
String[]

Lanza
DeviceNotAvailableException

getCurrentFoldableState

public DeviceFoldableState getCurrentFoldableState ()

Devoluciones
DeviceFoldableState

Lanza
DeviceNotAvailableException

obtener usuario actual

public int getCurrentUser ()

Devoluciones
int

Lanza
DeviceNotAvailableException

getDeviceClass

public String getDeviceClass ()

Devoluciones
String

obtener fecha del dispositivo

public long getDeviceDate ()

Devoluciones
long

Lanza
DeviceNotAvailableException

getDeviceDescriptor

public DeviceDescriptor getDeviceDescriptor ()

Devoluciones
DeviceDescriptor

obtener estado del dispositivo

public TestDeviceState getDeviceState ()

Devoluciones
TestDeviceState

getDeviceTimeOffset

public long getDeviceTimeOffset (Date date)

Parámetros
date Date

Devoluciones
long

Lanza
DeviceNotAvailableException

obtener salida del emulador

public InputStreamSource getEmulatorOutput ()

Devoluciones
InputStreamSource

obtenerProcesoEmulator

public Process getEmulatorProcess ()

Devoluciones
Process

getExecuteShellCommandLog

public final File getExecuteShellCommandLog ()

El registro que contiene todos los registros executeShellCommand(String) .

Devoluciones
File

getExternalStoreFreeSpace

public long getExternalStoreFreeSpace ()

Devoluciones
long

Lanza
DeviceNotAvailableException

obtenerRutaFastboot

public String getFastbootPath ()

Devoluciones
String

getFastbootProductType

public String getFastbootProductType ()

Devoluciones
String

Lanza
DeviceNotAvailableException

getFastbootProductVariant

public String getFastbootProductVariant ()

Devoluciones
String

Lanza
DeviceNotAvailableException

obtener el número de serie de Fastboot

public String getFastbootSerialNumber ()

Devoluciones
String

obtenerFastbootVariable

public String getFastbootVariable (String variableName)

Parámetros
variableName String

Devoluciones
String

Lanza
DeviceNotAvailableException

obtener la versión Fastboot

public String getFastbootVersion ()

Devoluciones
String

getFileEntry

public IFileEntry getFileEntry (String path)

Parámetros
path String

Devoluciones
IFileEntry

Lanza
DeviceNotAvailableException

getFileEntry

public IFileEntry getFileEntry (FileListingService.FileEntry entry)

Ayudante no oficial para obtener un FileEntry desde una ruta no raíz. FIXME: Refactorice el sistema FileEntry para que esté disponible desde cualquier ruta. (incluso no root).

Parámetros
entry FileListingService.FileEntry : un FileEntry no necesariamente root como lo requiere Ddmlib.

Devoluciones
IFileEntry un FileEntryWrapper que representa FileEntry.

Lanza
DeviceNotAvailableException

getFoldableStates

public  getFoldableStates ()

Devoluciones

Lanza
DeviceNotAvailableException

obtenerIDevice

public IDevice getIDevice ()

Devoluciones
IDevice

getInstalledPackageNames

public  getInstalledPackageNames ()

Devoluciones

Lanza
DeviceNotAvailableException

obtenerPropiedadInt

public long getIntProperty (String name, 
                long defaultValue)

Parámetros
name String

defaultValue long

Devoluciones
long

Lanza
DeviceNotAvailableException

obtener dirección IP

public String getIpAddress ()

Devoluciones
String

Lanza
DeviceNotAvailableException

getKeyguardState

public KeyguardControllerState getKeyguardState ()

Devoluciones
KeyguardControllerState

Lanza
DeviceNotAvailableException

getLastExpectedRebootTimeMillis

public long getLastExpectedRebootTimeMillis ()

Devoluciones
long

getLaunchApiLevel

public int getLaunchApiLevel ()

Devoluciones
int

Lanza
DeviceNotAvailableException

obtenerLogcat

public InputStreamSource getLogcat ()

Devoluciones
InputStreamSource

obtenerLogcat

public InputStreamSource getLogcat (int maxBytes)

Parámetros
maxBytes int

Devoluciones
InputStreamSource

obtenerLogcatDump

public InputStreamSource getLogcatDump ()

Devoluciones
InputStreamSource

getLogcatDesde

public InputStreamSource getLogcatSince (long date)

Parámetros
date long

Devoluciones
InputStreamSource

obtener dirección Mac

public String getMacAddress ()

Devoluciones
String

getMainlineModuleInfo

public  getMainlineModuleInfo ()

Devoluciones

Lanza
DeviceNotAvailableException

getMaxNumberOfRunningUsersSupported

public int getMaxNumberOfRunningUsersSupported ()

Devoluciones
int

Lanza
DeviceNotAvailableException

getMaxNumberOfUsersSupported

public int getMaxNumberOfUsersSupported ()

Devoluciones
int

Lanza
DeviceNotAvailableException

obtenerMonitor

public IDeviceStateMonitor getMonitor ()

Devoluciones
IDeviceStateMonitor

obtenerMountPoint

public String getMountPoint (String mountName)

Parámetros
mountName String

Devoluciones
String

obtener información de punto de montaje

public ITestDevice.MountPointInfo getMountPointInfo (String mountpoint)

Parámetros
mountpoint String

Devoluciones
ITestDevice.MountPointInfo

Lanza
DeviceNotAvailableException

obtener información de punto de montaje

public  getMountPointInfo ()

Devoluciones

Lanza
DeviceNotAvailableException

obtener Opciones

public TestDeviceOptions getOptions ()

Devoluciones
TestDeviceOptions

obtenerParticiónLibreEspacio

public long getPartitionFreeSpace (String partition)

Parámetros
partition String

Devoluciones
long

Lanza
DeviceNotAvailableException

obtener ID de usuario principal

public Integer getPrimaryUserId ()

Devoluciones
Integer

Lanza
DeviceNotAvailableException

obtenerProcesoPorNombre

public ProcessInfo getProcessByName (String processName)

Parámetros
processName String

Devoluciones
ProcessInfo

Lanza
DeviceNotAvailableException

obtenerPidProceso

public String getProcessPid (String process)

Parámetros
process String

Devoluciones
String

Lanza
DeviceNotAvailableException

obtener tipo de producto

public String getProductType ()

Devoluciones
String

Lanza
DeviceNotAvailableException

obtenerVarianteProducto

public String getProductVariant ()

Devoluciones
String

Lanza
DeviceNotAvailableException

obtener propiedad

public String getProperty (String name)

Parámetros
name String

Devoluciones
String

Lanza
DeviceNotAvailableException

obtener modo de recuperación

public ITestDevice.RecoveryMode getRecoveryMode ()

Devoluciones
ITestDevice.RecoveryMode

obtener captura de pantalla

public InputStreamSource getScreenshot (String format)

Parámetros
format String

Devoluciones
InputStreamSource

Lanza
DeviceNotAvailableException

obtener captura de pantalla

public InputStreamSource getScreenshot (long displayId)

Parámetros
displayId long

Devoluciones
InputStreamSource

Lanza
DeviceNotAvailableException

obtener captura de pantalla

public InputStreamSource getScreenshot (String format, 
                boolean rescale)

Parámetros
format String

rescale boolean

Devoluciones
InputStreamSource

Lanza
DeviceNotAvailableException

obtener captura de pantalla

public InputStreamSource getScreenshot ()

Devoluciones
InputStreamSource

Lanza
DeviceNotAvailableException

obtener número de serie

public String getSerialNumber ()

Devoluciones
String

obtener configuración

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

Parámetros
userId int

namespace String

key String

Devoluciones
String

Lanza
DeviceNotAvailableException

obtener configuración

public String getSetting (String namespace, 
                String key)

Parámetros
namespace String

key String

Devoluciones
String

Lanza
DeviceNotAvailableException

obtenerSimOperador

public String getSimOperator ()

Devoluciones
String

getSimState

public String getSimState ()

Devoluciones
String

obtener lápidas

public  getTombstones ()

Devoluciones

Lanza
DeviceNotAvailableException

obtener memoria total

public long getTotalMemory ()

Devoluciones
long

getUninstallablePackageNames

public  getUninstallablePackageNames ()

Devoluciones

Lanza
DeviceNotAvailableException

getUseFastbootErase

public boolean getUseFastbootErase ()

Devoluciones
boolean

obtener banderas de usuario

public int getUserFlags (int userId)

Parámetros
userId int

Devoluciones
int

Lanza
DeviceNotAvailableException

obtener información de usuario

public  getUserInfos ()

Devoluciones

Lanza
DeviceNotAvailableException

getUserSerialNumber

public int getUserSerialNumber (int userId)

Parámetros
userId int

Devoluciones
int

Lanza
DeviceNotAvailableException

manejarAllocationEvent

public IManagedTestDevice.DeviceEventResponse handleAllocationEvent (DeviceEvent event)

Procese el DeviceEvent, que puede o no hacer la transición de este dispositivo a un nuevo estado de asignación.

Parámetros
event DeviceEvent

Devoluciones
IManagedTestDevice.DeviceEventResponse

tiene característica

public boolean hasFeature (String feature)

Parámetros
feature String

Devoluciones
boolean

Lanza
DeviceNotAvailableException

paquete de instalación

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

Parámetros
packageFile File

reinstall boolean

extraArgs String

Devoluciones
String

Lanza
DeviceNotAvailableException

paquete de instalación

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

Parámetros
packageFile File

reinstall boolean

grantPermissions boolean

extraArgs String

Devoluciones
String

Lanza
DeviceNotAvailableException

instalarPaqueteParaUsuario

public String installPackageForUser (File packageFile, 
                boolean reinstall, 
                int userId, 
                String... extraArgs)

Parámetros
packageFile File

reinstall boolean

userId int

extraArgs String

Devoluciones
String

Lanza
DeviceNotAvailableException

instalarPaqueteParaUsuario

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

Devoluciones
String

Lanza
DeviceNotAvailableException

esAdbRoot

public boolean isAdbRoot ()

Devoluciones
boolean

Lanza
DeviceNotAvailableException

esAdbTcp

public boolean isAdbTcp ()

Devoluciones
boolean

isAppEnumerationSupported

public boolean isAppEnumerationSupported ()

Devoluciones
boolean

Lanza
DeviceNotAvailableException

isDeviceEncrypted

public boolean isDeviceEncrypted ()

Devoluciones
boolean

Lanza
DeviceNotAvailableException

esDirectorio

public boolean isDirectory (String path)

Parámetros
path String

Devoluciones
boolean

Lanza
DeviceNotAvailableException

isEnableAdbRoot

public boolean isEnableAdbRoot ()

Devoluciones
boolean true si adb root debe estar habilitado en el dispositivo

isEncryptionSupported

public boolean isEncryptionSupported ()

Devoluciones
boolean

Lanza
DeviceNotAvailableException

es ejecutable

public boolean isExecutable (String fullPath)

Parámetros
fullPath String

Devoluciones
boolean

Lanza
DeviceNotAvailableException

estáFastbootEnabled

public boolean isFastbootEnabled ()

Devoluciones
boolean

es sin cabeza

public boolean isHeadless ()

Devoluciones
boolean

Lanza
DeviceNotAvailableException

es compatible con múltiples usuarios

public boolean isMultiUserSupported ()

Devoluciones
boolean

Lanza
DeviceNotAvailableException

isPackageInstalled

public boolean isPackageInstalled (String packageName, 
                String userId)

Parámetros
packageName String

userId String

Devoluciones
boolean

Lanza
DeviceNotAvailableException

isPackageInstalled

public boolean isPackageInstalled (String packageName)

Parámetros
packageName String

Devoluciones
boolean

Lanza
DeviceNotAvailableException

isRuntimePermissionSupported

public boolean isRuntimePermissionSupported ()

Devoluciones
boolean

Lanza
DeviceNotAvailableException

esStateBootloaderOrFastbootd

public boolean isStateBootloaderOrFastbootd ()

Devoluciones
boolean

esUsuarioRunning

public boolean isUserRunning (int userId)

Parámetros
userId int

Devoluciones
boolean

Lanza
DeviceNotAvailableException

esUsuarioSecundario

public boolean isUserSecondary (int userId)

Parámetros
userId int

Devoluciones
boolean

Lanza
DeviceNotAvailableException

está habilitado para Wifi

public boolean isWifiEnabled ()

Devoluciones
boolean

Lanza
DeviceNotAvailableException

listaDisplayIds

public  listDisplayIds ()

Devoluciones

Lanza
DeviceNotAvailableException

listaUsuarios

public  listUsers ()

Devoluciones

Lanza
DeviceNotAvailableException

logBugreport

public boolean logBugreport (String dataName, 
                ITestLogger listener)

Parámetros
dataName String

listener ITestLogger

Devoluciones
boolean

iniciar sesión en el dispositivo

public void logOnDevice (String tag, 
                Log.LogLevel level, 
                String format, 
                Object... args)

Parámetros
tag String

level Log.LogLevel

format String

args Object

Reinicio sin bloqueo

public void nonBlockingReboot ()

Lanza
DeviceNotAvailableException

postAdbRootAction

public void postAdbRootAction ()

Anule si el dispositivo necesita que se realicen algunas acciones específicas después de adb root y antes de que el dispositivo vuelva a estar en línea. La implementación predeterminada no incluye ninguna acción adicional. No se garantiza que adb root esté habilitado en esta etapa.

Lanza
DeviceNotAvailableException

postAdbUnrootAcción

public void postAdbUnrootAction ()

Anule si el dispositivo necesita que se realicen algunas acciones específicas después de desrootear adb y antes de que el dispositivo vuelva a estar en línea. La implementación predeterminada no incluye ninguna acción adicional. No se garantiza que adb root esté deshabilitado en esta etapa.

Lanza
DeviceNotAvailableException

configuración posterior al arranque

public void postBootSetup ()

Lanza
DeviceNotAvailableException

postInvocaciónTearDown

public void postInvocationTearDown (Throwable exception)

Parámetros
exception Throwable

configuración previa a la invocación

public void preInvocationSetup (IBuildInfo info, 
                MultiMap<String, String> attributes)

Parámetros
info IBuildInfo

attributes MultiMap

Lanza
DeviceNotAvailableException
TargetSetupError

tirarDir

public boolean pullDir (String deviceFilePath, 
                File localDir)

Parámetros
deviceFilePath String

localDir File

Devoluciones
boolean

Lanza
DeviceNotAvailableException

extraer archivo

public boolean pullFile (String remoteFilePath, 
                File localFile)

Parámetros
remoteFilePath String

localFile File

Devoluciones
boolean

Lanza
DeviceNotAvailableException

extraer archivo

public File pullFile (String remoteFilePath)

Parámetros
remoteFilePath String

Devoluciones
File

Lanza
DeviceNotAvailableException

pullFileContents

public String pullFileContents (String remoteFilePath)

Parámetros
remoteFilePath String

Devoluciones
String

Lanza
DeviceNotAvailableException

extraer archivo de externo

public File pullFileFromExternal (String remoteFilePath)

Parámetros
remoteFilePath String

Devoluciones
File

Lanza
DeviceNotAvailableException

empujarDir

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

Parámetros
localFileDir File

deviceFilePath String

excludedDirectories

Devoluciones
boolean

Lanza
DeviceNotAvailableException

empujarDir

public boolean pushDir (File localFileDir, 
                String deviceFilePath)

Parámetros
localFileDir File

deviceFilePath String

Devoluciones
boolean

Lanza
DeviceNotAvailableException

empujar archivo

public boolean pushFile (File localFile, 
                String remoteFilePath)

Parámetros
localFile File

remoteFilePath String

Devoluciones
boolean

Lanza
DeviceNotAvailableException

empujar cadena

public boolean pushString (String contents, 
                String remoteFilePath)

Parámetros
contents String

remoteFilePath String

Devoluciones
boolean

Lanza
DeviceNotAvailableException

reiniciar

public void reboot (String reason)

Parámetros
reason String

Lanza
DeviceNotAvailableException

reiniciar

public void reboot ()

Lanza
DeviceNotAvailableException

reiniciar en el cargador de arranque

public void rebootIntoBootloader ()

Lanza
DeviceNotAvailableException

reiniciar en Fastbootd

public void rebootIntoFastbootd ()

Lanza
DeviceNotAvailableException

reiniciar en recuperación

public void rebootIntoRecovery ()

Lanza
DeviceNotAvailableException

reiniciar en carga lateral

public void rebootIntoSideload ()

Lanza
DeviceNotAvailableException

reiniciar en carga lateral

public void rebootIntoSideload (boolean autoReboot)

Parámetros
autoReboot boolean

Lanza
DeviceNotAvailableException

reiniciar hasta que esté en línea

public void rebootUntilOnline ()

Lanza
DeviceNotAvailableException

reiniciar hasta que esté en línea

public void rebootUntilOnline (String reason)

Parámetros
reason String

Lanza
DeviceNotAvailableException

reiniciarEspacio de usuario

public void rebootUserspace ()

Lanza
DeviceNotAvailableException

reiniciarUserspaceHasta estar en línea

public void rebootUserspaceUntilOnline ()

Lanza
DeviceNotAvailableException

recuperar dispositivo

public void recoverDevice ()

Intenta recuperar la comunicación del dispositivo.

Lanza
DeviceNotAvailableException si el dispositivo ya no está disponible

remontarSistemaEscribible

public void remountSystemWritable ()

Lanza
DeviceNotAvailableException

remontarProveedorEscribible

public void remountVendorWritable ()

Lanza
DeviceNotAvailableException

eliminarAdmin

public boolean removeAdmin (String componentName, 
                int userId)

Parámetros
componentName String

userId int

Devoluciones
boolean

Lanza
DeviceNotAvailableException

eliminarPropietarios

public void removeOwners ()

Lanza
DeviceNotAvailableException

eliminarUsuario

public boolean removeUser (int userId)

Parámetros
userId int

Devoluciones
boolean

Lanza
DeviceNotAvailableException

restablecerContentProviderSetup

public void resetContentProviderSetup ()

Restablezca el indicador para la configuración del proveedor de contenido para activarlo nuevamente.

ejecutar pruebas de instrumentación

public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner, 
                ITestLifeCycleReceiver... listeners)

Parámetros
runner IRemoteAndroidTestRunner

listeners ITestLifeCycleReceiver

Devoluciones
boolean

Lanza
DeviceNotAvailableException

ejecutar pruebas de instrumentación

public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner, 
                 listeners)

Parámetros
runner IRemoteAndroidTestRunner

listeners

Devoluciones
boolean

Lanza
DeviceNotAvailableException

ejecutarInstrumentationTestsAsUser

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

Parámetros
runner IRemoteAndroidTestRunner

userId int

listeners ITestLifeCycleReceiver

Devoluciones
boolean

Lanza
DeviceNotAvailableException

ejecutarInstrumentationTestsAsUser

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

Parámetros
runner IRemoteAndroidTestRunner

userId int

listeners

Devoluciones
boolean

Lanza
DeviceNotAvailableException

establecer configuración

public void setConfiguration (IConfiguration configuration)

Inyecta la IConfiguration en uso.

Parámetros
configuration IConfiguration

Establece la fecha

public void setDate (Date date)

Parámetros
date Date

Lanza
DeviceNotAvailableException

establecerPropietario del dispositivo

public boolean setDeviceOwner (String componentName, 
                int userId)

Parámetros
componentName String

userId int

Devoluciones
boolean

Lanza
DeviceNotAvailableException

establecer estado del dispositivo

public void setDeviceState (TestDeviceState deviceState)

Parámetros
deviceState TestDeviceState

setEmulatorOutputStream

public void setEmulatorOutputStream (SizeLimitedOutputStream output)

Para el emulador, configure SizeLimitedOutputStream para registrar la salida

Parámetros
output SizeLimitedOutputStream : para registrar la salida

setEmulatorProcess

public void setEmulatorProcess (Process p)

Parámetros
p Process

establecerFastbootEnabled

public void setFastbootEnabled (boolean fastbootEnabled)

Parámetros
fastbootEnabled boolean

establecerRutaFastboot

public void setFastbootPath (String fastbootPath)

Parámetros
fastbootPath String

establecerIDispositivo

public void setIDevice (IDevice newDevice)

Parámetros
newDevice IDevice

establecer opciones

public void setOptions (TestDeviceOptions options)

Parámetros
options TestDeviceOptions

establecer propiedad

public boolean setProperty (String propKey, 
                String propValue)

Parámetros
propKey String

propValue String

Devoluciones
boolean

Lanza
DeviceNotAvailableException

establecer recuperación

public void setRecovery (IDeviceRecovery recovery)

Parámetros
recovery IDeviceRecovery

establecer modo de recuperación

public void setRecoveryMode (ITestDevice.RecoveryMode mode)

Parámetros
mode ITestDevice.RecoveryMode

establecerConfiguración

public void setSetting (String namespace, 
                String key, 
                String value)

Parámetros
namespace String

key String

value String

Lanza
DeviceNotAvailableException

establecerConfiguración

public void setSetting (int userId, 
                String namespace, 
                String key, 
                String value)

Parámetros
userId int

namespace String

key String

value String

Lanza
DeviceNotAvailableException

setUseFastbootErase

public void setUseFastbootErase (boolean useFastbootErase)

Parámetros
useFastbootErase boolean

inicioLogcat

public void startLogcat ()

inicioUsuario

public boolean startUser (int userId)

Parámetros
userId int

Devoluciones
boolean

Lanza
DeviceNotAvailableException

inicioUsuario

public boolean startUser (int userId, 
                boolean waitFlag)

Parámetros
userId int

waitFlag boolean

Devoluciones
boolean

Lanza
DeviceNotAvailableException

detenerEmulatorSalida

public void stopEmulatorOutput ()

detenerLogcat

public void stopLogcat ()

detener usuario

public boolean stopUser (int userId)

Parámetros
userId int

Devoluciones
boolean

Lanza
DeviceNotAvailableException

detener usuario

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

Parámetros
userId int

waitFlag boolean

forceFlag boolean

Devoluciones
boolean

Lanza
DeviceNotAvailableException

cambiarAAdbTcp

public String switchToAdbTcp ()

Devoluciones
String

Lanza
DeviceNotAvailableException

cambiarAAdbUsb

public boolean switchToAdbUsb ()

Devoluciones
boolean

Lanza
DeviceNotAvailableException

cambiar de usuario

public boolean switchUser (int userId)

Parámetros
userId int

Devoluciones
boolean

Lanza
DeviceNotAvailableException

cambiar de usuario

public boolean switchUser (int userId, 
                long timeout)

Parámetros
userId int

timeout long

Devoluciones
boolean

Lanza
DeviceNotAvailableException

sincronizar archivos

public boolean syncFiles (File localFileDir, 
                String deviceFilePath)

Parámetros
localFileDir File

deviceFilePath String

Devoluciones
boolean

Lanza
DeviceNotAvailableException

tomarBugreport

public Bugreport takeBugreport ()

Devoluciones
Bugreport

desencriptarDispositivo

public boolean unencryptDevice ()

Devoluciones
boolean

Lanza
DeviceNotAvailableException

desinstalar paquete

public String uninstallPackage (String packageName)

Parámetros
packageName String

Devoluciones
String

Lanza
DeviceNotAvailableException

desinstalarPackageForUser

public String uninstallPackageForUser (String packageName, 
                int userId)

Parámetros
packageName String

userId int

Devoluciones
String

Lanza
DeviceNotAvailableException

desbloquear dispositivo

public boolean unlockDevice ()

Devoluciones
boolean

Lanza
DeviceNotAvailableException

esperar para arrancar completo

public boolean waitForBootComplete (long timeOut)

Parámetros
timeOut long

Devoluciones
boolean

Lanza
DeviceNotAvailableException

esperar por dispositivo disponible

public void waitForDeviceAvailable ()

Lanza
DeviceNotAvailableException

esperar por dispositivo disponible

public void waitForDeviceAvailable (long waitTime)

Parámetros
waitTime long

Lanza
DeviceNotAvailableException

esperar para el dispositivo en recuperación

public boolean waitForDeviceInRecovery (long waitTime)

Parámetros
waitTime long

Devoluciones
boolean

esperar para la carga lateral del dispositivo

public boolean waitForDeviceInSideload (long waitTime)

Parámetros
waitTime long

Devoluciones
boolean

esperar por dispositivo no disponible

public boolean waitForDeviceNotAvailable (long waitTime)

Parámetros
waitTime long

Devoluciones
boolean

esperar por dispositivo en línea

public void waitForDeviceOnline ()

Lanza
DeviceNotAvailableException

esperar por dispositivo en línea

public void waitForDeviceOnline (long waitTime)

Parámetros
waitTime long

Lanza
DeviceNotAvailableException

esperar paraDeviceShell

public boolean waitForDeviceShell (long waitTime)

Parámetros
waitTime long

Devoluciones
boolean

Métodos protegidos

checkApiLevelContra

protected void checkApiLevelAgainst (String feature, 
                int strictMinLevel)

Parámetros
feature String

strictMinLevel int

crearRebootDeviceAction

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

Cree una RebootDeviceAction para usarla al realizar una acción de reinicio.

Parámetros
rebootMode NativeDevice.RebootMode : un modo de este reinicio.

reason String : para este reinicio.

Devoluciones
NativeDevice.RebootDeviceAction la RebootDeviceAction creada.

doAdbReiniciar

protected void doAdbReboot (NativeDevice.RebootMode rebootMode, 
                String reason)

Realice un reinicio de adb.

Parámetros
rebootMode NativeDevice.RebootMode : un modo de este reinicio.

reason String : para este reinicio.

Lanza
DeviceNotAvailableException

asegurarRuntimePermissionSupported

protected void ensureRuntimePermissionSupported ()

método auxiliar para lanzar una excepción si el permiso de tiempo de ejecución no es compatible

Lanza
DeviceNotAvailableException

getBugreportInternal

protected InputStreamSource getBugreportInternal ()

Devoluciones
InputStreamSource

getBugreportzInterno

protected File getBugreportzInternal ()

Método de ayuda interna para obtener el archivo zip del informe de error como ERROR(/File) .

Devoluciones
File

obtenerRunUtil

protected IRunUtil getRunUtil ()

Obtenga la instancia RunUtil para usar.

Devoluciones
IRunUtil

propiedad internaGet

protected String internalGetProperty (String propName, 
                String fastbootVar, 
                String description)

Obtenga una propiedad del dispositivo, desde la caché ddmlib de forma predeterminada, y recurra a `adb shell getprop` o `fastboot getvar` dependiendo de si el dispositivo está en Fastboot o no.

Parámetros
propName String : el nombre de la propiedad del dispositivo devuelto por `adb shell getprop`

fastbootVar String : el nombre de la variable fastboot equivalente a consultar. si es null , no se intentará la consulta fastboot

description String : una descripción simple de la variable. La primera letra debe estar en mayúscula.

Devoluciones
String Una cadena, posiblemente null o vacía, que contiene el valor de la propiedad dada

Lanza
DeviceNotAvailableException

es más nuevo

protected boolean isNewer (File localFile, 
                IFileEntry entry)

Devuelve true si el archivo local es más nuevo que el archivo remoto. Siendo IFileEntry una precisión al minuto, en caso de tiempos iguales, el archivo se considerará más nuevo.

Parámetros
localFile File

entry IFileEntry

Devoluciones
boolean

realizarDeviceAction

protected boolean performDeviceAction (String actionDescription, 
                com.android.tradefed.device.NativeDevice.DeviceAction action, 
                int retryAttempts)

Realiza una acción en este dispositivo. Intenta recuperar el dispositivo y, opcionalmente, reintentar el comando si la acción falla.

Parámetros
actionDescription String : una breve descripción de la acción a realizar. Se utiliza únicamente con fines de registro.

action com.android.tradefed.device.NativeDevice.DeviceAction : la acción a realizar

retryAttempts int : el reintento intenta realizar una acción si falla pero la recuperación tiene éxito

Devoluciones
boolean true si la acción se realizó correctamente

Lanza
DeviceNotAvailableException si el intento de recuperación falla o los intentos máximos se realizan sin éxito

postAdbReboot

protected void postAdbReboot ()

Posibles acciones adicionales que se pueden realizar después de reiniciar.

Lanza
DeviceNotAvailableException

configuración previa al inicio del arranque

protected void prePostBootSetup ()

Permite que cada tipo de dispositivo (AndroidNativeDevice, TestDevice) anule este método para una configuración posterior al arranque específica.

Lanza
DeviceNotAvailableException

establecer reloj

protected void setClock (Clock clock)

Configure la instancia de reloj que se utilizará.

Parámetros
clock Clock

establecerLogStartDelay

protected void setLogStartDelay (int delay)

Establece el tiempo en ms que se debe esperar antes de iniciar la captura de logcat para un dispositivo en línea.

Parámetros
delay int : el retraso en ms

esperar por dispositivo no disponible

protected void waitForDeviceNotAvailable (String operationDesc, 
                long time)

Parámetros
operationDesc String

time long