Clases anidadas |
---|
class | NativeDevice.AdbAction Un 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 executeShellCommand(String) logs. |
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 extraoficial para conseguir un FileEntry desde una ruta que no sea root. |
| 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 tomen 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 tomen algunas acciones específicas después de que 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 () 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 el IConfiguration en uso. |
void | setDate (Date date) |
boolean | setDeviceOwner (String componentName, int userId) |
void | setDeviceState (TestDeviceState deviceState) |
void | setEmulatorOutputStream ( SizeLimitedOutputStream output) Para configurar el emulador 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) Crear un RebootDeviceAction para ser utilizado cuando se realiza 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 no se admite el permiso de tiempo de ejecución |
InputStreamSource | getBugreportInternal () |
File | getBugreportzInternal () Método auxiliar interna para obtener el archivo zip bugreportz como ERROR(/File) . |
IRunUtil | getRunUtil () Obtener el RunUtil ejemplo, para su uso. |
String | internalGetProperty (String propName, String fastbootVar, String description) Obtener una propiedad de dispositivo, de la caché ddmlib de forma predeterminada, y recurrir a `adb shell getprop` o` fastboot getvar` dependiendo de si el dispositivo está en Fastboot o no. |
boolean | isNewer (File localFile, IFileEntry entry) Devolver true si el archivo local es más reciente 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 específica posterior al arranque. |
void | setClock (Clock clock) Configure la instancia de Clock que se utilizará. |
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
IDENTIFICACIÓN DE USUARIO INVÁLIDA
public static final int INVALID_USER_ID
Valor devuelto para cualquier ID de usuario no válido / no encontrado: 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 reintentos de comando para realizar
Valor constante: 2 (0x00000002)
Los campos
TARJETA SD
protected static final String SD_CARD
STORAGE_EMULATED
protected static final String STORAGE_EMULATED
mOpciones
protected TestDeviceOptions mOptions
mStateMonitor
protected final IDeviceStateMonitor mStateMonitor
Constructores públicos
NativeDevice
public NativeDevice (IDevice device,
IDeviceStateMonitor stateMonitor,
IDeviceMonitor allocationMonitor)
Crea un TestDevice
.
Parámetros |
---|
device | IDevice : The Associated IDevice |
stateMonitor | IDeviceStateMonitor : la IDeviceStateMonitor mecanismo para uso |
allocationMonitor | IDeviceMonitor : la IDeviceMonitor para informar de cambios de estado de asignación. Puede ser nulo |
Métodos públicos
checkApiLevelAgainstNextRelease
public boolean checkApiLevelAgainstNextRelease (int strictMinLevel)
Parámetros |
---|
strictMinLevel | int |
Lanza |
---|
DeviceNotAvailableException | |
checkConnectivity
public boolean checkConnectivity ()
Lanza |
---|
DeviceNotAvailableException | |
clearErrorDialogs
public boolean clearErrorDialogs ()
Lanza |
---|
DeviceNotAvailableException | |
clearLastConnectedWifiNetwork
public void clearLastConnectedWifiNetwork ()
clearLogcat
public void clearLogcat ()
connectToWifiNetwork
public boolean connectToWifiNetwork (String wifiSsid,
String wifiPsk)
Parámetros |
---|
wifiSsid | String |
wifiPsk | String |
Lanza |
---|
DeviceNotAvailableException | |
connectToWifiNetwork
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 | |
createUserNoThrow
public int createUserNoThrow (String name)
Lanza |
---|
DeviceNotAvailableException | |
borrar archivo
public void deleteFile (String deviceFilePath)
Parámetros |
---|
deviceFilePath | String |
Lanza |
---|
DeviceNotAvailableException | |
deviceSoftRestarted
public boolean deviceSoftRestarted (ProcessInfo prevSystemServerProcess)
Parámetros |
---|
prevSystemServerProcess | ProcessInfo |
Lanza |
---|
DeviceNotAvailableException | |
deviceSoftRestartedSince
public boolean deviceSoftRestartedSince (long utcEpochTime,
TimeUnit timeUnit)
Parámetros |
---|
utcEpochTime | long |
timeUnit | TimeUnit |
Lanza |
---|
DeviceNotAvailableException | |
disableAdbRoot
public boolean disableAdbRoot ()
Lanza |
---|
DeviceNotAvailableException | |
desactivar Keyguard
public void disableKeyguard ()
Lanza |
---|
DeviceNotAvailableException | |
disableNetworkMonitor
public boolean disableNetworkMonitor ()
Lanza |
---|
DeviceNotAvailableException | |
desconectarFromWifi
public boolean disconnectFromWifi ()
Lanza |
---|
DeviceNotAvailableException | |
doesFileExist
public boolean doesFileExist (String deviceFilePath)
Parámetros |
---|
deviceFilePath | String |
Lanza |
---|
DeviceNotAvailableException | |
dumpHeap
public File dumpHeap (String process,
String devicePath)
Parámetros |
---|
process | String |
devicePath | String |
Lanza |
---|
DeviceNotAvailableException | |
enableAdbRoot
public boolean enableAdbRoot ()
Lanza |
---|
DeviceNotAvailableException | |
enableNetworkMonitor
public boolean enableNetworkMonitor ()
Lanza |
---|
DeviceNotAvailableException | |
encryptDevice
public boolean encryptDevice (boolean inplace)
Parámetros |
---|
inplace | boolean |
Lanza |
---|
DeviceNotAvailableException | |
executeAdbCommand
public String executeAdbCommand (long timeout,
String... cmdArgs)
Parámetros |
---|
timeout | long |
cmdArgs | String |
Lanza |
---|
DeviceNotAvailableException | |
executeAdbCommand
public String executeAdbCommand (String... cmdArgs)
Parámetros |
---|
cmdArgs | String |
Lanza |
---|
DeviceNotAvailableException | |
executeFastbootCommand
public CommandResult executeFastbootCommand (String... cmdArgs)
Parámetros |
---|
cmdArgs | String |
Devoluciones |
---|
CommandResult | |
Lanza |
---|
DeviceNotAvailableException | |
executeFastbootCommand
public CommandResult executeFastbootCommand (long timeout,
String... cmdArgs)
Parámetros |
---|
timeout | long |
cmdArgs | String |
Devoluciones |
---|
CommandResult | |
Lanza |
---|
DeviceNotAvailableException | |
executeLongFastbootCommand
public CommandResult executeLongFastbootCommand (String... cmdArgs)
Parámetros |
---|
cmdArgs | String |
Devoluciones |
---|
CommandResult | |
Lanza |
---|
DeviceNotAvailableException | |
executeShellCommand
public String executeShellCommand (String command)
Parámetros |
---|
command | String |
Lanza |
---|
DeviceNotAvailableException | |
executeShellCommand
public void executeShellCommand (String command,
IShellOutputReceiver receiver,
long maxTimeToOutputShellResponse,
TimeUnit timeUnit,
int retryAttempts)
Parámetros |
---|
command | String |
receiver | IShellOutputReceiver |
maxTimeToOutputShellResponse | long |
timeUnit | TimeUnit |
retryAttempts | int |
Lanza |
---|
DeviceNotAvailableException | |
executeShellCommand
public void executeShellCommand (String command,
IShellOutputReceiver receiver,
long maxTimeoutForCommand,
long maxTimeToOutputShellResponse,
TimeUnit timeUnit,
int retryAttempts)
Parámetros |
---|
command | String |
receiver | IShellOutputReceiver |
maxTimeoutForCommand | long |
maxTimeToOutputShellResponse | long |
timeUnit | TimeUnit |
retryAttempts | int |
Lanza |
---|
DeviceNotAvailableException | |
executeShellCommand
public void executeShellCommand (String command,
IShellOutputReceiver receiver)
Parámetros |
---|
command | String |
receiver | IShellOutputReceiver |
Lanza |
---|
DeviceNotAvailableException | |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd)
Devoluciones |
---|
CommandResult | |
Lanza |
---|
DeviceNotAvailableException | |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd,
OutputStream pipeToOutput)
Parámetros |
---|
cmd | String |
pipeToOutput | OutputStream |
Devoluciones |
---|
CommandResult | |
Lanza |
---|
DeviceNotAvailableException | |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd,
File pipeAsInput)
Parámetros |
---|
cmd | String |
pipeAsInput | File |
Devoluciones |
---|
CommandResult | |
Lanza |
---|
DeviceNotAvailableException | |
executeShellV2Command
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 | |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd,
long maxTimeoutForCommand,
TimeUnit timeUnit)
Parámetros |
---|
cmd | String |
maxTimeoutForCommand | long |
timeUnit | TimeUnit |
Devoluciones |
---|
CommandResult | |
Lanza |
---|
DeviceNotAvailableException | |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd,
File pipeAsInput,
OutputStream pipeToOutput,
long maxTimeoutForCommand,
TimeUnit timeUnit,
int retryAttempts)
Parámetros |
---|
cmd | String |
pipeAsInput | File |
pipeToOutput | OutputStream |
maxTimeoutForCommand | long |
timeUnit | TimeUnit |
retryAttempts | int |
Devoluciones |
---|
CommandResult | |
Lanza |
---|
DeviceNotAvailableException | |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd,
File pipeAsInput,
OutputStream pipeToOutput,
OutputStream pipeToError,
long maxTimeoutForCommand,
TimeUnit timeUnit,
int retryAttempts)
Parámetros |
---|
cmd | String |
pipeAsInput | File |
pipeToOutput | OutputStream |
pipeToError | OutputStream |
maxTimeoutForCommand | long |
timeUnit | TimeUnit |
retryAttempts | int |
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 | |
getAndroidId
public String getAndroidId (int userId)
Lanza |
---|
DeviceNotAvailableException | |
getAndroidIds
public getAndroidIds ()
Lanza |
---|
DeviceNotAvailableException | |
getApiLevel
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 | |
getBattery
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 | |
getBugreport
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 | |
getChildren
public String[] getChildren (String path)
Lanza |
---|
DeviceNotAvailableException | |
getCurrentFoldableState
public DeviceFoldableState getCurrentFoldableState ()
Devoluciones |
---|
DeviceFoldableState | |
Lanza |
---|
DeviceNotAvailableException | |
getCurrentUser
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 executeShellCommand(String)
logs.
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 extraoficial para conseguir un FileEntry
desde una ruta que no sea root. FIXME: Refactorice el sistema FileEntry para que esté disponible desde cualquier ruta. (incluso no root).
Parámetros |
---|
entry | FileListingService.FileEntry : un FileEntry no necesariamente raíz que requiere Ddmlib. |
Lanza |
---|
DeviceNotAvailableException | |
getFoldableStates
public getFoldableStates ()
Lanza |
---|
DeviceNotAvailableException | |
getIDevice
public IDevice getIDevice ()
getInstalledPackageNames
public getInstalledPackageNames ()
Lanza |
---|
DeviceNotAvailableException | |
getIntProperty
public long getIntProperty (String name,
long defaultValue)
Parámetros |
---|
name | String |
defaultValue | long |
Lanza |
---|
DeviceNotAvailableException | |
getIpAddress
public String getIpAddress ()
Lanza |
---|
DeviceNotAvailableException | |
getKeyguardState
public KeyguardControllerState getKeyguardState ()
Devoluciones |
---|
KeyguardControllerState | |
Lanza |
---|
DeviceNotAvailableException | |
getLastExpectedRebootTimeMillis
public long getLastExpectedRebootTimeMillis ()
getLaunchApiLevel
public int getLaunchApiLevel ()
Lanza |
---|
DeviceNotAvailableException | |
getLogcat
public InputStreamSource getLogcat ()
Devoluciones |
---|
InputStreamSource | |
getLogcat
public InputStreamSource getLogcat (int maxBytes)
Devoluciones |
---|
InputStreamSource | |
getLogcatDump
public InputStreamSource getLogcatDump ()
Devoluciones |
---|
InputStreamSource | |
getLogcatSince
public InputStreamSource getLogcatSince (long date)
Devoluciones |
---|
InputStreamSource | |
getMacAddress
public String getMacAddress ()
getMainlineModuleInfo
public getMainlineModuleInfo ()
Lanza |
---|
DeviceNotAvailableException | |
public int getMaxNumberOfRunningUsersSupported ()
Lanza |
---|
DeviceNotAvailableException | |
public int getMaxNumberOfUsersSupported ()
Lanza |
---|
DeviceNotAvailableException | |
getMonitor
public IDeviceStateMonitor getMonitor ()
Devoluciones |
---|
IDeviceStateMonitor | |
getMountPoint
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 | |
getProcessByName
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 | |
getProperty
public String getProperty (String name)
Lanza |
---|
DeviceNotAvailableException | |
getRecoveryMode
public ITestDevice.RecoveryMode getRecoveryMode ()
Devoluciones |
---|
ITestDevice.RecoveryMode | |
getScreenshot
public InputStreamSource getScreenshot (String format)
Devoluciones |
---|
InputStreamSource | |
Lanza |
---|
DeviceNotAvailableException | |
getScreenshot
public InputStreamSource getScreenshot (long displayId)
Parámetros |
---|
displayId | long |
Devoluciones |
---|
InputStreamSource | |
Lanza |
---|
DeviceNotAvailableException | |
getScreenshot
public InputStreamSource getScreenshot (String format,
boolean rescale)
Parámetros |
---|
format | String |
rescale | boolean |
Devoluciones |
---|
InputStreamSource | |
Lanza |
---|
DeviceNotAvailableException | |
getScreenshot
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 | |
getSimOperator
public String getSimOperator ()
getSimState
public String getSimState ()
getTombstones
public getTombstones ()
Lanza |
---|
DeviceNotAvailableException | |
getTotalMemory
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 | |
hasFeature
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 | |
installPackageForUser
public String installPackageForUser (File packageFile,
boolean reinstall,
int userId,
String... extraArgs)
Parámetros |
---|
packageFile | File |
reinstall | boolean |
userId | int |
extraArgs | String |
Lanza |
---|
DeviceNotAvailableException | |
installPackageForUser
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 | |
isAdbRoot
public boolean isAdbRoot ()
Lanza |
---|
DeviceNotAvailableException | |
isAdbTcp
public boolean isAdbTcp ()
isAppEnumerationSupported
public boolean isAppEnumerationSupported ()
Lanza |
---|
DeviceNotAvailableException | |
isDeviceEncrypted
public boolean isDeviceEncrypted ()
Lanza |
---|
DeviceNotAvailableException | |
isDirectory
public boolean isDirectory (String path)
Lanza |
---|
DeviceNotAvailableException | |
isEnableAdbRoot
public boolean isEnableAdbRoot ()
Devoluciones |
---|
boolean | true si ADB raíz debe estar habilitado en el dispositivo |
isEncryptionSupported
public boolean isEncryptionSupported ()
Lanza |
---|
DeviceNotAvailableException | |
isExecutable
public boolean isExecutable (String fullPath)
Parámetros |
---|
fullPath | String |
Lanza |
---|
DeviceNotAvailableException | |
isFastbootEnabled
public boolean isFastbootEnabled ()
isHeadless
public boolean isHeadless ()
Lanza |
---|
DeviceNotAvailableException | |
isMultiUserSupported
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 | |
isStateBootloaderOrFastbootd
public boolean isStateBootloaderOrFastbootd ()
isUserRunning
public boolean isUserRunning (int userId)
Lanza |
---|
DeviceNotAvailableException | |
isUserSecondary
public boolean isUserSecondary (int userId)
Lanza |
---|
DeviceNotAvailableException | |
isWifiEnabled
public boolean isWifiEnabled ()
Lanza |
---|
DeviceNotAvailableException | |
listDisplayIds
public listDisplayIds ()
Lanza |
---|
DeviceNotAvailableException | |
listUsers
public listUsers ()
Lanza |
---|
DeviceNotAvailableException | |
logBugreport
public boolean logBugreport (String dataName,
ITestLogger listener)
Parámetros |
---|
dataName | String |
listener | ITestLogger |
logOnDevice
public void logOnDevice (String tag,
Log.LogLevel level,
String format,
Object... args)
Parámetros |
---|
tag | String |
level | Log.LogLevel |
format | String |
args | Object |
nonBlockingReboot
public void nonBlockingReboot ()
Lanza |
---|
DeviceNotAvailableException | |
postAdbRootAction
public void postAdbRootAction ()
Anule si el dispositivo necesita que se tomen 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 | |
postAdbUnrootAction
public void postAdbUnrootAction ()
Anule si el dispositivo necesita que se tomen algunas acciones específicas después de que adb unroot y antes de que el dispositivo vuelva a estar en línea. La implementación predeterminada no incluye acciones adicionales. No se garantiza que adb root esté deshabilitado en esta etapa.
Lanza |
---|
DeviceNotAvailableException | |
postBootSetup
public void postBootSetup ()
Lanza |
---|
DeviceNotAvailableException | |
postInvocationTearDown
public void postInvocationTearDown (Throwable exception)
Parámetros |
---|
exception | Throwable |
preInvocationSetup
public void preInvocationSetup (IBuildInfo info,
MultiMap<String, String> attributes)
Parámetros |
---|
info | IBuildInfo |
attributes | MultiMap |
Lanza |
---|
DeviceNotAvailableException | |
TargetSetupError | |
pullDir
public boolean pullDir (String deviceFilePath,
File localDir)
Parámetros |
---|
deviceFilePath | String |
localDir | File |
Lanza |
---|
DeviceNotAvailableException | |
pullFile
public boolean pullFile (String remoteFilePath,
File localFile)
Parámetros |
---|
remoteFilePath | String |
localFile | File |
Lanza |
---|
DeviceNotAvailableException | |
pullFile
public File pullFile (String remoteFilePath)
Parámetros |
---|
remoteFilePath | String |
Lanza |
---|
DeviceNotAvailableException | |
pullFileContents
public String pullFileContents (String remoteFilePath)
Parámetros |
---|
remoteFilePath | String |
Lanza |
---|
DeviceNotAvailableException | |
pullFileFromExternal
public File pullFileFromExternal (String remoteFilePath)
Parámetros |
---|
remoteFilePath | String |
Lanza |
---|
DeviceNotAvailableException | |
pushDir
public boolean pushDir (File localFileDir,
String deviceFilePath,
excludedDirectories)
Parámetros |
---|
localFileDir | File |
deviceFilePath | String |
excludedDirectories | |
Lanza |
---|
DeviceNotAvailableException | |
pushDir
public boolean pushDir (File localFileDir,
String deviceFilePath)
Parámetros |
---|
localFileDir | File |
deviceFilePath | String |
Lanza |
---|
DeviceNotAvailableException | |
pushFile
public boolean pushFile (File localFile,
String remoteFilePath)
Parámetros |
---|
localFile | File |
remoteFilePath | String |
Lanza |
---|
DeviceNotAvailableException | |
pushString
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 | |
rebootIntoBootloader
public void rebootIntoBootloader ()
Lanza |
---|
DeviceNotAvailableException | |
rebootIntoFastbootd
public void rebootIntoFastbootd ()
Lanza |
---|
DeviceNotAvailableException | |
rebootIntoRecovery
public void rebootIntoRecovery ()
Lanza |
---|
DeviceNotAvailableException | |
rebootIntoSideload
public void rebootIntoSideload ()
Lanza |
---|
DeviceNotAvailableException | |
rebootIntoSideload
public void rebootIntoSideload (boolean autoReboot)
Parámetros |
---|
autoReboot | boolean |
Lanza |
---|
DeviceNotAvailableException | |
rebootUntilOnline
public void rebootUntilOnline ()
Lanza |
---|
DeviceNotAvailableException | |
rebootUntilOnline
public void rebootUntilOnline (String reason)
Lanza |
---|
DeviceNotAvailableException | |
rebootUserspace
public void rebootUserspace ()
Lanza |
---|
DeviceNotAvailableException | |
rebootUserspaceUntilOnline
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 |
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 | |
removeOwners
public void removeOwners ()
Lanza |
---|
DeviceNotAvailableException | |
removeUser
public boolean removeUser (int userId)
Lanza |
---|
DeviceNotAvailableException | |
resetContentProviderSetup
public void resetContentProviderSetup ()
Restablezca el indicador para la configuración del proveedor de contenido para activarlo nuevamente.
runInstrumentationTests
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner,
ITestLifeCycleReceiver... listeners)
Parámetros |
---|
runner | IRemoteAndroidTestRunner |
listeners | ITestLifeCycleReceiver |
Lanza |
---|
DeviceNotAvailableException | |
runInstrumentationTests
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner,
listeners)
Parámetros |
---|
runner | IRemoteAndroidTestRunner |
listeners | |
Lanza |
---|
DeviceNotAvailableException | |
runInstrumentationTestsAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner,
int userId,
ITestLifeCycleReceiver... listeners)
Parámetros |
---|
runner | IRemoteAndroidTestRunner |
userId | int |
listeners | ITestLifeCycleReceiver |
Lanza |
---|
DeviceNotAvailableException | |
runInstrumentationTestsAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner,
int userId,
listeners)
Parámetros |
---|
runner | IRemoteAndroidTestRunner |
userId | int |
listeners | |
Lanza |
---|
DeviceNotAvailableException | |
setConfiguration
public void setConfiguration (IConfiguration configuration)
Inyecta el IConfiguration
en uso.
Parámetros |
---|
configuration | IConfiguration |
Establece 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 | |
setDeviceState
public void setDeviceState (TestDeviceState deviceState)
Parámetros |
---|
deviceState | TestDeviceState |
setEmulatorOutputStream
public void setEmulatorOutputStream (SizeLimitedOutputStream output)
Para configurar el emulador SizeLimitedOutputStream
para registrar la salida
Parámetros |
---|
output | SizeLimitedOutputStream : a registrar la salida |
setEmulatorProcess
public void setEmulatorProcess (Process p)
setFastbootEnabled
public void setFastbootEnabled (boolean fastbootEnabled)
Parámetros |
---|
fastbootEnabled | boolean |
setFastbootPath
public void setFastbootPath (String fastbootPath)
Parámetros |
---|
fastbootPath | String |
setIDevice
public void setIDevice (IDevice newDevice)
Parámetros |
---|
newDevice | IDevice |
setOptions
public void setOptions (TestDeviceOptions options)
Parámetros |
---|
options | TestDeviceOptions |
setProperty
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 |
setRecoveryMode
public void setRecoveryMode (ITestDevice.RecoveryMode mode)
Parámetros |
---|
mode | ITestDevice.RecoveryMode |
setSetting
public void setSetting (String namespace,
String key,
String value)
Parámetros |
---|
namespace | String |
key | String |
value | String |
Lanza |
---|
DeviceNotAvailableException | |
setSetting
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 |
startLogcat
public void startLogcat ()
startUser
public boolean startUser (int userId)
Lanza |
---|
DeviceNotAvailableException | |
startUser
public boolean startUser (int userId,
boolean waitFlag)
Parámetros |
---|
userId | int |
waitFlag | boolean |
Lanza |
---|
DeviceNotAvailableException | |
stopEmulatorOutput
public void stopEmulatorOutput ()
stopLogcat
public void stopLogcat ()
stopUser
public boolean stopUser (int userId)
Lanza |
---|
DeviceNotAvailableException | |
stopUser
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 | |
syncFiles
public boolean syncFiles (File localFileDir,
String deviceFilePath)
Parámetros |
---|
localFileDir | File |
deviceFilePath | String |
Lanza |
---|
DeviceNotAvailableException | |
takeBugreport
public Bugreport takeBugreport ()
unencryptDevice
public boolean unencryptDevice ()
Lanza |
---|
DeviceNotAvailableException | |
desinstalarPaquete
public String uninstallPackage (String packageName)
Parámetros |
---|
packageName | String |
Lanza |
---|
DeviceNotAvailableException | |
uninstallPackageForUser
public String uninstallPackageForUser (String packageName,
int userId)
Parámetros |
---|
packageName | String |
userId | int |
Lanza |
---|
DeviceNotAvailableException | |
unlockDevice
public boolean unlockDevice ()
Lanza |
---|
DeviceNotAvailableException | |
waitForBootComplete
public boolean waitForBootComplete (long timeOut)
Lanza |
---|
DeviceNotAvailableException | |
waitForDeviceAvailable
public void waitForDeviceAvailable ()
Lanza |
---|
DeviceNotAvailableException | |
waitForDeviceAvailable
public void waitForDeviceAvailable (long waitTime)
Lanza |
---|
DeviceNotAvailableException | |
waitForDeviceInRecovery
public boolean waitForDeviceInRecovery (long waitTime)
waitForDeviceInSideload
public boolean waitForDeviceInSideload (long waitTime)
waitForDeviceNotAvailable
public boolean waitForDeviceNotAvailable (long waitTime)
waitForDeviceOnline
public void waitForDeviceOnline ()
Lanza |
---|
DeviceNotAvailableException | |
waitForDeviceOnline
public void waitForDeviceOnline (long waitTime)
Lanza |
---|
DeviceNotAvailableException | |
waitForDeviceShell
public boolean waitForDeviceShell (long waitTime)
Métodos protegidos
checkApiLevelAgainst
protected void checkApiLevelAgainst (String feature,
int strictMinLevel)
Parámetros |
---|
feature | String |
strictMinLevel | int |
doAdbReboot
protected void doAdbReboot (NativeDevice.RebootMode rebootMode,
String reason)
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 no se admite el permiso de tiempo de ejecución
Lanza |
---|
DeviceNotAvailableException | |
getBugreportInternal
protected InputStreamSource getBugreportInternal ()
Devoluciones |
---|
InputStreamSource | |
getBugreportzInternal
protected File getBugreportzInternal ()
Método auxiliar interna para obtener el archivo zip bugreportz como ERROR(/File)
.
getRunUtil
protected IRunUtil getRunUtil ()
Obtener el RunUtil
ejemplo, para su uso.
internalGetProperty
protected String internalGetProperty (String propName,
String fastbootVar,
String description)
Obtener una propiedad de dispositivo, de la caché ddmlib de forma predeterminada, y recurrir 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 de dispositivo como devuelto por `getprop` adb shell |
fastbootVar | String : El nombre de la variable fastboot equivalente a consulta. Si null , no se intentará la consulta fastboot |
description | String : Una simple descripción de la variable. La primera letra debe estar en mayúscula. |
Devoluciones |
---|
String | Una cadena, posiblemente null o vacío, que contiene el valor de la propiedad dada |
Lanza |
---|
DeviceNotAvailableException | |
isNewer
protected boolean isNewer (File localFile,
IFileEntry entry)
Devolver true
si el archivo local es más reciente que el archivo remoto. IFileEntry
siendo una precisión de minutos, en caso de tiempos iguales, el archivo se considera más reciente.
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 : los reintentos para realizar una acción si no tiene éxito pero la recuperación |
Devoluciones |
---|
boolean | true si la acción se llevó a cabo con éxito |
Lanza |
---|
DeviceNotAvailableException | si el intento de recuperación falla o el máximo de intentos se realiza sin éxito |
postAdbReboot
protected void postAdbReboot ()
Posibles acciones adicionales que se pueden realizar después de reiniciar.
Lanza |
---|
DeviceNotAvailableException | |
prePostBootSetup
protected void prePostBootSetup ()
Permite que cada tipo de dispositivo (AndroidNativeDevice, TestDevice) anule este método para una configuración específica posterior al arranque.
Lanza |
---|
DeviceNotAvailableException | |
setClock
protected void setClock (Clock clock)
Configure la instancia de Clock que se utilizará.
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 |
waitForDeviceNotAvailable
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 2021-10-04 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"
}]