Clases anidadas |
---|
class | NativeDevice.AdbAction Una DeviceAction para ejecutar un comando del sistema operativo 'adb ....'. |
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 de 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 una 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 adb unroot 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 () Intentos de 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 la bandera para la configuración del proveedor de contenido para activarla 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 adb. |
void | ensureRuntimePermissionSupported () método auxiliar para lanzar una excepción si no se admite el permiso de tiempo de ejecución |
InputStreamSource | getBugreportInternal () |
File | getBugreportzInternal () Método auxiliar interno para obtener el archivo zip bugreportz como ERROR(/File) . |
IRunUtil | getRunUtil () Obtenga la instancia de RunUtil para usar. |
String | internalGetProperty (String propName, String fastbootVar, String description) Obtenga una propiedad del dispositivo, de la memoria 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 un reinicio. |
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) Establezca la instancia de Clock para usar. |
void | setLogStartDelay (int delay) Establece el tiempo de espera en ms 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/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 dispositivo de TestDevice
.
Parámetros |
---|
device | IDevice : el IDevice asociado |
stateMonitor | IDeviceStateMonitor : el mecanismo IDeviceStateMonitor para usar |
allocationMonitor | IDeviceMonitor : el IDeviceMonitor para informar de los cambios de estado de asignación. puede ser nulo |
Métodos públicos
comprobarApiLevelAgainstNextRelease
public boolean checkApiLevelAgainstNextRelease (int strictMinLevel)
Parámetros |
---|
strictMinLevel | int |
Lanza |
---|
DeviceNotAvailableException | |
checkConectividad
public boolean checkConnectivity ()
Lanza |
---|
DeviceNotAvailableException | |
borrar diálogos de error
public boolean clearErrorDialogs ()
Lanza |
---|
DeviceNotAvailableException | |
clearLastConnectedWifiNetwork
public void clearLastConnectedWifiNetwork ()
borrarLogcat
public void clearLogcat ()
conectarse a la red Wi-Fi
public boolean connectToWifiNetwork (String wifiSsid,
String wifiPsk)
Parámetros |
---|
wifiSsid | String |
wifiPsk | String |
Lanza |
---|
DeviceNotAvailableException | |
conectarse a la red Wi-Fi
public boolean connectToWifiNetwork (String wifiSsid,
String wifiPsk,
boolean scanSsid)
Parámetros |
---|
wifiSsid | String |
wifiPsk | String |
scanSsid | boolean |
Lanza |
---|
DeviceNotAvailableException | |
connectToWifiNetworkIfNeeded
public boolean connectToWifiNetworkIfNeeded (String wifiSsid,
String wifiPsk,
boolean scanSsid)
Parámetros |
---|
wifiSsid | String |
wifiPsk | String |
scanSsid | boolean |
Lanza |
---|
DeviceNotAvailableException | |
connectToWifiNetworkIfNeeded
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 | |
crearUsuarioNoLanzar
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 | |
deshabilitarAdbRoot
public boolean disableAdbRoot ()
Lanza |
---|
DeviceNotAvailableException | |
desactivar Keyguard
public void disableKeyguard ()
Lanza |
---|
DeviceNotAvailableException | |
deshabilitar NetworkMonitor
public boolean disableNetworkMonitor ()
Lanza |
---|
DeviceNotAvailableException | |
desconectar de wifi
public boolean disconnectFromWifi ()
Lanza |
---|
DeviceNotAvailableException | |
existe el archivo
public boolean doesFileExist (String deviceFilePath)
Parámetros |
---|
deviceFilePath | String |
Lanza |
---|
DeviceNotAvailableException | |
basurero
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 | |
ejecutarFastbootCommand
public CommandResult executeFastbootCommand (String... cmdArgs)
Parámetros |
---|
cmdArgs | String |
Devoluciones |
---|
CommandResult | |
Lanza |
---|
DeviceNotAvailableException | |
ejecutarFastbootCommand
public CommandResult executeFastbootCommand (long timeout,
String... cmdArgs)
Parámetros |
---|
timeout | long |
cmdArgs | String |
Devoluciones |
---|
CommandResult | |
Lanza |
---|
DeviceNotAvailableException | |
ejecutarLongFastbootCommand
public CommandResult executeLongFastbootCommand (String... cmdArgs)
Parámetros |
---|
cmdArgs | String |
Devoluciones |
---|
CommandResult | |
Lanza |
---|
DeviceNotAvailableException | |
ejecutarShellCommand
public String executeShellCommand (String command)
Parámetros |
---|
command | String |
Lanza |
---|
DeviceNotAvailableException | |
ejecutarShellCommand
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 | |
ejecutarShellCommand
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 | |
ejecutarShellCommand
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 | |
fastbootWipePartition
public CommandResult fastbootWipePartition (String partition)
Parámetros |
---|
partition | String |
Devoluciones |
---|
CommandResult | |
Lanza |
---|
DeviceNotAvailableException | |
getActiveApexes
public getActiveApexes ()
Lanza |
---|
DeviceNotAvailableException | |
getAllSettings
public getAllSettings (String namespace)
Parámetros |
---|
namespace | String |
Lanza |
---|
DeviceNotAvailableException | |
getAllocationState
public DeviceAllocationState getAllocationState ()
Devoluciones |
---|
DeviceAllocationState | |
obtenerAndroidId
public String getAndroidId (int userId)
Lanza |
---|
DeviceNotAvailableException | |
obtener ID 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 | |
obtenerBatería
public Integer getBattery ()
getBooleanProperty
public boolean getBooleanProperty (String name,
boolean defaultValue)
Parámetros |
---|
name | String |
defaultValue | boolean |
Lanza |
---|
DeviceNotAvailableException | |
getBootHistory
public getBootHistory ()
Lanza |
---|
DeviceNotAvailableException | |
getBootHistorySince
public getBootHistorySince (long utcEpochTime,
TimeUnit timeUnit)
Parámetros |
---|
utcEpochTime | long |
timeUnit | TimeUnit |
Lanza |
---|
DeviceNotAvailableException | |
getBootloaderVersion
public String getBootloaderVersion ()
Lanza |
---|
DeviceNotAvailableException | |
obtener informe de error
public InputStreamSource getBugreport ()
Devoluciones |
---|
InputStreamSource | |
getBugreportz
public InputStreamSource getBugreportz ()
Devoluciones |
---|
InputStreamSource | |
getBuildAlias
public String getBuildAlias ()
Lanza |
---|
DeviceNotAvailableException | |
getBuildFlavor
public String getBuildFlavor ()
Lanza |
---|
DeviceNotAvailableException | |
getBuildId
public String getBuildId ()
Lanza |
---|
DeviceNotAvailableException | |
getBuildSigningKeys
public String getBuildSigningKeys ()
Lanza |
---|
DeviceNotAvailableException | |
getCachedDeviceDescriptor
public DeviceDescriptor getCachedDeviceDescriptor ()
Devoluciones |
---|
DeviceDescriptor | |
obtenerniños
public String[] getChildren (String path)
Lanza |
---|
DeviceNotAvailableException | |
getCurrentFoldableState
public DeviceFoldableState getCurrentFoldableState ()
Devoluciones |
---|
DeviceFoldableState | |
Lanza |
---|
DeviceNotAvailableException | |
obtenerUsuarioActual
public int getCurrentUser ()
Lanza |
---|
DeviceNotAvailableException | |
getDeviceClass
public String getDeviceClass ()
getDeviceDate
public long getDeviceDate ()
Lanza |
---|
DeviceNotAvailableException | |
getDeviceDescriptor
public DeviceDescriptor getDeviceDescriptor ()
Devoluciones |
---|
DeviceDescriptor | |
getDeviceState
public TestDeviceState getDeviceState ()
Devoluciones |
---|
TestDeviceState | |
getDeviceTimeOffset
public long getDeviceTimeOffset (Date date)
Lanza |
---|
DeviceNotAvailableException | |
getEmulatorOutput
public InputStreamSource getEmulatorOutput ()
Devoluciones |
---|
InputStreamSource | |
getEmulatorProcess
public Process getEmulatorProcess ()
getExecuteShellCommandLog
public final File getExecuteShellCommandLog ()
El registro que contiene todos los registros de executeShellCommand(String)
.
getExternalStoreFreeSpace
public long getExternalStoreFreeSpace ()
Lanza |
---|
DeviceNotAvailableException | |
getFastbootPath
public String getFastbootPath ()
getFastbootProductType
public String getFastbootProductType ()
Lanza |
---|
DeviceNotAvailableException | |
getFastbootProductVariant
public String getFastbootProductVariant ()
Lanza |
---|
DeviceNotAvailableException | |
getFastbootSerialNumber
public String getFastbootSerialNumber ()
getFastbootVariable
public String getFastbootVariable (String variableName)
Parámetros |
---|
variableName | String |
Lanza |
---|
DeviceNotAvailableException | |
getFastbootVersion
public String getFastbootVersion ()
getFileEntry
public IFileEntry getFileEntry (String path)
Lanza |
---|
DeviceNotAvailableException | |
getFileEntry
public IFileEntry getFileEntry (FileListingService.FileEntry entry)
Ayudante no oficial para obtener una 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 requiere Ddmlib. |
Lanza |
---|
DeviceNotAvailableException | |
getFoldableStates
public getFoldableStates ()
Lanza |
---|
DeviceNotAvailableException | |
obtenerIDevice
public IDevice getIDevice ()
getInstalledPackageNames
public getInstalledPackageNames ()
Lanza |
---|
DeviceNotAvailableException | |
getIntProperty
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 | |
getLogcatDump
public InputStreamSource getLogcatDump ()
Devoluciones |
---|
InputStreamSource | |
getLogcatDesde
public InputStreamSource getLogcatSince (long date)
Devoluciones |
---|
InputStreamSource | |
obtenerMacAddress
public String getMacAddress ()
getMainlineModuleInfo
public getMainlineModuleInfo ()
Lanza |
---|
DeviceNotAvailableException | |
public int getMaxNumberOfRunningUsersSupported ()
Lanza |
---|
DeviceNotAvailableException | |
public int getMaxNumberOfUsersSupported ()
Lanza |
---|
DeviceNotAvailableException | |
obtenerMonitor
public IDeviceStateMonitor getMonitor ()
Devoluciones |
---|
IDeviceStateMonitor | |
obtenerPuntoMontaje
public String getMountPoint (String mountName)
Parámetros |
---|
mountName | String |
getMountPointInfo
public ITestDevice.MountPointInfo getMountPointInfo (String mountpoint)
Parámetros |
---|
mountpoint | String |
Devoluciones |
---|
ITestDevice.MountPointInfo | |
Lanza |
---|
DeviceNotAvailableException | |
getMountPointInfo
public getMountPointInfo ()
Lanza |
---|
DeviceNotAvailableException | |
getOptions
public TestDeviceOptions getOptions ()
Devoluciones |
---|
TestDeviceOptions | |
getPartitionFreeSpace
public long getPartitionFreeSpace (String partition)
Parámetros |
---|
partition | String |
Lanza |
---|
DeviceNotAvailableException | |
getPrimaryUserId
public Integer getPrimaryUserId ()
Lanza |
---|
DeviceNotAvailableException | |
obtenerProcesoPorNombre
public ProcessInfo getProcessByName (String processName)
Parámetros |
---|
processName | String |
Lanza |
---|
DeviceNotAvailableException | |
getProcessPid
public String getProcessPid (String process)
Parámetros |
---|
process | String |
Lanza |
---|
DeviceNotAvailableException | |
getProductType
public String getProductType ()
Lanza |
---|
DeviceNotAvailableException | |
getProductVariant
public String getProductVariant ()
Lanza |
---|
DeviceNotAvailableException | |
obtenerPropiedad
public String getProperty (String name)
Lanza |
---|
DeviceNotAvailableException | |
getRecoveryMode
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 | |
getSerialNumber
public String getSerialNumber ()
getSetting
public String getSetting (int userId,
String namespace,
String key)
Parámetros |
---|
userId | int |
namespace | String |
key | String |
Lanza |
---|
DeviceNotAvailableException | |
getSetting
public String getSetting (String namespace,
String key)
Parámetros |
---|
namespace | String |
key | String |
Lanza |
---|
DeviceNotAvailableException | |
getSimOperador
public String getSimOperator ()
obtenerSimState
public String getSimState ()
obtener lápidas
public getTombstones ()
Lanza |
---|
DeviceNotAvailableException | |
obtenerMemoriaTotal
public long getTotalMemory ()
getUninstallablePackageNames
public getUninstallablePackageNames ()
Lanza |
---|
DeviceNotAvailableException | |
getUseFastbootErase
public boolean getUseFastbootErase ()
getUserFlags
public int getUserFlags (int userId)
Lanza |
---|
DeviceNotAvailableException | |
getUserInfos
public getUserInfos ()
Lanza |
---|
DeviceNotAvailableException | |
getUserSerialNumber
public int getUserSerialNumber (int userId)
Lanza |
---|
DeviceNotAvailableException | |
handleAllocationEvent
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 | |
tieneCaracterí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 ()
isAppEnumerationSoportado
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 |
es compatible con el cifrado
public boolean isEncryptionSupported ()
Lanza |
---|
DeviceNotAvailableException | |
es ejecutable
public boolean isExecutable (String fullPath)
Parámetros |
---|
fullPath | String |
Lanza |
---|
DeviceNotAvailableException | |
isFastbootEnabled
public boolean isFastbootEnabled ()
es sin cabeza
public boolean isHeadless ()
Lanza |
---|
DeviceNotAvailableException | |
es multiusuario compatible
public boolean isMultiUserSupported ()
Lanza |
---|
DeviceNotAvailableException | |
esPaqueteInstalado
public boolean isPackageInstalled (String packageName,
String userId)
Parámetros |
---|
packageName | String |
userId | String |
Lanza |
---|
DeviceNotAvailableException | |
esPaqueteInstalado
public boolean isPackageInstalled (String packageName)
Parámetros |
---|
packageName | String |
Lanza |
---|
DeviceNotAvailableException | |
esRuntimePermissionSupported
public boolean isRuntimePermissionSupported ()
Lanza |
---|
DeviceNotAvailableException | |
isStateBootloader o Fastbootd
public boolean isStateBootloaderOrFastbootd ()
isUserRunning
public boolean isUserRunning (int userId)
Lanza |
---|
DeviceNotAvailableException | |
esUsuarioSecundario
public boolean isUserSecondary (int userId)
Lanza |
---|
DeviceNotAvailableException | |
esWifiEnabled
public boolean isWifiEnabled ()
Lanza |
---|
DeviceNotAvailableException | |
listDisplayIds
public listDisplayIds ()
Lanza |
---|
DeviceNotAvailableException | |
listaUsuarios
public listUsers ()
Lanza |
---|
DeviceNotAvailableException | |
informe de error de registro
public boolean logBugreport (String dataName,
ITestLogger listener)
Parámetros |
---|
dataName | String |
listener | ITestLogger |
iniciar sesión en 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 adb unroot 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ónDerribar
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 | |
pullDir
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 | |
empujarCadena
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 | |
reiniciarIntoFastbootd
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 | |
reiniciar espacio de usuario
public void rebootUserspace ()
Lanza |
---|
DeviceNotAvailableException | |
reiniciar Espacio de usuario hasta que esté en línea
public void rebootUserspaceUntilOnline ()
Lanza |
---|
DeviceNotAvailableException | |
recuperar dispositivo
public void recoverDevice ()
Intentos de recuperar la comunicación del dispositivo.
Lanza |
---|
DeviceNotAvailableException | si el dispositivo ya no está disponible |
remountSystemWritable
public void remountSystemWritable ()
Lanza |
---|
DeviceNotAvailableException | |
remountVendorWritable
public void remountVendorWritable ()
Lanza |
---|
DeviceNotAvailableException | |
removeAdmin
public boolean removeAdmin (String componentName,
int userId)
Parámetros |
---|
componentName | String |
userId | int |
Lanza |
---|
DeviceNotAvailableException | |
removePropietarios
public void removeOwners ()
Lanza |
---|
DeviceNotAvailableException | |
eliminarUsuario
public boolean removeUser (int userId)
Lanza |
---|
DeviceNotAvailableException | |
resetContentProviderSetup
public void resetContentProviderSetup ()
Restablezca la bandera para la configuración del proveedor de contenido para activarla 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 | |
ejecutar pruebas de instrumentación como usuario
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner,
int userId,
ITestLifeCycleReceiver... listeners)
Parámetros |
---|
runner | IRemoteAndroidTestRunner |
userId | int |
listeners | ITestLifeCycleReceiver |
Lanza |
---|
DeviceNotAvailableException | |
ejecutar pruebas de instrumentación como usuario
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner,
int userId,
listeners)
Parámetros |
---|
runner | IRemoteAndroidTestRunner |
userId | int |
listeners | |
Lanza |
---|
DeviceNotAvailableException | |
setConfiguration
public void setConfiguration (IConfiguration configuration)
Inyecta la IConfiguration
en uso.
Parámetros |
---|
configuration | IConfiguration |
define la fecha
public void setDate (Date date)
Lanza |
---|
DeviceNotAvailableException | |
setDeviceOwner
public boolean setDeviceOwner (String componentName,
int userId)
Parámetros |
---|
componentName | String |
userId | int |
Lanza |
---|
DeviceNotAvailableException | |
establecerDeviceState
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 |
establecerEmulatorProcess
public void setEmulatorProcess (Process p)
setFastbootEnabled
public void setFastbootEnabled (boolean fastbootEnabled)
Parámetros |
---|
fastbootEnabled | boolean |
establecerFastbootPath
public void setFastbootPath (String fastbootPath)
Parámetros |
---|
fastbootPath | String |
establecerIDevice
public void setIDevice (IDevice newDevice)
Parámetros |
---|
newDevice | IDevice |
establecerOpciones
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 | |
setRecovery
public void setRecovery (IDeviceRecovery recovery)
Parámetros |
---|
recovery | IDeviceRecovery |
establecer el 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 | |
detenerEmulatorOutput
public void stopEmulatorOutput ()
detenerLogcat
public void stopLogcat ()
detenerUsuario
public boolean stopUser (int userId)
Lanza |
---|
DeviceNotAvailableException | |
detenerUsuario
public boolean stopUser (int userId,
boolean waitFlag,
boolean forceFlag)
Parámetros |
---|
userId | int |
waitFlag | boolean |
forceFlag | boolean |
Lanza |
---|
DeviceNotAvailableException | |
switchToAdbTcp
public String switchToAdbTcp ()
Lanza |
---|
DeviceNotAvailableException | |
switchToAdbUsb
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 | |
tomarBugreinforme
public Bugreport takeBugreport ()
desencriptar dispositivo
public boolean unencryptDevice ()
Lanza |
---|
DeviceNotAvailableException | |
desinstalarPaquete
public String uninstallPackage (String packageName)
Parámetros |
---|
packageName | String |
Lanza |
---|
DeviceNotAvailableException | |
desinstalar paquete para usuario
public String uninstallPackageForUser (String packageName,
int userId)
Parámetros |
---|
packageName | String |
userId | int |
Lanza |
---|
DeviceNotAvailableException | |
dispositivo de desbloqueo
public boolean unlockDevice ()
Lanza |
---|
DeviceNotAvailableException | |
esperar por arranque 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 por dispositivo en recuperación
public boolean waitForDeviceInRecovery (long waitTime)
esperar por dispositivo en carga lateral
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 | |
esperarParaDeviceShell
public boolean waitForDeviceShell (long waitTime)
Métodos protegidos
comprobarApiLevelContra
protected void checkApiLevelAgainst (String feature,
int strictMinLevel)
Parámetros |
---|
feature | String |
strictMinLevel | int |
doAdbReboot
protected void doAdbReboot (NativeDevice.RebootMode rebootMode,
String reason)
Realice un reinicio 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 no se admite el permiso de tiempo de ejecución
Lanza |
---|
DeviceNotAvailableException | |
getBureportInternal
protected InputStreamSource getBugreportInternal ()
Devoluciones |
---|
InputStreamSource | |
getBugreportzInternal
protected File getBugreportzInternal ()
Método auxiliar interno para obtener el archivo zip bugreportz como ERROR(/File)
.
getRunUtil
protected IRunUtil getRunUtil ()
Obtenga la instancia de RunUtil
para usar.
internalGetProperty
protected String internalGetProperty (String propName,
String fastbootVar,
String description)
Obtenga una propiedad del dispositivo, de la memoria 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 según lo devuelto por `adb shell getprop` |
fastbootVar | String : el nombre de la variable de arranque rápido equivalente para consultar. si es null , no se intentará la consulta de inicio rápido |
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. IFileEntry
exacto 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ó con éxito |
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 un reinicio.
Lanza |
---|
DeviceNotAvailableException | |
prePostBootSetup
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 | |
fijarReloj
protected void setClock (Clock clock)
Establezca la instancia de Clock para usar.
setLogStartDelay
protected void setLogStartDelay (int delay)
Establece el tiempo de espera en ms 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 |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2022-07-06 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Falta la información que necesito"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Muy complicado o demasiados pasos"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Desactualizado"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"Problema de traducción"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Problema con las muestras o los códigos"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Otro"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Fácil de comprender"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Resolvió mi problema"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Otro"
}]