NativeDevice
public
class
NativeDevice
extends Object
implements
IManagedTestDevice,
IConfigurationReceiver
java.lang.Object | |
↳ | com.android.tradefed.device.NativeDevice |
Implementación predeterminada de un dispositivo Android ITestDevice
sin pila completa.
Resumen
Clases anidadas | |
---|---|
class |
NativeDevice.AdbAction
Un |
class |
NativeDevice.AdbShellAction
|
class |
NativeDevice.RebootDeviceAction
|
enum |
NativeDevice.RebootMode
Es 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 comandos que se deben 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)
Procesa el DeviceEvent, que puede o no migrar 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()
Anula esta opción si el dispositivo necesita que se realicen algunas acciones específicas después de adb root y antes de que el dispositivo vuelva a estar en línea. |
void
|
postAdbUnrootAction()
Anula esta opción si el dispositivo necesita que se realicen algunas acciones específicas después de que adb quite el estado de raíz 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 del dispositivo. |
void
|
remountSystemWritable()
|
void
|
remountVendorWritable()
|
boolean
|
removeAdmin(String componentName, int userId)
|
void
|
removeOwners()
|
boolean
|
removeUser(int userId)
|
void
|
resetContentProviderSetup()
Restablece la marca de 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)
Inyecta el |
void
|
setDate(Date date)
|
boolean
|
setDeviceOwner(String componentName, int userId)
|
void
|
setDeviceState(TestDeviceState deviceState)
|
void
|
setEmulatorOutputStream(SizeLimitedOutputStream output)
Para el emulador, establece |
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)
Realiza un reinicio de adb. |
void
|
ensureRuntimePermissionSupported()
método de ayuda para generar una excepción si no se admite el permiso de tiempo de ejecución |
InputStreamSource
|
getBugreportInternal()
|
File
|
getBugreportzInternal()
Método de ayuda interno para obtener el archivo ZIP de bugreportz como |
IRunUtil
|
getRunUtil()
Obtén la instancia de |
String
|
internalGetProperty(String propName, String fastbootVar, String description)
Recupera una propiedad del dispositivo, de la caché de ddmlib de forma predeterminada, y recurre 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()
Son posibles acciones adicionales que se pueden realizar después de un reinicio. |
void
|
prePostBootSetup()
Permite que cada tipo de dispositivo (AndroidNativeDevice, TestDevice) anule este método para una configuración específica después del inicio. |
void
|
setClock(Clock clock)
Establece 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
INVALID_USER_ID
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: -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
la cantidad predeterminada de reintentos de comandos que se deben realizar
Valor constante: 2 (0x00000002)
Campos
SD_CARD
protected static final String SD_CARD
STORAGE_EMULATED
protected static final String STORAGE_EMULATED
mOptions
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 : El IDevice asociado |
stateMonitor |
IDeviceStateMonitor : Es el mecanismo IDeviceStateMonitor que se usará. |
allocationMonitor |
IDeviceMonitor : El IDeviceMonitor para informar sobre los cambios de estado de 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 |
clearErrorDialogs
public boolean clearErrorDialogs ()
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
clearLastConnectedWifiNetwork
public void clearLastConnectedWifiNetwork ()
clearLogcat
public void clearLogcat ()
connectToWifiNetwork
public boolean connectToWifiNetwork (String wifiSsid, String wifiPsk)
Parámetros | |
---|---|
wifiSsid |
String |
wifiPsk |
String |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
connectToWifiNetwork
public boolean connectToWifiNetwork (String wifiSsid, String wifiPsk, boolean scanSsid)
Parámetros | |
---|---|
wifiSsid |
String |
wifiPsk |
String |
scanSsid |
boolean |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
connectToWifiNetworkIfNeeded
public boolean connectToWifiNetworkIfNeeded (String wifiSsid, String wifiPsk, boolean scanSsid)
Parámetros | |
---|---|
wifiSsid |
String |
wifiPsk |
String |
scanSsid |
boolean |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
connectToWifiNetworkIfNeeded
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 |
deviceSoftRestarted
public boolean deviceSoftRestarted (ProcessInfo prevSystemServerProcess)
Parámetros | |
---|---|
prevSystemServerProcess |
ProcessInfo |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
deviceSoftRestartedSince
public boolean deviceSoftRestartedSince (long utcEpochTime, TimeUnit timeUnit)
Parámetros | |
---|---|
utcEpochTime |
long |
timeUnit |
TimeUnit |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
disableAdbRoot
public boolean disableAdbRoot ()
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
disableKeyguard
public void disableKeyguard ()
Arroja | |
---|---|
DeviceNotAvailableException |
disableNetworkMonitor
public boolean disableNetworkMonitor ()
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
disconnectFromWifi
public boolean disconnectFromWifi ()
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
doesFileExist
public boolean doesFileExist (String deviceFilePath)
Parámetros | |
---|---|
deviceFilePath |
String |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
dumpHeap
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 |
encryptDevice
public boolean encryptDevice (boolean inplace)
Parámetros | |
---|---|
inplace |
boolean |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
executeAdbCommand
public String executeAdbCommand (long timeout, String... cmdArgs)
Parámetros | |
---|---|
timeout |
long |
cmdArgs |
String |
Muestra | |
---|---|
String |
Arroja | |
---|---|
DeviceNotAvailableException |
executeAdbCommand
public String executeAdbCommand (String... cmdArgs)
Parámetros | |
---|---|
cmdArgs |
String |
Muestra | |
---|---|
String |
Arroja | |
---|---|
DeviceNotAvailableException |
executeFastbootCommand
public CommandResult executeFastbootCommand (String... cmdArgs)
Parámetros | |
---|---|
cmdArgs |
String |
Muestra | |
---|---|
CommandResult |
Arroja | |
---|---|
DeviceNotAvailableException |
executeFastbootCommand
public CommandResult executeFastbootCommand (long timeout, String... cmdArgs)
Parámetros | |
---|---|
timeout |
long |
cmdArgs |
String |
Muestra | |
---|---|
CommandResult |
Arroja | |
---|---|
DeviceNotAvailableException |
executeLongFastbootCommand
public CommandResult executeLongFastbootCommand (String... cmdArgs)
Parámetros | |
---|---|
cmdArgs |
String |
Muestra | |
---|---|
CommandResult |
Arroja | |
---|---|
DeviceNotAvailableException |
executeShellCommand
public String executeShellCommand (String command)
Parámetros | |
---|---|
command |
String |
Muestra | |
---|---|
String |
Arroja | |
---|---|
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 |
Arroja | |
---|---|
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 |
Arroja | |
---|---|
DeviceNotAvailableException |
executeShellCommand
public void executeShellCommand (String command, IShellOutputReceiver receiver)
Parámetros | |
---|---|
command |
String |
receiver |
IShellOutputReceiver |
Arroja | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd)
Parámetros | |
---|---|
cmd |
String |
Muestra | |
---|---|
CommandResult |
Arroja | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd, OutputStream pipeToOutput)
Parámetros | |
---|---|
cmd |
String |
pipeToOutput |
OutputStream |
Muestra | |
---|---|
CommandResult |
Arroja | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd, File pipeAsInput)
Parámetros | |
---|---|
cmd |
String |
pipeAsInput |
File |
Muestra | |
---|---|
CommandResult |
Arroja | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
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 |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd, long maxTimeoutForCommand, TimeUnit timeUnit)
Parámetros | |
---|---|
cmd |
String |
maxTimeoutForCommand |
long |
timeUnit |
TimeUnit |
Muestra | |
---|---|
CommandResult |
Arroja | |
---|---|
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 |
Muestra | |
---|---|
CommandResult |
Arroja | |
---|---|
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 |
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 |
getBattery
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 |
getBootHistorySince
publicgetBootHistorySince (long utcEpochTime, TimeUnit timeUnit)
Parámetros | |
---|---|
utcEpochTime |
long |
timeUnit |
TimeUnit |
Muestra | |
---|---|
|
Arroja | |
---|---|
DeviceNotAvailableException |
getBootloaderVersion
public String getBootloaderVersion ()
Muestra | |
---|---|
String |
Arroja | |
---|---|
DeviceNotAvailableException |
getBugreport
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 que no es raíz. FIXME: Refactoriza el sistema de FileEntry para que esté disponible desde cualquier ruta de acceso. (incluso sin permisos de administrador).
Parámetros | |
---|---|
entry |
FileListingService.FileEntry : Un FileEntry que no es necesariamente raíz, como lo requiere Ddmlib. |
Muestra | |
---|---|
IFileEntry |
Un FileEntryWrapper que representa el FileEntry. |
Arroja | |
---|---|
DeviceNotAvailableException |
getFoldableStates
publicgetFoldableStates ()
Muestra | |
---|---|
|
Arroja | |
---|---|
DeviceNotAvailableException |
getIDevice
public IDevice getIDevice ()
Muestra | |
---|---|
IDevice |
getInstalledPackageNames
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 |
getLastExpectedRebootTimeMillis
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 |
getLogcatSince
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 |
getPrimaryUserId
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 |
getScreenshot
public InputStreamSource getScreenshot (String format)
Parámetros | |
---|---|
format |
String |
Muestra | |
---|---|
InputStreamSource |
Arroja | |
---|---|
DeviceNotAvailableException |
getScreenshot
public InputStreamSource getScreenshot (long displayId)
Parámetros | |
---|---|
displayId |
long |
Muestra | |
---|---|
InputStreamSource |
Arroja | |
---|---|
DeviceNotAvailableException |
getScreenshot
public InputStreamSource getScreenshot (String format, boolean rescale)
Parámetros | |
---|---|
format |
String |
rescale |
boolean |
Muestra | |
---|---|
InputStreamSource |
Arroja | |
---|---|
DeviceNotAvailableException |
getScreenshot
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 |
getUseFastbootErase
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 |
handleAllocationEvent
public IManagedTestDevice.DeviceEventResponse handleAllocationEvent (DeviceEvent event)
Procesa el DeviceEvent, que puede o no migrar este dispositivo a un nuevo estado de asignación.
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 |
isAdbRoot
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 |
isEnableAdbRoot
public boolean isEnableAdbRoot ()
Muestra | |
---|---|
boolean |
true si se debe habilitar el permiso de administrador de adb en el dispositivo
|
isEncryptionSupported
public boolean isEncryptionSupported ()
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
isExecutable
public boolean isExecutable (String fullPath)
Parámetros | |
---|---|
fullPath |
String |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
isFastbootEnabled
public boolean isFastbootEnabled ()
Muestra | |
---|---|
boolean |
isHeadless
public boolean isHeadless ()
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
isMultiUserSupported
public boolean isMultiUserSupported ()
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
isPackageInstalled
public boolean isPackageInstalled (String packageName, String userId)
Parámetros | |
---|---|
packageName |
String |
userId |
String |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
isPackageInstalled
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 |
isUserRunning
public boolean isUserRunning (int userId)
Parámetros | |
---|---|
userId |
int |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
isUserSecondary
public boolean isUserSecondary (int userId)
Parámetros | |
---|---|
userId |
int |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
isWifiEnabled
public boolean isWifiEnabled ()
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
listDisplayIds
publiclistDisplayIds ()
Muestra | |
---|---|
|
Arroja | |
---|---|
DeviceNotAvailableException |
listUsers
publiclistUsers ()
Muestra | |
---|---|
|
Arroja | |
---|---|
DeviceNotAvailableException |
logBugreport
public boolean logBugreport (String dataName, ITestLogger listener)
Parámetros | |
---|---|
dataName |
String |
listener |
ITestLogger |
Muestra | |
---|---|
boolean |
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 ()
Arroja | |
---|---|
DeviceNotAvailableException |
postAdbRootAction
public void postAdbRootAction ()
Anula esta opción si el dispositivo necesita que se realicen algunas acciones específicas después de adb root y antes de que el dispositivo vuelva a estar en línea. La implementación predeterminada no incluye ninguna acción de adición. No se garantiza que adb root esté habilitado en esta etapa.
Arroja | |
---|---|
DeviceNotAvailableException |
postAdbUnrootAction
public void postAdbUnrootAction ()
Anula esta opción si el dispositivo necesita que se realicen algunas acciones específicas después de que adb quite el estado de raíz 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é inhabilitado en esta etapa.
Arroja | |
---|---|
DeviceNotAvailableException |
postBootSetup
public void postBootSetup ()
Arroja | |
---|---|
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 |
Arroja | |
---|---|
DeviceNotAvailableException |
|
TargetSetupError |
pullDir
public boolean pullDir (String deviceFilePath, File localDir)
Parámetros | |
---|---|
deviceFilePath |
String |
localDir |
File |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
pullFile
public boolean pullFile (String remoteFilePath, File localFile)
Parámetros | |
---|---|
remoteFilePath |
String |
localFile |
File |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
pullFile
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 |
pullFileFromExternal
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 |
pushFile
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 |
rebootIntoBootloader
public void rebootIntoBootloader ()
Arroja | |
---|---|
DeviceNotAvailableException |
rebootIntoFastbootd
public void rebootIntoFastbootd ()
Arroja | |
---|---|
DeviceNotAvailableException |
rebootIntoRecovery
public void rebootIntoRecovery ()
Arroja | |
---|---|
DeviceNotAvailableException |
rebootIntoSideload
public void rebootIntoSideload ()
Arroja | |
---|---|
DeviceNotAvailableException |
rebootIntoSideload
public void rebootIntoSideload (boolean autoReboot)
Parámetros | |
---|---|
autoReboot |
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
rebootUntilOnline
public void rebootUntilOnline ()
Arroja | |
---|---|
DeviceNotAvailableException |
rebootUntilOnline
public void rebootUntilOnline (String reason)
Parámetros | |
---|---|
reason |
String |
Arroja | |
---|---|
DeviceNotAvailableException |
rebootUserspace
public void rebootUserspace ()
Arroja | |
---|---|
DeviceNotAvailableException |
rebootUserspaceUntilOnline
public void rebootUserspaceUntilOnline ()
Arroja | |
---|---|
DeviceNotAvailableException |
recoverDevice
public void recoverDevice ()
Intenta recuperar la comunicación del dispositivo.
Arroja | |
---|---|
DeviceNotAvailableException |
si el dispositivo ya no está disponible |
remountSystemWritable
public void remountSystemWritable ()
Arroja | |
---|---|
DeviceNotAvailableException |
remountVendorWritable
public void remountVendorWritable ()
Arroja | |
---|---|
DeviceNotAvailableException |
removeAdmin
public boolean removeAdmin (String componentName, int userId)
Parámetros | |
---|---|
componentName |
String |
userId |
int |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
removeOwners
public void removeOwners ()
Arroja | |
---|---|
DeviceNotAvailableException |
removeUser
public boolean removeUser (int userId)
Parámetros | |
---|---|
userId |
int |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
resetContentProviderSetup
public void resetContentProviderSetup ()
Restablece la marca de 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 |
runInstrumentationTestsAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, ITestLifeCycleReceiver... listeners)
Parámetros | |
---|---|
runner |
IRemoteAndroidTestRunner |
userId |
int |
listeners |
ITestLifeCycleReceiver |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
runInstrumentationTestsAsUser
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)
Inyecta el IConfiguration
en uso.
Parámetros | |
---|---|
configuration |
IConfiguration |
setDate
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, establece SizeLimitedOutputStream
para registrar el resultado
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 |
setUseFastbootErase
public void setUseFastbootErase (boolean useFastbootErase)
Parámetros | |
---|---|
useFastbootErase |
boolean |
startLogcat
public void startLogcat ()
startUser
public boolean startUser (int userId)
Parámetros | |
---|---|
userId |
int |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
startUser
public boolean startUser (int userId, boolean waitFlag)
Parámetros | |
---|---|
userId |
int |
waitFlag |
boolean |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
stopEmulatorOutput
public void stopEmulatorOutput ()
stopLogcat
public void stopLogcat ()
stopUser
public boolean stopUser (int userId)
Parámetros | |
---|---|
userId |
int |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
stopUser
public boolean stopUser (int userId, boolean waitFlag, boolean forceFlag)
Parámetros | |
---|---|
userId |
int |
waitFlag |
boolean |
forceFlag |
boolean |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
switchToAdbTcp
public String switchToAdbTcp ()
Muestra | |
---|---|
String |
Arroja | |
---|---|
DeviceNotAvailableException |
switchToAdbUsb
public boolean switchToAdbUsb ()
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
switchUser
public boolean switchUser (int userId)
Parámetros | |
---|---|
userId |
int |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
switchUser
public boolean switchUser (int userId, long timeout)
Parámetros | |
---|---|
userId |
int |
timeout |
long |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
syncFiles
public boolean syncFiles (File localFileDir, String deviceFilePath)
Parámetros | |
---|---|
localFileDir |
File |
deviceFilePath |
String |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
takeBugreport
public Bugreport takeBugreport ()
Muestra | |
---|---|
Bugreport |
unencryptDevice
public boolean unencryptDevice ()
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
uninstallPackage
public String uninstallPackage (String packageName)
Parámetros | |
---|---|
packageName |
String |
Muestra | |
---|---|
String |
Arroja | |
---|---|
DeviceNotAvailableException |
uninstallPackageForUser
public String uninstallPackageForUser (String packageName, int userId)
Parámetros | |
---|---|
packageName |
String |
userId |
int |
Muestra | |
---|---|
String |
Arroja | |
---|---|
DeviceNotAvailableException |
unlockDevice
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 |
waitForDeviceOnline
public void waitForDeviceOnline ()
Arroja | |
---|---|
DeviceNotAvailableException |
waitForDeviceOnline
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 |
createRebootDeviceAction
protected NativeDevice.RebootDeviceAction createRebootDeviceAction (NativeDevice.RebootMode rebootMode, String reason)
Crea un RebootDeviceAction
para usarlo cuando realices 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.
|
doAdbReboot
protected void doAdbReboot (NativeDevice.RebootMode rebootMode, String reason)
Realiza un reinicio de adb.
Parámetros | |
---|---|
rebootMode |
NativeDevice.RebootMode : Es un modo de este reinicio. |
reason |
String : Para este reinicio. |
Arroja | |
---|---|
DeviceNotAvailableException |
ensureRuntimePermissionSupported
protected void ensureRuntimePermissionSupported ()
método de ayuda para generar una excepción si no se admite el permiso de tiempo de ejecución
Arroja | |
---|---|
DeviceNotAvailableException |
getBugreportInternal
protected InputStreamSource getBugreportInternal ()
Muestra | |
---|---|
InputStreamSource |
getBugreportzInternal
protected File getBugreportzInternal ()
Método de ayuda interno para obtener el archivo ZIP de 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 del dispositivo, de la caché de ddmlib de forma predeterminada, y recurre 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 que muestra "adb shell getprop". |
fastbootVar |
String : Es el nombre de la variable de fastboot equivalente que se consultará. Si es null , no se intentará 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 |
isNewer
protected boolean isNewer (File localFile, IFileEntry entry)
Muestra true
si el archivo local es más reciente que el archivo remoto. IFileEntry
es precisa hasta el minuto, en caso de que los tiempos sean iguales, el archivo se considerará más reciente.
Parámetros | |
---|---|
localFile |
File |
entry |
IFileEntry |
Muestra | |
---|---|
boolean |
performDeviceAction
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, de manera opcional, vuelve a intentar el comando si falla la acción.
Parámetros | |
---|---|
actionDescription |
String : Es una descripción breve de la acción que se realizará. Solo se usa con fines de registro. |
action |
com.android.tradefed.device.NativeDevice.DeviceAction : La acción que se realizará |
retryAttempts |
int : El reintento intenta realizar la acción si falla, pero la recuperación se realiza correctamente. |
Muestra | |
---|---|
boolean |
true si la acción se realizó correctamente |
Arroja | |
---|---|
DeviceNotAvailableException |
si el intento de recuperación falla o los intentos máximos se realizan sin éxito |
postAdbReboot
protected void postAdbReboot ()
Son posibles acciones adicionales que se pueden realizar después de un reinicio.
Arroja | |
---|---|
DeviceNotAvailableException |
prePostBootSetup
protected void prePostBootSetup ()
Permite que cada tipo de dispositivo (AndroidNativeDevice, TestDevice) anule este método para una configuración específica después del inicio.
Arroja | |
---|---|
DeviceNotAvailableException |
setClock
protected void setClock (Clock clock)
Establece 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 : Es el retraso en ms.
|
waitForDeviceNotAvailable
protected void waitForDeviceNotAvailable (String operationDesc, long time)
Parámetros | |
---|---|
operationDesc |
String |
time |
long |