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. |
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 |
Lanza |
---|
DeviceNotAvailableException | |
checkConectividad
public boolean checkConnectivity ()
Lanza |
---|
DeviceNotAvailableException | |
clearErrorDiálogos
public boolean clearErrorDialogs ()
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 |
Lanza |
---|
DeviceNotAvailableException | |
conectarse a la red wifi
public boolean connectToWifiNetwork (String wifiSsid,
String wifiPsk,
boolean scanSsid)
Parámetros |
---|
wifiSsid | String |
wifiPsk | String |
scanSsid | 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 |
Lanza |
---|
DeviceNotAvailableException | |
conectarse a la red Wifi si es necesario
public boolean connectToWifiNetworkIfNeeded (String wifiSsid,
String wifiPsk)
Parámetros |
---|
wifiSsid | String |
wifiPsk | String |
Lanza |
---|
DeviceNotAvailableException | |
crear usuario
public int createUser (String name,
boolean guest,
boolean ephemeral)
Parámetros |
---|
name | String |
guest | boolean |
ephemeral | boolean |
Lanza |
---|
DeviceNotAvailableException | |
crear usuario
public int createUser (String name)
Lanza |
---|
DeviceNotAvailableException | |
crearUsuarioNoThrow
public int createUserNoThrow (String name)
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 |
Lanza |
---|
DeviceNotAvailableException | |
dispositivoSoftRestartedDesde
public boolean deviceSoftRestartedSince (long utcEpochTime,
TimeUnit timeUnit)
Parámetros |
---|
utcEpochTime | long |
timeUnit | TimeUnit |
Lanza |
---|
DeviceNotAvailableException | |
desactivarAdbRoot
public boolean disableAdbRoot ()
Lanza |
---|
DeviceNotAvailableException | |
desactivar Keyguard
public void disableKeyguard ()
Lanza |
---|
DeviceNotAvailableException | |
desactivarNetworkMonitor
public boolean disableNetworkMonitor ()
Lanza |
---|
DeviceNotAvailableException | |
desconectarse de Wifi
public boolean disconnectFromWifi ()
Lanza |
---|
DeviceNotAvailableException | |
¿Existe el archivo?
public boolean doesFileExist (String deviceFilePath)
Parámetros |
---|
deviceFilePath | String |
Lanza |
---|
DeviceNotAvailableException | |
montón de volcado
public File dumpHeap (String process,
String devicePath)
Parámetros |
---|
process | String |
devicePath | String |
Lanza |
---|
DeviceNotAvailableException | |
habilitarAdbRoot
public boolean enableAdbRoot ()
Lanza |
---|
DeviceNotAvailableException | |
habilitarNetworkMonitor
public boolean enableNetworkMonitor ()
Lanza |
---|
DeviceNotAvailableException | |
cifrar dispositivo
public boolean encryptDevice (boolean inplace)
Parámetros |
---|
inplace | boolean |
Lanza |
---|
DeviceNotAvailableException | |
ejecutarAdbCommand
public String executeAdbCommand (long timeout,
String... cmdArgs)
Parámetros |
---|
timeout | long |
cmdArgs | String |
Lanza |
---|
DeviceNotAvailableException | |
ejecutarAdbCommand
public String executeAdbCommand (String... cmdArgs)
Parámetros |
---|
cmdArgs | 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 |
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)
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 ()
Lanza |
---|
DeviceNotAvailableException | |
obtener todas las configuraciones
public getAllSettings (String namespace)
Parámetros |
---|
namespace | String |
Lanza |
---|
DeviceNotAvailableException | |
obtener estado de asignación
public DeviceAllocationState getAllocationState ()
Devoluciones |
---|
DeviceAllocationState | |
obtenerID de Android
public String getAndroidId (int userId)
Lanza |
---|
DeviceNotAvailableException | |
obtenerIds de Android
public getAndroidIds ()
Lanza |
---|
DeviceNotAvailableException | |
obtenerApiLevel
public int getApiLevel ()
Lanza |
---|
DeviceNotAvailableException | |
getAppPackageInfo
public PackageInfo getAppPackageInfo (String packageName)
Parámetros |
---|
packageName | String |
Lanza |
---|
DeviceNotAvailableException | |
getAppPackageInfos
public getAppPackageInfos ()
Lanza |
---|
DeviceNotAvailableException | |
getBasebandVersion
public String getBasebandVersion ()
Lanza |
---|
DeviceNotAvailableException | |
obtener batería
public Integer getBattery ()
obtener propiedad booleana
public boolean getBooleanProperty (String name,
boolean defaultValue)
Parámetros |
---|
name | String |
defaultValue | boolean |
Lanza |
---|
DeviceNotAvailableException | |
obtenerHistorial de arranque
public getBootHistory ()
Lanza |
---|
DeviceNotAvailableException | |
getBootHistoryDesde
public getBootHistorySince (long utcEpochTime,
TimeUnit timeUnit)
Parámetros |
---|
utcEpochTime | long |
timeUnit | TimeUnit |
Lanza |
---|
DeviceNotAvailableException | |
obtener la versión del cargador de arranque
public String getBootloaderVersion ()
Lanza |
---|
DeviceNotAvailableException | |
obtener informe de errores
public InputStreamSource getBugreport ()
Devoluciones |
---|
InputStreamSource | |
getBugreportz
public InputStreamSource getBugreportz ()
Devoluciones |
---|
InputStreamSource | |
getBuildAlias
public String getBuildAlias ()
Lanza |
---|
DeviceNotAvailableException | |
getBuildFlavor
public String getBuildFlavor ()
Lanza |
---|
DeviceNotAvailableException | |
obtener ID de compilación
public String getBuildId ()
Lanza |
---|
DeviceNotAvailableException | |
obtener claves de firma de compilación
public String getBuildSigningKeys ()
Lanza |
---|
DeviceNotAvailableException | |
getCachedDeviceDescriptor
public DeviceDescriptor getCachedDeviceDescriptor ()
Devoluciones |
---|
DeviceDescriptor | |
obtener niños
public String[] getChildren (String path)
Lanza |
---|
DeviceNotAvailableException | |
getCurrentFoldableState
public DeviceFoldableState getCurrentFoldableState ()
Devoluciones |
---|
DeviceFoldableState | |
Lanza |
---|
DeviceNotAvailableException | |
obtener usuario actual
public int getCurrentUser ()
Lanza |
---|
DeviceNotAvailableException | |
getDeviceClass
public String getDeviceClass ()
obtener fecha del dispositivo
public long getDeviceDate ()
Lanza |
---|
DeviceNotAvailableException | |
getDeviceDescriptor
public DeviceDescriptor getDeviceDescriptor ()
Devoluciones |
---|
DeviceDescriptor | |
obtener estado del dispositivo
public TestDeviceState getDeviceState ()
Devoluciones |
---|
TestDeviceState | |
getDeviceTimeOffset
public long getDeviceTimeOffset (Date date)
Lanza |
---|
DeviceNotAvailableException | |
obtener salida del emulador
public InputStreamSource getEmulatorOutput ()
Devoluciones |
---|
InputStreamSource | |
obtenerProcesoEmulator
public Process getEmulatorProcess ()
getExecuteShellCommandLog
public final File getExecuteShellCommandLog ()
El registro que contiene todos los registros executeShellCommand(String)
.
getExternalStoreFreeSpace
public long getExternalStoreFreeSpace ()
Lanza |
---|
DeviceNotAvailableException | |
obtenerRutaFastboot
public String getFastbootPath ()
getFastbootProductType
public String getFastbootProductType ()
Lanza |
---|
DeviceNotAvailableException | |
getFastbootProductVariant
public String getFastbootProductVariant ()
Lanza |
---|
DeviceNotAvailableException | |
obtener el número de serie de Fastboot
public String getFastbootSerialNumber ()
obtenerFastbootVariable
public String getFastbootVariable (String variableName)
Parámetros |
---|
variableName | String |
Lanza |
---|
DeviceNotAvailableException | |
obtener la versión Fastboot
public String getFastbootVersion ()
getFileEntry
public IFileEntry getFileEntry (String path)
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. |
Lanza |
---|
DeviceNotAvailableException | |
getFoldableStates
public getFoldableStates ()
Lanza |
---|
DeviceNotAvailableException | |
obtenerIDevice
public IDevice getIDevice ()
getInstalledPackageNames
public getInstalledPackageNames ()
Lanza |
---|
DeviceNotAvailableException | |
obtenerPropiedadInt
public long getIntProperty (String name,
long defaultValue)
Parámetros |
---|
name | String |
defaultValue | long |
Lanza |
---|
DeviceNotAvailableException | |
obtener dirección IP
public String getIpAddress ()
Lanza |
---|
DeviceNotAvailableException | |
getKeyguardState
public KeyguardControllerState getKeyguardState ()
Devoluciones |
---|
KeyguardControllerState | |
Lanza |
---|
DeviceNotAvailableException | |
getLastExpectedRebootTimeMillis
public long getLastExpectedRebootTimeMillis ()
getLaunchApiLevel
public int getLaunchApiLevel ()
Lanza |
---|
DeviceNotAvailableException | |
obtenerLogcat
public InputStreamSource getLogcat ()
Devoluciones |
---|
InputStreamSource | |
obtenerLogcat
public InputStreamSource getLogcat (int maxBytes)
Devoluciones |
---|
InputStreamSource | |
obtenerLogcatDump
public InputStreamSource getLogcatDump ()
Devoluciones |
---|
InputStreamSource | |
getLogcatDesde
public InputStreamSource getLogcatSince (long date)
Devoluciones |
---|
InputStreamSource | |
obtener dirección Mac
public String getMacAddress ()
getMainlineModuleInfo
public getMainlineModuleInfo ()
Lanza |
---|
DeviceNotAvailableException | |
public int getMaxNumberOfRunningUsersSupported ()
Lanza |
---|
DeviceNotAvailableException | |
public int getMaxNumberOfUsersSupported ()
Lanza |
---|
DeviceNotAvailableException | |
obtenerMonitor
public IDeviceStateMonitor getMonitor ()
Devoluciones |
---|
IDeviceStateMonitor | |
obtenerMountPoint
public String getMountPoint (String mountName)
Parámetros |
---|
mountName | 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 ()
Lanza |
---|
DeviceNotAvailableException | |
obtener Opciones
public TestDeviceOptions getOptions ()
Devoluciones |
---|
TestDeviceOptions | |
obtenerParticiónLibreEspacio
public long getPartitionFreeSpace (String partition)
Parámetros |
---|
partition | String |
Lanza |
---|
DeviceNotAvailableException | |
obtener ID de usuario principal
public Integer getPrimaryUserId ()
Lanza |
---|
DeviceNotAvailableException | |
obtenerProcesoPorNombre
public ProcessInfo getProcessByName (String processName)
Parámetros |
---|
processName | String |
Lanza |
---|
DeviceNotAvailableException | |
obtenerPidProceso
public String getProcessPid (String process)
Parámetros |
---|
process | String |
Lanza |
---|
DeviceNotAvailableException | |
obtener tipo de producto
public String getProductType ()
Lanza |
---|
DeviceNotAvailableException | |
obtenerVarianteProducto
public String getProductVariant ()
Lanza |
---|
DeviceNotAvailableException | |
obtener propiedad
public String getProperty (String name)
Lanza |
---|
DeviceNotAvailableException | |
obtener modo de recuperación
public ITestDevice.RecoveryMode getRecoveryMode ()
Devoluciones |
---|
ITestDevice.RecoveryMode | |
obtener captura de pantalla
public InputStreamSource getScreenshot (String format)
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 ()
obtener configuración
public String getSetting (int userId,
String namespace,
String key)
Parámetros |
---|
userId | int |
namespace | String |
key | String |
Lanza |
---|
DeviceNotAvailableException | |
obtener configuración
public String getSetting (String namespace,
String key)
Parámetros |
---|
namespace | String |
key | String |
Lanza |
---|
DeviceNotAvailableException | |
obtenerSimOperador
public String getSimOperator ()
getSimState
public String getSimState ()
obtener lápidas
public getTombstones ()
Lanza |
---|
DeviceNotAvailableException | |
obtener memoria total
public long getTotalMemory ()
getUninstallablePackageNames
public getUninstallablePackageNames ()
Lanza |
---|
DeviceNotAvailableException | |
getUseFastbootErase
public boolean getUseFastbootErase ()
obtener banderas de usuario
public int getUserFlags (int userId)
Lanza |
---|
DeviceNotAvailableException | |
obtener información de usuario
public getUserInfos ()
Lanza |
---|
DeviceNotAvailableException | |
getUserSerialNumber
public int getUserSerialNumber (int userId)
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 |
Lanza |
---|
DeviceNotAvailableException | |
paquete de instalación
public String installPackage (File packageFile,
boolean reinstall,
String... extraArgs)
Parámetros |
---|
packageFile | File |
reinstall | boolean |
extraArgs | 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 |
Lanza |
---|
DeviceNotAvailableException | |
instalarPaqueteParaUsuario
public String installPackageForUser (File packageFile,
boolean reinstall,
int userId,
String... extraArgs)
Parámetros |
---|
packageFile | File |
reinstall | boolean |
userId | int |
extraArgs | 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 |
Lanza |
---|
DeviceNotAvailableException | |
esAdbRoot
public boolean isAdbRoot ()
Lanza |
---|
DeviceNotAvailableException | |
esAdbTcp
public boolean isAdbTcp ()
isAppEnumerationSupported
public boolean isAppEnumerationSupported ()
Lanza |
---|
DeviceNotAvailableException | |
isDeviceEncrypted
public boolean isDeviceEncrypted ()
Lanza |
---|
DeviceNotAvailableException | |
esDirectorio
public boolean isDirectory (String path)
Lanza |
---|
DeviceNotAvailableException | |
isEnableAdbRoot
public boolean isEnableAdbRoot ()
Devoluciones |
---|
boolean | true si adb root debe estar habilitado en el dispositivo |
isEncryptionSupported
public boolean isEncryptionSupported ()
Lanza |
---|
DeviceNotAvailableException | |
es ejecutable
public boolean isExecutable (String fullPath)
Parámetros |
---|
fullPath | String |
Lanza |
---|
DeviceNotAvailableException | |
estáFastbootEnabled
public boolean isFastbootEnabled ()
es sin cabeza
public boolean isHeadless ()
Lanza |
---|
DeviceNotAvailableException | |
es compatible con múltiples usuarios
public boolean isMultiUserSupported ()
Lanza |
---|
DeviceNotAvailableException | |
isPackageInstalled
public boolean isPackageInstalled (String packageName,
String userId)
Parámetros |
---|
packageName | String |
userId | String |
Lanza |
---|
DeviceNotAvailableException | |
isPackageInstalled
public boolean isPackageInstalled (String packageName)
Parámetros |
---|
packageName | String |
Lanza |
---|
DeviceNotAvailableException | |
isRuntimePermissionSupported
public boolean isRuntimePermissionSupported ()
Lanza |
---|
DeviceNotAvailableException | |
esStateBootloaderOrFastbootd
public boolean isStateBootloaderOrFastbootd ()
esUsuarioRunning
public boolean isUserRunning (int userId)
Lanza |
---|
DeviceNotAvailableException | |
esUsuarioSecundario
public boolean isUserSecondary (int userId)
Lanza |
---|
DeviceNotAvailableException | |
está habilitado para Wifi
public boolean isWifiEnabled ()
Lanza |
---|
DeviceNotAvailableException | |
listaDisplayIds
public listDisplayIds ()
Lanza |
---|
DeviceNotAvailableException | |
listaUsuarios
public listUsers ()
Lanza |
---|
DeviceNotAvailableException | |
logBugreport
public boolean logBugreport (String dataName,
ITestLogger listener)
Parámetros |
---|
dataName | String |
listener | ITestLogger |
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 |
Lanza |
---|
DeviceNotAvailableException | |
extraer archivo
public boolean pullFile (String remoteFilePath,
File localFile)
Parámetros |
---|
remoteFilePath | String |
localFile | File |
Lanza |
---|
DeviceNotAvailableException | |
extraer archivo
public File pullFile (String remoteFilePath)
Parámetros |
---|
remoteFilePath | String |
Lanza |
---|
DeviceNotAvailableException | |
pullFileContents
public String pullFileContents (String remoteFilePath)
Parámetros |
---|
remoteFilePath | String |
Lanza |
---|
DeviceNotAvailableException | |
extraer archivo de externo
public File pullFileFromExternal (String remoteFilePath)
Parámetros |
---|
remoteFilePath | String |
Lanza |
---|
DeviceNotAvailableException | |
empujarDir
public boolean pushDir (File localFileDir,
String deviceFilePath,
excludedDirectories)
Parámetros |
---|
localFileDir | File |
deviceFilePath | String |
excludedDirectories | |
Lanza |
---|
DeviceNotAvailableException | |
empujarDir
public boolean pushDir (File localFileDir,
String deviceFilePath)
Parámetros |
---|
localFileDir | File |
deviceFilePath | String |
Lanza |
---|
DeviceNotAvailableException | |
empujar archivo
public boolean pushFile (File localFile,
String remoteFilePath)
Parámetros |
---|
localFile | File |
remoteFilePath | String |
Lanza |
---|
DeviceNotAvailableException | |
empujar cadena
public boolean pushString (String contents,
String remoteFilePath)
Parámetros |
---|
contents | String |
remoteFilePath | String |
Lanza |
---|
DeviceNotAvailableException | |
reiniciar
public void reboot (String reason)
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)
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 |
Lanza |
---|
DeviceNotAvailableException | |
eliminarPropietarios
public void removeOwners ()
Lanza |
---|
DeviceNotAvailableException | |
eliminarUsuario
public boolean removeUser (int userId)
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 |
Lanza |
---|
DeviceNotAvailableException | |
ejecutar pruebas de instrumentación
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner,
listeners)
Parámetros |
---|
runner | IRemoteAndroidTestRunner |
listeners | |
Lanza |
---|
DeviceNotAvailableException | |
ejecutarInstrumentationTestsAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner,
int userId,
ITestLifeCycleReceiver... listeners)
Parámetros |
---|
runner | IRemoteAndroidTestRunner |
userId | int |
listeners | ITestLifeCycleReceiver |
Lanza |
---|
DeviceNotAvailableException | |
ejecutarInstrumentationTestsAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner,
int userId,
listeners)
Parámetros |
---|
runner | IRemoteAndroidTestRunner |
userId | int |
listeners | |
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)
Lanza |
---|
DeviceNotAvailableException | |
establecerPropietario del dispositivo
public boolean setDeviceOwner (String componentName,
int userId)
Parámetros |
---|
componentName | String |
userId | int |
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)
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 |
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)
Lanza |
---|
DeviceNotAvailableException | |
inicioUsuario
public boolean startUser (int userId,
boolean waitFlag)
Parámetros |
---|
userId | int |
waitFlag | boolean |
Lanza |
---|
DeviceNotAvailableException | |
detenerEmulatorSalida
public void stopEmulatorOutput ()
detenerLogcat
public void stopLogcat ()
detener usuario
public boolean stopUser (int userId)
Lanza |
---|
DeviceNotAvailableException | |
detener usuario
public boolean stopUser (int userId,
boolean waitFlag,
boolean forceFlag)
Parámetros |
---|
userId | int |
waitFlag | boolean |
forceFlag | boolean |
Lanza |
---|
DeviceNotAvailableException | |
cambiarAAdbTcp
public String switchToAdbTcp ()
Lanza |
---|
DeviceNotAvailableException | |
cambiarAAdbUsb
public boolean switchToAdbUsb ()
Lanza |
---|
DeviceNotAvailableException | |
cambiar de usuario
public boolean switchUser (int userId)
Lanza |
---|
DeviceNotAvailableException | |
cambiar de usuario
public boolean switchUser (int userId,
long timeout)
Parámetros |
---|
userId | int |
timeout | long |
Lanza |
---|
DeviceNotAvailableException | |
sincronizar archivos
public boolean syncFiles (File localFileDir,
String deviceFilePath)
Parámetros |
---|
localFileDir | File |
deviceFilePath | String |
Lanza |
---|
DeviceNotAvailableException | |
tomarBugreport
public Bugreport takeBugreport ()
desencriptarDispositivo
public boolean unencryptDevice ()
Lanza |
---|
DeviceNotAvailableException | |
desinstalar paquete
public String uninstallPackage (String packageName)
Parámetros |
---|
packageName | String |
Lanza |
---|
DeviceNotAvailableException | |
desinstalarPackageForUser
public String uninstallPackageForUser (String packageName,
int userId)
Parámetros |
---|
packageName | String |
userId | int |
Lanza |
---|
DeviceNotAvailableException | |
desbloquear dispositivo
public boolean unlockDevice ()
Lanza |
---|
DeviceNotAvailableException | |
esperar para arrancar completo
public boolean waitForBootComplete (long timeOut)
Lanza |
---|
DeviceNotAvailableException | |
esperar por dispositivo disponible
public void waitForDeviceAvailable ()
Lanza |
---|
DeviceNotAvailableException | |
esperar por dispositivo disponible
public void waitForDeviceAvailable (long waitTime)
Lanza |
---|
DeviceNotAvailableException | |
esperar para el dispositivo en recuperación
public boolean waitForDeviceInRecovery (long waitTime)
esperar para la carga lateral del dispositivo
public boolean waitForDeviceInSideload (long waitTime)
esperar por dispositivo no disponible
public boolean waitForDeviceNotAvailable (long waitTime)
esperar por dispositivo en línea
public void waitForDeviceOnline ()
Lanza |
---|
DeviceNotAvailableException | |
esperar por dispositivo en línea
public void waitForDeviceOnline (long waitTime)
Lanza |
---|
DeviceNotAvailableException | |
esperar paraDeviceShell
public boolean waitForDeviceShell (long waitTime)
Métodos protegidos
checkApiLevelContra
protected void checkApiLevelAgainst (String feature,
int strictMinLevel)
Parámetros |
---|
feature | String |
strictMinLevel | int |
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)
.
obtenerRunUtil
protected IRunUtil getRunUtil ()
Obtenga la instancia RunUtil
para usar.
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 |
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á.
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 |
El contenido y el código de ejemplo de esta página están sujetos a las licencias que se describen en la licencia de contenido. Java y OpenJDK son marcas registradas de Oracle o sus entidades asociadas.
Última actualización: 2023-12-01 (UTC).
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Me falta la información que necesito"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Es demasiado complicado o hay demasiados pasos"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Está obsoleto"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"Problema de traducción"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Problema de muestras o código"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Otro"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Es fácil de entender"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Me ofreció una solución al problema"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Otro"
}]