Dispositivo nativo
public
class
NativeDevice
extends Object
implements
IManagedTestDevice,
IConfigurationReceiver
Objeto java.lang. | |
↳ | com.android.tradefed.device.NativeDevice |
Implementación predeterminada de un dispositivo Android ITestDevice
que no es de pila completa.
Resumen
Clases anidadas | |
---|---|
class |
NativeDevice.AdbAction
Un |
class |
NativeDevice.AdbShellAction
|
class |
NativeDevice.RebootDeviceAction
|
enum |
NativeDevice.RebootMode
Un modo de reinicio. |
Constantes | |
---|---|
int |
INVALID_USER_ID
Valor que se muestra para cualquier ID de usuario no válido o no encontrado: UserHandle definió el valor -10000 |
long |
MAX_HOST_DEVICE_TIME_OFFSET
|
int |
MAX_RETRY_ATTEMPTS
la cantidad predeterminada de reintentos de comando para realizar |
Campos | |
---|---|
protected
static
final
String |
SD_CARD
|
protected
static
final
String |
STORAGE_EMULATED
|
protected
TestDeviceOptions |
mOptions
|
protected
final
IDeviceStateMonitor |
mStateMonitor
|
Constructores públicos | |
---|---|
NativeDevice(IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)
Crea un |
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 |
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)
Es un asistente no oficial para obtener un |
|
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)
Procesar el DeviceEvent, lo que puede o no hacer la transición de este dispositivo a una nueva asignación para cada estado. |
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()
Anula si el dispositivo necesita que se realicen algunas acciones específicas después de la raíz de adb y antes de que el dispositivo vuelva a estar en línea. |
void
|
postAdbUnrootAction()
Anula si el dispositivo necesita que se realicen algunas acciones específicas después de que adb desroot 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,
|
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 con el dispositivo. |
void
|
remountSystemWritable()
|
void
|
remountVendorWritable()
|
boolean
|
removeAdmin(String componentName, int userId)
|
void
|
removeOwners()
|
boolean
|
removeUser(int userId)
|
void
|
resetContentProviderSetup()
Restablece la marca de la configuración del proveedor de contenido para volver a activarla. |
boolean
|
runInstrumentationTests(IRemoteAndroidTestRunner runner, ITestLifeCycleReceiver... listeners)
|
boolean
|
runInstrumentationTests(IRemoteAndroidTestRunner runner,
|
boolean
|
runInstrumentationTestsAsUser(IRemoteAndroidTestRunner runner, int userId, ITestLifeCycleReceiver... listeners)
|
boolean
|
runInstrumentationTestsAsUser(IRemoteAndroidTestRunner runner, int userId,
|
void
|
setConfiguration(IConfiguration configuration)
Inserta el |
void
|
setDate(Date date)
|
boolean
|
setDeviceOwner(String componentName, int userId)
|
void
|
setDeviceState(TestDeviceState deviceState)
|
void
|
setEmulatorOutputStream(SizeLimitedOutputStream output)
Para el emulador, configura |
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)
Crea un |
void
|
doAdbReboot(NativeDevice.RebootMode rebootMode, String reason)
Ejecuta un reinicio de adb. |
void
|
ensureRuntimePermissionSupported()
un método auxiliar para arrojar una excepción si no se admite el permiso de tiempo de ejecución |
InputStreamSource
|
getBugreportInternal()
|
File
|
getBugreportzInternal()
Es un método de ayuda interno para obtener el archivo ZIP bugreportz como |
IRunUtil
|
getRunUtil()
Obtén la instancia de |
String
|
internalGetProperty(String propName, String fastbootVar, String description)
Recupera una propiedad de dispositivo, a partir de la caché de ddmlib de forma predeterminada, y recurrir a "adb" shell getprop` o `fastboot getvar`, según si el dispositivo está en Fastboot o no. |
boolean
|
isNewer(File localFile, IFileEntry entry)
Muestra |
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 el dispositivo. |
void
|
prePostBootSetup()
Permite que cada tipo de dispositivo (AndroidNativeDevice, TestDevice) anule este método para una configuración específica posterior al inicio. |
void
|
setClock(Clock clock)
Configura la instancia de reloj que se usará. |
void
|
setLogStartDelay(int delay)
Establece el tiempo en ms que se debe esperar antes de iniciar la captura de logcat para un dispositivo en línea. |
void
|
waitForDeviceNotAvailable(String operationDesc, long time)
|
Constantes
ID DE USUARIO NO VÁLIDO
public static final int INVALID_USER_ID
Valor que se muestra para cualquier ID de usuario no válido o no encontrado: UserHandle definió el valor -10000
Valor constante: -10,000 (0xffffd8f0)
MAX_HOST_DEVICE_TIME_OFFSET
protected static final long MAX_HOST_DEVICE_TIME_OFFSET
Valor constante: 5,000 (0x0000000000001388)
MAX_RETRY_ATTEMPTS
protected static final int MAX_RETRY_ATTEMPTS
la cantidad predeterminada de reintentos 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
Opciones de dispositivos móviles
protected TestDeviceOptions mOptions
mStateMonitor
protected final IDeviceStateMonitor mStateMonitor
Constructores públicos
Dispositivo nativo
public NativeDevice (IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)
Crea un TestDevice
.
Parámetros | |
---|---|
device |
IDevice : Es el IDevice asociado. |
stateMonitor |
IDeviceStateMonitor : Es el mecanismo IDeviceStateMonitor para usar. |
allocationMonitor |
IDeviceMonitor : Es el IDeviceMonitor que se informará sobre los cambios de estado de la asignación.
Puede ser nulo
|
Métodos públicos
checkApiLevelAgainstNextRelease
public boolean checkApiLevelAgainstNextRelease (int strictMinLevel)
Parámetros | |
---|---|
strictMinLevel |
int |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
checkConnectivity
public boolean checkConnectivity ()
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
deleteErrorDialogs
public boolean clearErrorDialogs ()
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
clearLastConnectedWifiNetwork
public void clearLastConnectedWifiNetwork ()
deleteLogcat
public void clearLogcat ()
conectarAlaredWi-Fi
public boolean connectToWifiNetwork (String wifiSsid, String wifiPsk)
Parámetros | |
---|---|
wifiSsid |
String |
wifiPsk |
String |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
conectarAlaredWi-Fi
public boolean connectToWifiNetwork (String wifiSsid, String wifiPsk, boolean scanSsid)
Parámetros | |
---|---|
wifiSsid |
String |
wifiPsk |
String |
scanSsid |
boolean |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
ConectarConWi-FiNetworkSi Es necesario
public boolean connectToWifiNetworkIfNeeded (String wifiSsid, String wifiPsk, boolean scanSsid)
Parámetros | |
---|---|
wifiSsid |
String |
wifiPsk |
String |
scanSsid |
boolean |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
ConectarConWi-FiNetworkSi Es necesario
public boolean connectToWifiNetworkIfNeeded (String wifiSsid, String wifiPsk)
Parámetros | |
---|---|
wifiSsid |
String |
wifiPsk |
String |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
createUser
public int createUser (String name, boolean guest, boolean ephemeral)
Parámetros | |
---|---|
name |
String |
guest |
boolean |
ephemeral |
boolean |
Muestra | |
---|---|
int |
Arroja | |
---|---|
DeviceNotAvailableException |
createUser
public int createUser (String name)
Parámetros | |
---|---|
name |
String |
Muestra | |
---|---|
int |
Arroja | |
---|---|
DeviceNotAvailableException |
createUserNoThrow
public int createUserNoThrow (String name)
Parámetros | |
---|---|
name |
String |
Muestra | |
---|---|
int |
Arroja | |
---|---|
DeviceNotAvailableException |
deleteFile
public void deleteFile (String deviceFilePath)
Parámetros | |
---|---|
deviceFilePath |
String |
Arroja | |
---|---|
DeviceNotAvailableException |
Reinicio en segundo plano del dispositivo
public boolean deviceSoftRestarted (ProcessInfo prevSystemServerProcess)
Parámetros | |
---|---|
prevSystemServerProcess |
ProcessInfo |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
Reinicio no definitiva desde el dispositivo
public boolean deviceSoftRestartedSince (long utcEpochTime, TimeUnit timeUnit)
Parámetros | |
---|---|
utcEpochTime |
long |
timeUnit |
TimeUnit |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
inhabilitarAdbRoot
public boolean disableAdbRoot ()
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
deshabilitar bloqueo de teclado
public void disableKeyguard ()
Arroja | |
---|---|
DeviceNotAvailableException |
inhabilitarNetworkMonitor
public boolean disableNetworkMonitor ()
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
DesconectarDeWi-Fi
public boolean disconnectFromWifi ()
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
haceArchivoexist
public boolean doesFileExist (String deviceFilePath)
Parámetros | |
---|---|
deviceFilePath |
String |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
Volcado de montón
public File dumpHeap (String process, String devicePath)
Parámetros | |
---|---|
process |
String |
devicePath |
String |
Muestra | |
---|---|
File |
Arroja | |
---|---|
DeviceNotAvailableException |
enableAdbRoot
public boolean enableAdbRoot ()
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
enableNetworkMonitor
public boolean enableNetworkMonitor ()
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
EncriptarDispositivo
public boolean encryptDevice (boolean inplace)
Parámetros | |
---|---|
inplace |
boolean |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
EjecutarAdbCommand
public String executeAdbCommand (long timeout, String... cmdArgs)
Parámetros | |
---|---|
timeout |
long |
cmdArgs |
String |
Muestra | |
---|---|
String |
Arroja | |
---|---|
DeviceNotAvailableException |
EjecutarAdbCommand
public String executeAdbCommand (String... cmdArgs)
Parámetros | |
---|---|
cmdArgs |
String |
Muestra | |
---|---|
String |
Arroja | |
---|---|
DeviceNotAvailableException |
EjecutarFastbootCommand
public CommandResult executeFastbootCommand (String... cmdArgs)
Parámetros | |
---|---|
cmdArgs |
String |
Muestra | |
---|---|
CommandResult |
Arroja | |
---|---|
DeviceNotAvailableException |
EjecutarFastbootCommand
public CommandResult executeFastbootCommand (long timeout, String... cmdArgs)
Parámetros | |
---|---|
timeout |
long |
cmdArgs |
String |
Muestra | |
---|---|
CommandResult |
Arroja | |
---|---|
DeviceNotAvailableException |
ejecutarLongFastbootCommand
public CommandResult executeLongFastbootCommand (String... cmdArgs)
Parámetros | |
---|---|
cmdArgs |
String |
Muestra | |
---|---|
CommandResult |
Arroja | |
---|---|
DeviceNotAvailableException |
Comando runShell
public String executeShellCommand (String command)
Parámetros | |
---|---|
command |
String |
Muestra | |
---|---|
String |
Arroja | |
---|---|
DeviceNotAvailableException |
Comando runShell
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 |
Arroja | |
---|---|
DeviceNotAvailableException |
Comando runShell
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 |
Arroja | |
---|---|
DeviceNotAvailableException |
Comando runShell
public void executeShellCommand (String command, IShellOutputReceiver receiver)
Parámetros | |
---|---|
command |
String |
receiver |
IShellOutputReceiver |
Arroja | |
---|---|
DeviceNotAvailableException |
Comando runShellV2
public CommandResult executeShellV2Command (String cmd)
Parámetros | |
---|---|
cmd |
String |
Muestra | |
---|---|
CommandResult |
Arroja | |
---|---|
DeviceNotAvailableException |
Comando runShellV2
public CommandResult executeShellV2Command (String cmd, OutputStream pipeToOutput)
Parámetros | |
---|---|
cmd |
String |
pipeToOutput |
OutputStream |
Muestra | |
---|---|
CommandResult |
Arroja | |
---|---|
DeviceNotAvailableException |
Comando runShellV2
public CommandResult executeShellV2Command (String cmd, File pipeAsInput)
Parámetros | |
---|---|
cmd |
String |
pipeAsInput |
File |
Muestra | |
---|---|
CommandResult |
Arroja | |
---|---|
DeviceNotAvailableException |
Comando runShellV2
public CommandResult executeShellV2Command (String cmd, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
Parámetros | |
---|---|
cmd |
String |
maxTimeoutForCommand |
long |
timeUnit |
TimeUnit |
retryAttempts |
int |
Muestra | |
---|---|
CommandResult |
Arroja | |
---|---|
DeviceNotAvailableException |
Comando runShellV2
public CommandResult executeShellV2Command (String cmd, long maxTimeoutForCommand, TimeUnit timeUnit)
Parámetros | |
---|---|
cmd |
String |
maxTimeoutForCommand |
long |
timeUnit |
TimeUnit |
Muestra | |
---|---|
CommandResult |
Arroja | |
---|---|
DeviceNotAvailableException |
Comando runShellV2
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 |
Muestra | |
---|---|
CommandResult |
Arroja | |
---|---|
DeviceNotAvailableException |
Comando runShellV2
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 |
Muestra | |
---|---|
CommandResult |
Arroja | |
---|---|
DeviceNotAvailableException |
fastbootWipePartition.
public CommandResult fastbootWipePartition (String partition)
Parámetros | |
---|---|
partition |
String |
Muestra | |
---|---|
CommandResult |
Arroja | |
---|---|
DeviceNotAvailableException |
getActiveApexes
publicgetActiveApexes ()
Muestra | |
---|---|
|
Arroja | |
---|---|
DeviceNotAvailableException |
getAllSettings
publicgetAllSettings (String namespace)
Parámetros | |
---|---|
namespace |
String |
Muestra | |
---|---|
|
Arroja | |
---|---|
DeviceNotAvailableException |
getAllocationState
public DeviceAllocationState getAllocationState ()
Muestra | |
---|---|
DeviceAllocationState |
getAndroidId
public String getAndroidId (int userId)
Parámetros | |
---|---|
userId |
int |
Muestra | |
---|---|
String |
Arroja | |
---|---|
DeviceNotAvailableException |
getAndroidIds
publicgetAndroidIds ()
Muestra | |
---|---|
|
Arroja | |
---|---|
DeviceNotAvailableException |
getApiLevel.
public int getApiLevel ()
Muestra | |
---|---|
int |
Arroja | |
---|---|
DeviceNotAvailableException |
getAppPackageInfo
public PackageInfo getAppPackageInfo (String packageName)
Parámetros | |
---|---|
packageName |
String |
Muestra | |
---|---|
PackageInfo |
Arroja | |
---|---|
DeviceNotAvailableException |
getAppPackageInfos
publicgetAppPackageInfos ()
Muestra | |
---|---|
|
Arroja | |
---|---|
DeviceNotAvailableException |
getBasebandVersion
public String getBasebandVersion ()
Muestra | |
---|---|
String |
Arroja | |
---|---|
DeviceNotAvailableException |
getBatería
public Integer getBattery ()
Muestra | |
---|---|
Integer |
getBooleanProperty
public boolean getBooleanProperty (String name, boolean defaultValue)
Parámetros | |
---|---|
name |
String |
defaultValue |
boolean |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
getBootHistory
publicgetBootHistory ()
Muestra | |
---|---|
|
Arroja | |
---|---|
DeviceNotAvailableException |
getBootHistoryDesde
publicgetBootHistorySince (long utcEpochTime, TimeUnit timeUnit)
Parámetros | |
---|---|
utcEpochTime |
long |
timeUnit |
TimeUnit |
Muestra | |
---|---|
|
Arroja | |
---|---|
DeviceNotAvailableException |
getBootloaderVersion
public String getBootloaderVersion ()
Muestra | |
---|---|
String |
Arroja | |
---|---|
DeviceNotAvailableException |
informe getBug
public InputStreamSource getBugreport ()
Muestra | |
---|---|
InputStreamSource |
getBugreportz
public InputStreamSource getBugreportz ()
Muestra | |
---|---|
InputStreamSource |
getBuildAlias
public String getBuildAlias ()
Muestra | |
---|---|
String |
Arroja | |
---|---|
DeviceNotAvailableException |
getBuildFlavor.
public String getBuildFlavor ()
Muestra | |
---|---|
String |
Arroja | |
---|---|
DeviceNotAvailableException |
getBuildId
public String getBuildId ()
Muestra | |
---|---|
String |
Arroja | |
---|---|
DeviceNotAvailableException |
getBuildSigningKeys.
public String getBuildSigningKeys ()
Muestra | |
---|---|
String |
Arroja | |
---|---|
DeviceNotAvailableException |
getCachedDeviceDescriptor
public DeviceDescriptor getCachedDeviceDescriptor ()
Muestra | |
---|---|
DeviceDescriptor |
getChildren
public String[] getChildren (String path)
Parámetros | |
---|---|
path |
String |
Muestra | |
---|---|
String[] |
Arroja | |
---|---|
DeviceNotAvailableException |
getCurrentFoldableState
public DeviceFoldableState getCurrentFoldableState ()
Muestra | |
---|---|
DeviceFoldableState |
Arroja | |
---|---|
DeviceNotAvailableException |
getCurrentUser.
public int getCurrentUser ()
Muestra | |
---|---|
int |
Arroja | |
---|---|
DeviceNotAvailableException |
getDeviceClass
public String getDeviceClass ()
Muestra | |
---|---|
String |
getDeviceDate
public long getDeviceDate ()
Muestra | |
---|---|
long |
Arroja | |
---|---|
DeviceNotAvailableException |
getDeviceDescriptor.
public DeviceDescriptor getDeviceDescriptor ()
Muestra | |
---|---|
DeviceDescriptor |
getDeviceState
public TestDeviceState getDeviceState ()
Muestra | |
---|---|
TestDeviceState |
getDeviceTimeOffset
public long getDeviceTimeOffset (Date date)
Parámetros | |
---|---|
date |
Date |
Muestra | |
---|---|
long |
Arroja | |
---|---|
DeviceNotAvailableException |
getEmulatorOutput
public InputStreamSource getEmulatorOutput ()
Muestra | |
---|---|
InputStreamSource |
getEmulatorProcess
public Process getEmulatorProcess ()
Muestra | |
---|---|
Process |
getExecuteShellCommandLog
public final File getExecuteShellCommandLog ()
El registro que contiene todos los registros de executeShellCommand(String)
.
Muestra | |
---|---|
File |
getExternalStoreFreeSpace
public long getExternalStoreFreeSpace ()
Muestra | |
---|---|
long |
Arroja | |
---|---|
DeviceNotAvailableException |
getFastbootPath
public String getFastbootPath ()
Muestra | |
---|---|
String |
getFastbootProductType
public String getFastbootProductType ()
Muestra | |
---|---|
String |
Arroja | |
---|---|
DeviceNotAvailableException |
getFastbootProductVariant
public String getFastbootProductVariant ()
Muestra | |
---|---|
String |
Arroja | |
---|---|
DeviceNotAvailableException |
getFastbootSerialNumber
public String getFastbootSerialNumber ()
Muestra | |
---|---|
String |
getFastbootVariable
public String getFastbootVariable (String variableName)
Parámetros | |
---|---|
variableName |
String |
Muestra | |
---|---|
String |
Arroja | |
---|---|
DeviceNotAvailableException |
getFastbootVersion
public String getFastbootVersion ()
Muestra | |
---|---|
String |
getFileEntry
public IFileEntry getFileEntry (String path)
Parámetros | |
---|---|
path |
String |
Muestra | |
---|---|
IFileEntry |
Arroja | |
---|---|
DeviceNotAvailableException |
getFileEntry
public IFileEntry getFileEntry (FileListingService.FileEntry entry)
Es un asistente no oficial para obtener un FileEntry
de una ruta no raíz. FIXME: Refactoriza
FileEntry para tenerla disponible desde cualquier ruta. (incluso los que no son raíz).
Parámetros | |
---|---|
entry |
FileListingService.FileEntry : Es un FileEntry que no necesariamente tiene permisos de administrador como lo requiere Ddmlib. |
Muestra | |
---|---|
IFileEntry |
Un FileEntryWrapper que representa a FileEntry |
Arroja | |
---|---|
DeviceNotAvailableException |
getFoldableStates
publicgetFoldableStates ()
Muestra | |
---|---|
|
Arroja | |
---|---|
DeviceNotAvailableException |
getIDevice
public IDevice getIDevice ()
Muestra | |
---|---|
IDevice |
getInstallPackageNames
publicgetInstalledPackageNames ()
Muestra | |
---|---|
|
Arroja | |
---|---|
DeviceNotAvailableException |
getIntProperty
public long getIntProperty (String name, long defaultValue)
Parámetros | |
---|---|
name |
String |
defaultValue |
long |
Muestra | |
---|---|
long |
Arroja | |
---|---|
DeviceNotAvailableException |
getIpAddress
public String getIpAddress ()
Muestra | |
---|---|
String |
Arroja | |
---|---|
DeviceNotAvailableException |
getKeyguardState
public KeyguardControllerState getKeyguardState ()
Muestra | |
---|---|
KeyguardControllerState |
Arroja | |
---|---|
DeviceNotAvailableException |
getLastExpectedRestartTimeMillis
public long getLastExpectedRebootTimeMillis ()
Muestra | |
---|---|
long |
getLaunchApiLevel
public int getLaunchApiLevel ()
Muestra | |
---|---|
int |
Arroja | |
---|---|
DeviceNotAvailableException |
getLogcat.
public InputStreamSource getLogcat ()
Muestra | |
---|---|
InputStreamSource |
getLogcat.
public InputStreamSource getLogcat (int maxBytes)
Parámetros | |
---|---|
maxBytes |
int |
Muestra | |
---|---|
InputStreamSource |
getLogcatDump.
public InputStreamSource getLogcatDump ()
Muestra | |
---|---|
InputStreamSource |
getLogcatdesde.
public InputStreamSource getLogcatSince (long date)
Parámetros | |
---|---|
date |
long |
Muestra | |
---|---|
InputStreamSource |
getMacAddress
public String getMacAddress ()
Muestra | |
---|---|
String |
getMainlineModuleInfo
publicgetMainlineModuleInfo ()
Muestra | |
---|---|
|
Arroja | |
---|---|
DeviceNotAvailableException |
getMaxNumberOfRunningUsersSupported
public int getMaxNumberOfRunningUsersSupported ()
Muestra | |
---|---|
int |
Arroja | |
---|---|
DeviceNotAvailableException |
getMaxNumberOfUsersSupported
public int getMaxNumberOfUsersSupported ()
Muestra | |
---|---|
int |
Arroja | |
---|---|
DeviceNotAvailableException |
getMonitor.
public IDeviceStateMonitor getMonitor ()
Muestra | |
---|---|
IDeviceStateMonitor |
getMountPoint
public String getMountPoint (String mountName)
Parámetros | |
---|---|
mountName |
String |
Muestra | |
---|---|
String |
getMountPointInfo
public ITestDevice.MountPointInfo getMountPointInfo (String mountpoint)
Parámetros | |
---|---|
mountpoint |
String |
Muestra | |
---|---|
ITestDevice.MountPointInfo |
Arroja | |
---|---|
DeviceNotAvailableException |
getMountPointInfo
publicgetMountPointInfo ()
Muestra | |
---|---|
|
Arroja | |
---|---|
DeviceNotAvailableException |
getOptions
public TestDeviceOptions getOptions ()
Muestra | |
---|---|
TestDeviceOptions |
getPartitionFreeSpace
public long getPartitionFreeSpace (String partition)
Parámetros | |
---|---|
partition |
String |
Muestra | |
---|---|
long |
Arroja | |
---|---|
DeviceNotAvailableException |
ID de usuario principal de getPrimary
public Integer getPrimaryUserId ()
Muestra | |
---|---|
Integer |
Arroja | |
---|---|
DeviceNotAvailableException |
getProcessByName
public ProcessInfo getProcessByName (String processName)
Parámetros | |
---|---|
processName |
String |
Muestra | |
---|---|
ProcessInfo |
Arroja | |
---|---|
DeviceNotAvailableException |
getProcessPid
public String getProcessPid (String process)
Parámetros | |
---|---|
process |
String |
Muestra | |
---|---|
String |
Arroja | |
---|---|
DeviceNotAvailableException |
getProductType
public String getProductType ()
Muestra | |
---|---|
String |
Arroja | |
---|---|
DeviceNotAvailableException |
getProductVariant
public String getProductVariant ()
Muestra | |
---|---|
String |
Arroja | |
---|---|
DeviceNotAvailableException |
getProperty
public String getProperty (String name)
Parámetros | |
---|---|
name |
String |
Muestra | |
---|---|
String |
Arroja | |
---|---|
DeviceNotAvailableException |
getRecoveryMode.
public ITestDevice.RecoveryMode getRecoveryMode ()
Muestra | |
---|---|
ITestDevice.RecoveryMode |
obtener captura de pantalla
public InputStreamSource getScreenshot (String format)
Parámetros | |
---|---|
format |
String |
Muestra | |
---|---|
InputStreamSource |
Arroja | |
---|---|
DeviceNotAvailableException |
obtener captura de pantalla
public InputStreamSource getScreenshot (long displayId)
Parámetros | |
---|---|
displayId |
long |
Muestra | |
---|---|
InputStreamSource |
Arroja | |
---|---|
DeviceNotAvailableException |
obtener captura de pantalla
public InputStreamSource getScreenshot (String format, boolean rescale)
Parámetros | |
---|---|
format |
String |
rescale |
boolean |
Muestra | |
---|---|
InputStreamSource |
Arroja | |
---|---|
DeviceNotAvailableException |
obtener captura de pantalla
public InputStreamSource getScreenshot ()
Muestra | |
---|---|
InputStreamSource |
Arroja | |
---|---|
DeviceNotAvailableException |
getSerialNumber
public String getSerialNumber ()
Muestra | |
---|---|
String |
getSetting
public String getSetting (int userId, String namespace, String key)
Parámetros | |
---|---|
userId |
int |
namespace |
String |
key |
String |
Muestra | |
---|---|
String |
Arroja | |
---|---|
DeviceNotAvailableException |
getSetting
public String getSetting (String namespace, String key)
Parámetros | |
---|---|
namespace |
String |
key |
String |
Muestra | |
---|---|
String |
Arroja | |
---|---|
DeviceNotAvailableException |
getSimOperator
public String getSimOperator ()
Muestra | |
---|---|
String |
getSimState
public String getSimState ()
Muestra | |
---|---|
String |
getTombstones
publicgetTombstones ()
Muestra | |
---|---|
|
Arroja | |
---|---|
DeviceNotAvailableException |
getTotalMemory
public long getTotalMemory ()
Muestra | |
---|---|
long |
getUninstallablePackageNames
publicgetUninstallablePackageNames ()
Muestra | |
---|---|
|
Arroja | |
---|---|
DeviceNotAvailableException |
getUseFastbootBorra
public boolean getUseFastbootErase ()
Muestra | |
---|---|
boolean |
getUserFlags.
public int getUserFlags (int userId)
Parámetros | |
---|---|
userId |
int |
Muestra | |
---|---|
int |
Arroja | |
---|---|
DeviceNotAvailableException |
getUserInfos
publicgetUserInfos ()
Muestra | |
---|---|
|
Arroja | |
---|---|
DeviceNotAvailableException |
getUserSerialNumber
public int getUserSerialNumber (int userId)
Parámetros | |
---|---|
userId |
int |
Muestra | |
---|---|
int |
Arroja | |
---|---|
DeviceNotAvailableException |
controladordeAsignaciónEvent
public IManagedTestDevice.DeviceEventResponse handleAllocationEvent (DeviceEvent event)
Procesar el DeviceEvent, lo que puede o no hacer la transición de este dispositivo a una nueva asignación para cada estado.
Parámetros | |
---|---|
event |
DeviceEvent |
Muestra | |
---|---|
IManagedTestDevice.DeviceEventResponse |
hasFeature
public boolean hasFeature (String feature)
Parámetros | |
---|---|
feature |
String |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
installPackage
public String installPackage (File packageFile, boolean reinstall, String... extraArgs)
Parámetros | |
---|---|
packageFile |
File |
reinstall |
boolean |
extraArgs |
String |
Muestra | |
---|---|
String |
Arroja | |
---|---|
DeviceNotAvailableException |
installPackage
public String installPackage (File packageFile, boolean reinstall, boolean grantPermissions, String... extraArgs)
Parámetros | |
---|---|
packageFile |
File |
reinstall |
boolean |
grantPermissions |
boolean |
extraArgs |
String |
Muestra | |
---|---|
String |
Arroja | |
---|---|
DeviceNotAvailableException |
installPackageForUser
public String installPackageForUser (File packageFile, boolean reinstall, int userId, String... extraArgs)
Parámetros | |
---|---|
packageFile |
File |
reinstall |
boolean |
userId |
int |
extraArgs |
String |
Muestra | |
---|---|
String |
Arroja | |
---|---|
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 |
Muestra | |
---|---|
String |
Arroja | |
---|---|
DeviceNotAvailableException |
RaízAdB
public boolean isAdbRoot ()
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
isAdbTcp
public boolean isAdbTcp ()
Muestra | |
---|---|
boolean |
isAppEnumerationSupported
public boolean isAppEnumerationSupported ()
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
isDeviceEncrypted
public boolean isDeviceEncrypted ()
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
isDirectory
public boolean isDirectory (String path)
Parámetros | |
---|---|
path |
String |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
RaízdeAdBAdm.
public boolean isEnableAdbRoot ()
Muestra | |
---|---|
boolean |
true si la raíz de adb debe estar habilitada en el dispositivo.
|
Compatible con la encriptación
public boolean isEncryptionSupported ()
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
Se puede ejecutar
public boolean isExecutable (String fullPath)
Parámetros | |
---|---|
fullPath |
String |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
estáFastbootEnabled
public boolean isFastbootEnabled ()
Muestra | |
---|---|
boolean |
Sin interfaz gráfica
public boolean isHeadless ()
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
Compatibilidad con múltiples usuarios
public boolean isMultiUserSupported ()
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
PaqueteInstalado
public boolean isPackageInstalled (String packageName, String userId)
Parámetros | |
---|---|
packageName |
String |
userId |
String |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
PaqueteInstalado
public boolean isPackageInstalled (String packageName)
Parámetros | |
---|---|
packageName |
String |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
isRuntimePermissionSupported
public boolean isRuntimePermissionSupported ()
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
isStateBootloaderOrFastbootd
public boolean isStateBootloaderOrFastbootd ()
Muestra | |
---|---|
boolean |
EstáUserRunning
public boolean isUserRunning (int userId)
Parámetros | |
---|---|
userId |
int |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
UsuarioSecundario
public boolean isUserSecondary (int userId)
Parámetros | |
---|---|
userId |
int |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
Wi-Fi habilitado
public boolean isWifiEnabled ()
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
IDDisplayDisplay
publiclistDisplayIds ()
Muestra | |
---|---|
|
Arroja | |
---|---|
DeviceNotAvailableException |
usuarios de la lista
publiclistUsers ()
Muestra | |
---|---|
|
Arroja | |
---|---|
DeviceNotAvailableException |
informe de errores de registro
public boolean logBugreport (String dataName, ITestLogger listener)
Parámetros | |
---|---|
dataName |
String |
listener |
ITestLogger |
Muestra | |
---|---|
boolean |
Dispositivo de acceso
public void logOnDevice (String tag, Log.LogLevel level, String format, Object... args)
Parámetros | |
---|---|
tag |
String |
level |
Log.LogLevel |
format |
String |
args |
Object |
reinicio no bloqueado
public void nonBlockingReboot ()
Arroja | |
---|---|
DeviceNotAvailableException |
postAdbRootAction
public void postAdbRootAction ()
Anula si el dispositivo necesita que se realicen algunas acciones específicas después de la raíz de adb y antes de que el dispositivo vuelva a estar en línea. La implementación predeterminada no incluye ninguna acción de adición. No se garantiza que la raíz de adb esté habilitada en esta etapa.
Arroja | |
---|---|
DeviceNotAvailableException |
postAdbUnrootAction
public void postAdbUnrootAction ()
Anula si el dispositivo necesita que se realicen algunas acciones específicas después de que adb desroot 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 la raíz de adb esté inhabilitada en esta etapa.
Arroja | |
---|---|
DeviceNotAvailableException |
Configuración posterior al arranque
public void postBootSetup ()
Arroja | |
---|---|
DeviceNotAvailableException |
TearDown después de la invocación
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 |
Arroja | |
---|---|
DeviceNotAvailableException |
|
TargetSetupError |
pullDir
public boolean pullDir (String deviceFilePath, File localDir)
Parámetros | |
---|---|
deviceFilePath |
String |
localDir |
File |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
Archivo pull
public boolean pullFile (String remoteFilePath, File localFile)
Parámetros | |
---|---|
remoteFilePath |
String |
localFile |
File |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
Archivo pull
public File pullFile (String remoteFilePath)
Parámetros | |
---|---|
remoteFilePath |
String |
Muestra | |
---|---|
File |
Arroja | |
---|---|
DeviceNotAvailableException |
pullFileContents
public String pullFileContents (String remoteFilePath)
Parámetros | |
---|---|
remoteFilePath |
String |
Muestra | |
---|---|
String |
Arroja | |
---|---|
DeviceNotAvailableException |
extraerArchivoDeexterno
public File pullFileFromExternal (String remoteFilePath)
Parámetros | |
---|---|
remoteFilePath |
String |
Muestra | |
---|---|
File |
Arroja | |
---|---|
DeviceNotAvailableException |
PushDir
public boolean pushDir (File localFileDir, String deviceFilePath,excludedDirectories)
Parámetros | |
---|---|
localFileDir |
File |
deviceFilePath |
String |
excludedDirectories |
|
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
PushDir
public boolean pushDir (File localFileDir, String deviceFilePath)
Parámetros | |
---|---|
localFileDir |
File |
deviceFilePath |
String |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
Archivo push
public boolean pushFile (File localFile, String remoteFilePath)
Parámetros | |
---|---|
localFile |
File |
remoteFilePath |
String |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
PushString
public boolean pushString (String contents, String remoteFilePath)
Parámetros | |
---|---|
contents |
String |
remoteFilePath |
String |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
reiniciar
public void reboot (String reason)
Parámetros | |
---|---|
reason |
String |
Arroja | |
---|---|
DeviceNotAvailableException |
reiniciar
public void reboot ()
Arroja | |
---|---|
DeviceNotAvailableException |
reiniciarIntoBootloader
public void rebootIntoBootloader ()
Arroja | |
---|---|
DeviceNotAvailableException |
reiniciarIntoFastbootd
public void rebootIntoFastbootd ()
Arroja | |
---|---|
DeviceNotAvailableException |
reinicio en la recuperación
public void rebootIntoRecovery ()
Arroja | |
---|---|
DeviceNotAvailableException |
reiniciarIntoSideload
public void rebootIntoSideload ()
Arroja | |
---|---|
DeviceNotAvailableException |
reiniciarIntoSideload
public void rebootIntoSideload (boolean autoReboot)
Parámetros | |
---|---|
autoReboot |
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
reiniciarHastaEn línea
public void rebootUntilOnline ()
Arroja | |
---|---|
DeviceNotAvailableException |
reiniciarHastaEn línea
public void rebootUntilOnline (String reason)
Parámetros | |
---|---|
reason |
String |
Arroja | |
---|---|
DeviceNotAvailableException |
espacio de usuario de reinicio
public void rebootUserspace ()
Arroja | |
---|---|
DeviceNotAvailableException |
reiniciarelespaciodeusuarioHastaEn línea
public void rebootUserspaceUntilOnline ()
Arroja | |
---|---|
DeviceNotAvailableException |
recuperarDispositivo
public void recoverDevice ()
Intenta recuperar la comunicación con el dispositivo.
Arroja | |
---|---|
DeviceNotAvailableException |
si el dispositivo ya no está disponible |
remountSystemWritable
public void remountSystemWritable ()
Arroja | |
---|---|
DeviceNotAvailableException |
remountVendorWritable
public void remountVendorWritable ()
Arroja | |
---|---|
DeviceNotAvailableException |
quitarAdministrador
public boolean removeAdmin (String componentName, int userId)
Parámetros | |
---|---|
componentName |
String |
userId |
int |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
quitarPropietarios
public void removeOwners ()
Arroja | |
---|---|
DeviceNotAvailableException |
quitar el usuario
public boolean removeUser (int userId)
Parámetros | |
---|---|
userId |
int |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
restablecerContentProviderConfiguración
public void resetContentProviderSetup ()
Restablece la marca de la configuración del proveedor de contenido para volver a activarla.
runInstrumentationTests
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner, ITestLifeCycleReceiver... listeners)
Parámetros | |
---|---|
runner |
IRemoteAndroidTestRunner |
listeners |
ITestLifeCycleReceiver |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
runInstrumentationTests
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner,listeners)
Parámetros | |
---|---|
runner |
IRemoteAndroidTestRunner |
listeners |
|
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
runInstrumentationTestsComoUsuario
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, ITestLifeCycleReceiver... listeners)
Parámetros | |
---|---|
runner |
IRemoteAndroidTestRunner |
userId |
int |
listeners |
ITestLifeCycleReceiver |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
runInstrumentationTestsComoUsuario
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId,listeners)
Parámetros | |
---|---|
runner |
IRemoteAndroidTestRunner |
userId |
int |
listeners |
|
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
setConfiguration
public void setConfiguration (IConfiguration configuration)
Inserta el IConfiguration
en uso.
Parámetros | |
---|---|
configuration |
IConfiguration |
Configurar Fecha
public void setDate (Date date)
Parámetros | |
---|---|
date |
Date |
Arroja | |
---|---|
DeviceNotAvailableException |
setDeviceOwner
public boolean setDeviceOwner (String componentName, int userId)
Parámetros | |
---|---|
componentName |
String |
userId |
int |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
setDeviceState
public void setDeviceState (TestDeviceState deviceState)
Parámetros | |
---|---|
deviceState |
TestDeviceState |
setEmulatorOutputStream
public void setEmulatorOutputStream (SizeLimitedOutputStream output)
Para el emulador, configura SizeLimitedOutputStream
para registrar resultados
Parámetros | |
---|---|
output |
SizeLimitedOutputStream : Para registrar el resultado
|
setEmulatorProcess
public void setEmulatorProcess (Process p)
Parámetros | |
---|---|
p |
Process |
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 |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
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 |
Arroja | |
---|---|
DeviceNotAvailableException |
setSetting
public void setSetting (int userId, String namespace, String key, String value)
Parámetros | |
---|---|
userId |
int |
namespace |
String |
key |
String |
value |
String |
Arroja | |
---|---|
DeviceNotAvailableException |
setUsarInicioRápidoBorrar
public void setUseFastbootErase (boolean useFastbootErase)
Parámetros | |
---|---|
useFastbootErase |
boolean |
startLogcat
public void startLogcat ()
Usuario de inicio
public boolean startUser (int userId)
Parámetros | |
---|---|
userId |
int |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
Usuario de inicio
public boolean startUser (int userId, boolean waitFlag)
Parámetros | |
---|---|
userId |
int |
waitFlag |
boolean |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
stopEmulatorOutput
public void stopEmulatorOutput ()
detenerLogcat
public void stopLogcat ()
usuario detención
public boolean stopUser (int userId)
Parámetros | |
---|---|
userId |
int |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
usuario detención
public boolean stopUser (int userId, boolean waitFlag, boolean forceFlag)
Parámetros | |
---|---|
userId |
int |
waitFlag |
boolean |
forceFlag |
boolean |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
cambiarAAdbTcp
public String switchToAdbTcp ()
Muestra | |
---|---|
String |
Arroja | |
---|---|
DeviceNotAvailableException |
cambiarAAdbusb
public boolean switchToAdbUsb ()
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
Cambiar de usuario
public boolean switchUser (int userId)
Parámetros | |
---|---|
userId |
int |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
Cambiar de usuario
public boolean switchUser (int userId, long timeout)
Parámetros | |
---|---|
userId |
int |
timeout |
long |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
Archivos sincronizados
public boolean syncFiles (File localFileDir, String deviceFilePath)
Parámetros | |
---|---|
localFileDir |
File |
deviceFilePath |
String |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
informe de errores de toma
public Bugreport takeBugreport ()
Muestra | |
---|---|
Bugreport |
desencriptarDevice
public boolean unencryptDevice ()
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
desinstalarPaquete
public String uninstallPackage (String packageName)
Parámetros | |
---|---|
packageName |
String |
Muestra | |
---|---|
String |
Arroja | |
---|---|
DeviceNotAvailableException |
desinstalarPaqueteParaUsuario
public String uninstallPackageForUser (String packageName, int userId)
Parámetros | |
---|---|
packageName |
String |
userId |
int |
Muestra | |
---|---|
String |
Arroja | |
---|---|
DeviceNotAvailableException |
desbloquearDispositivo
public boolean unlockDevice ()
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
waitForBootComplete
public boolean waitForBootComplete (long timeOut)
Parámetros | |
---|---|
timeOut |
long |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
waitForDeviceAvailable
public void waitForDeviceAvailable ()
Arroja | |
---|---|
DeviceNotAvailableException |
waitForDeviceAvailable
public void waitForDeviceAvailable (long waitTime)
Parámetros | |
---|---|
waitTime |
long |
Arroja | |
---|---|
DeviceNotAvailableException |
waitForDeviceInRecovery
public boolean waitForDeviceInRecovery (long waitTime)
Parámetros | |
---|---|
waitTime |
long |
Muestra | |
---|---|
boolean |
waitForDeviceInSideload
public boolean waitForDeviceInSideload (long waitTime)
Parámetros | |
---|---|
waitTime |
long |
Muestra | |
---|---|
boolean |
waitForDeviceNotAvailable
public boolean waitForDeviceNotAvailable (long waitTime)
Parámetros | |
---|---|
waitTime |
long |
Muestra | |
---|---|
boolean |
waitForDeviceEn línea
public void waitForDeviceOnline ()
Arroja | |
---|---|
DeviceNotAvailableException |
waitForDeviceEn línea
public void waitForDeviceOnline (long waitTime)
Parámetros | |
---|---|
waitTime |
long |
Arroja | |
---|---|
DeviceNotAvailableException |
waitForDeviceShell
public boolean waitForDeviceShell (long waitTime)
Parámetros | |
---|---|
waitTime |
long |
Muestra | |
---|---|
boolean |
Métodos protegidos
checkApiLevelAgainst
protected void checkApiLevelAgainst (String feature, int strictMinLevel)
Parámetros | |
---|---|
feature |
String |
strictMinLevel |
int |
createRestartDeviceAction
protected NativeDevice.RebootDeviceAction createRebootDeviceAction (NativeDevice.RebootMode rebootMode, String reason)
Crea un RebootDeviceAction
para usar cuando se realice una acción de reinicio.
Parámetros | |
---|---|
rebootMode |
NativeDevice.RebootMode : Es un modo de este reinicio. |
reason |
String : Para este reinicio. |
Muestra | |
---|---|
NativeDevice.RebootDeviceAction |
el RebootDeviceAction creado.
|
Reinicio de doAdb
protected void doAdbReboot (NativeDevice.RebootMode rebootMode, String reason)
Ejecuta un reinicio de adb.
Parámetros | |
---|---|
rebootMode |
NativeDevice.RebootMode : Es un modo de este reinicio. |
reason |
String : Para este reinicio. |
Arroja | |
---|---|
DeviceNotAvailableException |
AssuredRuntimePermissionSupported
protected void ensureRuntimePermissionSupported ()
un método auxiliar para arrojar una excepción si no se admite el permiso de tiempo de ejecución
Arroja | |
---|---|
DeviceNotAvailableException |
getBugreportInterno
protected InputStreamSource getBugreportInternal ()
Muestra | |
---|---|
InputStreamSource |
getBugreportzInterno
protected File getBugreportzInternal ()
Es un método de ayuda interno para obtener el archivo ZIP bugreportz como ERROR(/File)
.
Muestra | |
---|---|
File |
getRunUtil
protected IRunUtil getRunUtil ()
Obtén la instancia de RunUtil
que se usará.
Muestra | |
---|---|
IRunUtil |
internalGetProperty
protected String internalGetProperty (String propName, String fastbootVar, String description)
Recupera una propiedad de dispositivo, a partir de la caché de ddmlib de forma predeterminada, y recurrir a "adb" shell getprop` o `fastboot getvar`, según si el dispositivo está en Fastboot o no.
Parámetros | |
---|---|
propName |
String : Es el nombre de la propiedad del dispositivo como lo muestra "adb shell getprop". |
fastbootVar |
String : Es el nombre de la variable de fastboot equivalente a consultar. si null ,
No se intentará realizar la consulta de fastboot |
description |
String : Es una descripción simple de la variable. La primera letra debe estar en mayúscula. |
Muestra | |
---|---|
String |
Es una cadena, posiblemente null o vacía, que contiene el valor de la propiedad determinada.
|
Arroja | |
---|---|
DeviceNotAvailableException |
Más reciente
protected boolean isNewer (File localFile, IFileEntry entry)
Muestra true
si el archivo local es más reciente que el archivo remoto. IFileEntry
es
con una precisión exacta del minuto, en caso de que la misma duración, el archivo se considere más reciente.
Parámetros | |
---|---|
localFile |
File |
entry |
IFileEntry |
Muestra | |
---|---|
boolean |
realice una acción en el dispositivo
protected boolean performDeviceAction (String actionDescription, com.android.tradefed.device.NativeDevice.DeviceAction action, int retryAttempts)
Realiza una acción en este dispositivo. Intentos de recuperación del dispositivo y, opcionalmente, reintentar el comando si la acción falla.
Parámetros | |
---|---|
actionDescription |
String : Es una descripción breve de la acción que se realizará. Se usa para el registro
con fines de seguridad. |
action |
com.android.tradefed.device.NativeDevice.DeviceAction : Es la acción que se realizará. |
retryAttempts |
int : El reintento intenta realizar la acción si falla, pero
la recuperación es exitosa |
Muestra | |
---|---|
boolean |
true si la acción se realizó correctamente |
Arroja | |
---|---|
DeviceNotAvailableException |
si falla el intento de recuperación o la cantidad máxima de intentos realizados sin correcto |
Reinicio de post Adb
protected void postAdbReboot ()
Posibles acciones adicionales que se pueden realizar después de reiniciar el dispositivo.
Arroja | |
---|---|
DeviceNotAvailableException |
Configuración previa al inicio posterior
protected void prePostBootSetup ()
Permite que cada tipo de dispositivo (AndroidNativeDevice, TestDevice) anule este método para una configuración específica posterior al inicio.
Arroja | |
---|---|
DeviceNotAvailableException |
Configurar reloj
protected void setClock (Clock clock)
Configura la instancia de reloj que se usará.
Parámetros | |
---|---|
clock |
Clock |
setLogStartDelay
protected void setLogStartDelay (int delay)
Establece el tiempo en ms que se debe esperar antes de iniciar la captura de logcat para un dispositivo en línea.
Parámetros | |
---|---|
delay |
int : la demora en ms
|
waitForDeviceNotAvailable
protected void waitForDeviceNotAvailable (String operationDesc, long time)
Parámetros | |
---|---|
operationDesc |
String |
time |
long |