Classi nidificate |
---|
class | NativeDevice.AdbAction Un DeviceAction per eseguire un comando 'adb ....' del sistema operativo. |
class | NativeDevice.AdbShellAction |
class | NativeDevice.RebootDeviceAction DeviceAction per riavviare un dispositivo. |
enum | NativeDevice.RebootMode Una modalità di riavvio. |
Metodi pubblici |
---|
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 () Il log che contiene tutti i log di executeShellCommand(String) . |
long | getExternalStoreFreeSpace () |
String | getFastbootPath () |
String | getFastbootProductType () |
String | getFastbootProductVariant () |
String | getFastbootSerialNumber () |
String | getFastbootVariable (String variableName) |
String | getFastbootVersion () |
IFileEntry | getFileEntry (String path) |
IFileEntry | getFileEntry (FileListingService.FileEntry entry) Helper non ufficiale per ottenere un FileEntry da un percorso non root. |
| getFoldableStates () |
IDevice | getIDevice () |
| getInstalledPackageNames () |
long | getIntProperty (String name, long defaultValue) |
String | getIpAddress () |
KeyguardControllerState | getKeyguardState () |
long | getLastExpectedRebootTimeMillis () |
int | getLaunchApiLevel () |
InputStreamSource | getLogcat () |
InputStreamSource | getLogcat (int maxBytes) |
InputStreamSource | getLogcatDump () |
InputStreamSource | getLogcatSince (long date) |
String | getMacAddress () |
| getMainlineModuleInfo () |
int | getMaxNumberOfRunningUsersSupported () |
int | getMaxNumberOfUsersSupported () |
IDeviceStateMonitor | getMonitor () |
String | getMountPoint (String mountName) |
ITestDevice.MountPointInfo | getMountPointInfo (String mountpoint) |
| getMountPointInfo () |
TestDeviceOptions | getOptions () |
long | getPartitionFreeSpace (String partition) |
Integer | getPrimaryUserId () |
ProcessInfo | getProcessByName (String processName) |
String | getProcessPid (String process) |
String | getProductType () |
String | getProductVariant () |
String | getProperty (String name) |
ITestDevice.RecoveryMode | getRecoveryMode () |
InputStreamSource | getScreenshot (String format) |
InputStreamSource | getScreenshot (long displayId) |
InputStreamSource | getScreenshot (String format, boolean rescale) |
InputStreamSource | getScreenshot () |
String | getSerialNumber () |
String | getSetting (int userId, String namespace, String key) |
String | getSetting (String namespace, String key) |
String | getSimOperator () |
String | getSimState () |
| getTombstones () |
long | getTotalMemory () |
| getUninstallablePackageNames () |
boolean | getUseFastbootErase () |
int | getUserFlags (int userId) |
| getUserInfos () |
int | getUserSerialNumber (int userId) |
IManagedTestDevice.DeviceEventResponse | handleAllocationEvent (DeviceEvent event) Elabora il DeviceEvent, che può o meno trasferire questo dispositivo a un nuovo stato di allocazione. |
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 () Eseguire l'override se il dispositivo necessita di alcune azioni specifiche da intraprendere dopo adb root e prima che il dispositivo sia di nuovo online. |
void | postAdbUnrootAction () Eseguire l'override se il dispositivo necessita di alcune azioni specifiche da intraprendere dopo adb unroot e prima che il dispositivo sia di nuovo online. |
void | postBootSetup () |
void | postInvocationTearDown (Throwable exception) |
void | preInvocationSetup (IBuildInfo info, MultiMap<String, String> attributes) |
boolean | pullDir (String deviceFilePath, File localDir) |
boolean | pullFile (String remoteFilePath, File localFile) |
File | pullFile (String remoteFilePath) |
String | pullFileContents (String remoteFilePath) |
File | pullFileFromExternal (String remoteFilePath) |
boolean | pushDir (File localFileDir, String deviceFilePath, excludedDirectories) pushDir (File localFileDir, String deviceFilePath, excludedDirectories) |
boolean | pushDir (File localFileDir, String deviceFilePath) |
boolean | pushFile (File localFile, String remoteFilePath) |
boolean | pushString (String contents, String remoteFilePath) |
void | reboot (String reason) |
void | reboot () |
void | rebootIntoBootloader () |
void | rebootIntoFastbootd () |
void | rebootIntoRecovery () |
void | rebootIntoSideload () |
void | rebootIntoSideload (boolean autoReboot) |
void | rebootUntilOnline () |
void | rebootUntilOnline (String reason) |
void | rebootUserspace () |
void | rebootUserspaceUntilOnline () |
void | recoverDevice () Tenta di ripristinare la comunicazione del dispositivo. |
void | remountSystemWritable () |
void | remountVendorWritable () |
boolean | removeAdmin (String componentName, int userId) |
void | removeOwners () |
boolean | removeUser (int userId) |
void | resetContentProviderSetup () Reimposta il flag per la configurazione del provider di contenuti per attivarlo di nuovo. |
boolean | runInstrumentationTests (IRemoteAndroidTestRunner runner, ITestLifeCycleReceiver... listeners) |
boolean | runInstrumentationTests (IRemoteAndroidTestRunner runner, listeners) runInstrumentationTests (IRemoteAndroidTestRunner runner, listeners) |
boolean | runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, ITestLifeCycleReceiver... listeners) |
boolean | runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, listeners) runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, listeners) |
void | setConfiguration ( IConfiguration configuration) Inserisce la IConfiguration in uso. |
void | setDate (Date date) |
boolean | setDeviceOwner (String componentName, int userId) |
void | setDeviceState (TestDeviceState deviceState) |
void | setEmulatorOutputStream ( SizeLimitedOutputStream output) Per l'emulatore, impostare SizeLimitedOutputStream per registrare l'output |
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) |
Metodi protetti |
---|
void | checkApiLevelAgainst (String feature, int strictMinLevel) |
NativeDevice.RebootDeviceAction | createRebootDeviceAction ( NativeDevice.RebootMode rebootMode, String reason) Creare un RebootDeviceAction da utilizzare durante l'esecuzione di un'azione di riavvio. |
void | doAdbReboot ( NativeDevice.RebootMode rebootMode, String reason) Esegui un riavvio adb. |
void | ensureRuntimePermissionSupported () metodo helper per generare un'eccezione se l'autorizzazione di runtime non è supportata |
InputStreamSource | getBugreportInternal () |
File | getBugreportzInternal () Metodo di supporto interno per ottenere il file zip bugreportz come ERROR(/File) . |
IRunUtil | getRunUtil () Ottieni l'istanza RunUtil da utilizzare. |
String | internalGetProperty (String propName, String fastbootVar, String description) Recupera una proprietà del dispositivo, dalla cache ddmlib per impostazione predefinita, e torna a `adb shell getprop` o `fastboot getvar` a seconda che il dispositivo sia in Fastboot o meno. |
boolean | isNewer (File localFile, IFileEntry entry) Restituisce true se il file locale è più recente del file remoto. |
boolean | performDeviceAction (String actionDescription, com.android.tradefed.device.NativeDevice.DeviceAction action, int retryAttempts) Esegue un'azione su questo dispositivo. |
void | postAdbReboot () Possibili azioni extra che possono essere intraprese dopo un riavvio. |
void | prePostBootSetup () Consente a ogni tipo di dispositivo (AndroidNativeDevice, TestDevice) di sovrascrivere questo metodo per una specifica configurazione post-avvio. |
void | setClock (Clock clock) Imposta l'istanza Clock da usare. |
void | setLogStartDelay (int delay) Imposta il tempo in ms di attesa prima di avviare l'acquisizione logcat per un dispositivo online. |
void | waitForDeviceNotAvailable (String operationDesc, long time) |
Costanti
INVALID_USER_ID
public static final int INVALID_USER_ID
Valore restituito per qualsiasi ID utente non valido/non trovato: UserHandle ha definito il valore -10000
Valore costante: -10000 (0xffffd8f0)
MAX_HOST_DEVICE_TIME_OFFSET
protected static final long MAX_HOST_DEVICE_TIME_OFFSET
Valore costante: 5000 (0x00000000000001388)
MAX_RETRY_ATTEMPTS
protected static final int MAX_RETRY_ATTEMPTS
il numero predefinito di tentativi di esecuzione dei comandi
Valore costante: 2 (0x00000002)
Campi
SCHEDA SD
protected static final String SD_CARD
STORAGE_EMULATED
protected static final String STORAGE_EMULATED
mOpzioni
protected TestDeviceOptions mOptions
mStateMonitor
protected final IDeviceStateMonitor mStateMonitor
Costruttori pubblici
Dispositivo nativo
public NativeDevice (IDevice device,
IDeviceStateMonitor stateMonitor,
IDeviceMonitor allocationMonitor)
Crea un dispositivo di TestDevice
.
Parametri |
---|
device | IDevice : l' IDevice associato |
stateMonitor | IDeviceStateMonitor : il meccanismo IDeviceStateMonitor da utilizzare |
allocationMonitor | IDeviceMonitor : IDeviceMonitor per informare delle modifiche allo stato di allocazione. Può essere nullo |
Metodi pubblici
checkApiLevelAgainstNextRelease
public boolean checkApiLevelAgainstNextRelease (int strictMinLevel)
Parametri |
---|
strictMinLevel | int |
Tiri |
---|
DeviceNotAvailableException | |
checkConnettività
public boolean checkConnectivity ()
Tiri |
---|
DeviceNotAvailableException | |
clearErrorDialogs
public boolean clearErrorDialogs ()
Tiri |
---|
DeviceNotAvailableException | |
clearLastConnectedWifiNetwork
public void clearLastConnectedWifiNetwork ()
clearLogcat
public void clearLogcat ()
ConnectToWiFiNetwork
public boolean connectToWifiNetwork (String wifiSsid,
String wifiPsk)
Parametri |
---|
wifiSsid | String |
wifiPsk | String |
Tiri |
---|
DeviceNotAvailableException | |
ConnectToWiFiNetwork
public boolean connectToWifiNetwork (String wifiSsid,
String wifiPsk,
boolean scanSsid)
Parametri |
---|
wifiSsid | String |
wifiPsk | String |
scanSsid | boolean |
Tiri |
---|
DeviceNotAvailableException | |
ConnectToWifiNetworkIfNeeded
public boolean connectToWifiNetworkIfNeeded (String wifiSsid,
String wifiPsk,
boolean scanSsid)
Parametri |
---|
wifiSsid | String |
wifiPsk | String |
scanSsid | boolean |
Tiri |
---|
DeviceNotAvailableException | |
ConnectToWifiNetworkIfNeeded
public boolean connectToWifiNetworkIfNeeded (String wifiSsid,
String wifiPsk)
Parametri |
---|
wifiSsid | String |
wifiPsk | String |
Tiri |
---|
DeviceNotAvailableException | |
creare un utente
public int createUser (String name,
boolean guest,
boolean ephemeral)
Parametri |
---|
name | String |
guest | boolean |
ephemeral | boolean |
Tiri |
---|
DeviceNotAvailableException | |
creare un utente
public int createUser (String name)
Tiri |
---|
DeviceNotAvailableException | |
createUserNoThrow
public int createUserNoThrow (String name)
Tiri |
---|
DeviceNotAvailableException | |
cancella il file
public void deleteFile (String deviceFilePath)
Parametri |
---|
deviceFilePath | String |
Tiri |
---|
DeviceNotAvailableException | |
deviceSoftRestarted
public boolean deviceSoftRestarted (ProcessInfo prevSystemServerProcess)
Parametri |
---|
prevSystemServerProcess | ProcessInfo |
Tiri |
---|
DeviceNotAvailableException | |
deviceSoftRestartedSince
public boolean deviceSoftRestartedSince (long utcEpochTime,
TimeUnit timeUnit)
Parametri |
---|
utcEpochTime | long |
timeUnit | TimeUnit |
Tiri |
---|
DeviceNotAvailableException | |
disabilitareAdbRoot
public boolean disableAdbRoot ()
Tiri |
---|
DeviceNotAvailableException | |
disabilitare Keyguard
public void disableKeyguard ()
Tiri |
---|
DeviceNotAvailableException | |
disabilitare NetworkMonitor
public boolean disableNetworkMonitor ()
Tiri |
---|
DeviceNotAvailableException | |
disconnetti dal Wi-Fi
public boolean disconnectFromWifi ()
Tiri |
---|
DeviceNotAvailableException | |
faFileExist
public boolean doesFileExist (String deviceFilePath)
Parametri |
---|
deviceFilePath | String |
Tiri |
---|
DeviceNotAvailableException | |
dumpHeap
public File dumpHeap (String process,
String devicePath)
Parametri |
---|
process | String |
devicePath | String |
Tiri |
---|
DeviceNotAvailableException | |
enableAdbRoot
public boolean enableAdbRoot ()
Tiri |
---|
DeviceNotAvailableException | |
enableNetworkMonitor
public boolean enableNetworkMonitor ()
Tiri |
---|
DeviceNotAvailableException | |
crittografareDispositivo
public boolean encryptDevice (boolean inplace)
Parametri |
---|
inplace | boolean |
Tiri |
---|
DeviceNotAvailableException | |
esegui AdbCommand
public String executeAdbCommand (long timeout,
String... cmdArgs)
Parametri |
---|
timeout | long |
cmdArgs | String |
Tiri |
---|
DeviceNotAvailableException | |
esegui AdbCommand
public String executeAdbCommand (String... cmdArgs)
Tiri |
---|
DeviceNotAvailableException | |
esegui FastbootCommand
public CommandResult executeFastbootCommand (String... cmdArgs)
Tiri |
---|
DeviceNotAvailableException | |
esegui FastbootCommand
public CommandResult executeFastbootCommand (long timeout,
String... cmdArgs)
Parametri |
---|
timeout | long |
cmdArgs | String |
Tiri |
---|
DeviceNotAvailableException | |
executeLongFastbootCommand
public CommandResult executeLongFastbootCommand (String... cmdArgs)
Tiri |
---|
DeviceNotAvailableException | |
eseguiShellCommand
public String executeShellCommand (String command)
Tiri |
---|
DeviceNotAvailableException | |
eseguiShellCommand
public void executeShellCommand (String command,
IShellOutputReceiver receiver,
long maxTimeToOutputShellResponse,
TimeUnit timeUnit,
int retryAttempts)
Parametri |
---|
command | String |
receiver | IShellOutputReceiver |
maxTimeToOutputShellResponse | long |
timeUnit | TimeUnit |
retryAttempts | int |
Tiri |
---|
DeviceNotAvailableException | |
eseguiShellCommand
public void executeShellCommand (String command,
IShellOutputReceiver receiver,
long maxTimeoutForCommand,
long maxTimeToOutputShellResponse,
TimeUnit timeUnit,
int retryAttempts)
Parametri |
---|
command | String |
receiver | IShellOutputReceiver |
maxTimeoutForCommand | long |
maxTimeToOutputShellResponse | long |
timeUnit | TimeUnit |
retryAttempts | int |
Tiri |
---|
DeviceNotAvailableException | |
eseguiShellCommand
public void executeShellCommand (String command,
IShellOutputReceiver receiver)
Parametri |
---|
command | String |
receiver | IShellOutputReceiver |
Tiri |
---|
DeviceNotAvailableException | |
eseguiShellV2Command
public CommandResult executeShellV2Command (String cmd)
Tiri |
---|
DeviceNotAvailableException | |
eseguiShellV2Command
public CommandResult executeShellV2Command (String cmd,
OutputStream pipeToOutput)
Parametri |
---|
cmd | String |
pipeToOutput | OutputStream |
Tiri |
---|
DeviceNotAvailableException | |
eseguiShellV2Command
public CommandResult executeShellV2Command (String cmd,
File pipeAsInput)
Parametri |
---|
cmd | String |
pipeAsInput | File |
Tiri |
---|
DeviceNotAvailableException | |
eseguiShellV2Command
public CommandResult executeShellV2Command (String cmd,
long maxTimeoutForCommand,
TimeUnit timeUnit,
int retryAttempts)
Parametri |
---|
cmd | String |
maxTimeoutForCommand | long |
timeUnit | TimeUnit |
retryAttempts | int |
Tiri |
---|
DeviceNotAvailableException | |
eseguiShellV2Command
public CommandResult executeShellV2Command (String cmd,
long maxTimeoutForCommand,
TimeUnit timeUnit)
Parametri |
---|
cmd | String |
maxTimeoutForCommand | long |
timeUnit | TimeUnit |
Tiri |
---|
DeviceNotAvailableException | |
eseguiShellV2Command
public CommandResult executeShellV2Command (String cmd,
File pipeAsInput,
OutputStream pipeToOutput,
long maxTimeoutForCommand,
TimeUnit timeUnit,
int retryAttempts)
Parametri |
---|
cmd | String |
pipeAsInput | File |
pipeToOutput | OutputStream |
maxTimeoutForCommand | long |
timeUnit | TimeUnit |
retryAttempts | int |
Tiri |
---|
DeviceNotAvailableException | |
eseguiShellV2Command
public CommandResult executeShellV2Command (String cmd,
File pipeAsInput,
OutputStream pipeToOutput,
OutputStream pipeToError,
long maxTimeoutForCommand,
TimeUnit timeUnit,
int retryAttempts)
Parametri |
---|
cmd | String |
pipeAsInput | File |
pipeToOutput | OutputStream |
pipeToError | OutputStream |
maxTimeoutForCommand | long |
timeUnit | TimeUnit |
retryAttempts | int |
Tiri |
---|
DeviceNotAvailableException | |
fastbootWipePartition
public CommandResult fastbootWipePartition (String partition)
Parametri |
---|
partition | String |
Tiri |
---|
DeviceNotAvailableException | |
getActiveApex
public getActiveApexes ()
Tiri |
---|
DeviceNotAvailableException | |
getAllSettings
public getAllSettings (String namespace)
Parametri |
---|
namespace | String |
Tiri |
---|
DeviceNotAvailableException | |
getAllocationState
public DeviceAllocationState getAllocationState ()
ritorna |
---|
DeviceAllocationState | |
getAndroidId
public String getAndroidId (int userId)
Tiri |
---|
DeviceNotAvailableException | |
getAndroidIds
public getAndroidIds ()
Tiri |
---|
DeviceNotAvailableException | |
getApiLevel
public int getApiLevel ()
Tiri |
---|
DeviceNotAvailableException | |
getAppPackageInfo
public PackageInfo getAppPackageInfo (String packageName)
Parametri |
---|
packageName | String |
Tiri |
---|
DeviceNotAvailableException | |
getAppPackageInfos
public getAppPackageInfos ()
Tiri |
---|
DeviceNotAvailableException | |
getBasebandVersion
public String getBasebandVersion ()
Tiri |
---|
DeviceNotAvailableException | |
prendi la batteria
public Integer getBattery ()
getBooleanProperty
public boolean getBooleanProperty (String name,
boolean defaultValue)
Parametri |
---|
name | String |
defaultValue | boolean |
Tiri |
---|
DeviceNotAvailableException | |
getBootHistory
public getBootHistory ()
Tiri |
---|
DeviceNotAvailableException | |
getBootHistoryDa
public getBootHistorySince (long utcEpochTime,
TimeUnit timeUnit)
Parametri |
---|
utcEpochTime | long |
timeUnit | TimeUnit |
Tiri |
---|
DeviceNotAvailableException | |
getBootloaderVersion
public String getBootloaderVersion ()
Tiri |
---|
DeviceNotAvailableException | |
getBugreport
public InputStreamSource getBugreport ()
ritorna |
---|
InputStreamSource | |
getBugreportz
public InputStreamSource getBugreportz ()
ritorna |
---|
InputStreamSource | |
getBuildAlias
public String getBuildAlias ()
Tiri |
---|
DeviceNotAvailableException | |
getBuildFlavor
public String getBuildFlavor ()
Tiri |
---|
DeviceNotAvailableException | |
getBuildId
public String getBuildId ()
Tiri |
---|
DeviceNotAvailableException | |
getBuildSigningKeys
public String getBuildSigningKeys ()
Tiri |
---|
DeviceNotAvailableException | |
getCachedDeviceDescriptor
public DeviceDescriptor getCachedDeviceDescriptor ()
ottenereChildren
public String[] getChildren (String path)
Tiri |
---|
DeviceNotAvailableException | |
getCurrentFoldableState
public DeviceFoldableState getCurrentFoldableState ()
ritorna |
---|
DeviceFoldableState | |
Tiri |
---|
DeviceNotAvailableException | |
getCurrentUser
public int getCurrentUser ()
Tiri |
---|
DeviceNotAvailableException | |
getDeviceClass
public String getDeviceClass ()
getDeviceDate
public long getDeviceDate ()
Tiri |
---|
DeviceNotAvailableException | |
getDeviceDescriptor
public DeviceDescriptor getDeviceDescriptor ()
getDeviceState
public TestDeviceState getDeviceState ()
getDeviceTimeOffset
public long getDeviceTimeOffset (Date date)
Tiri |
---|
DeviceNotAvailableException | |
getEmulatorOutput
public InputStreamSource getEmulatorOutput ()
ritorna |
---|
InputStreamSource | |
getEmulatorProcess
public Process getEmulatorProcess ()
getExecuteShellCommandLog
public final File getExecuteShellCommandLog ()
Il log che contiene tutti i log di executeShellCommand(String)
.
getExternalStoreFreeSpace
public long getExternalStoreFreeSpace ()
Tiri |
---|
DeviceNotAvailableException | |
getFastbootPath
public String getFastbootPath ()
getFastbootProductType
public String getFastbootProductType ()
Tiri |
---|
DeviceNotAvailableException | |
getFastbootProductVariant
public String getFastbootProductVariant ()
Tiri |
---|
DeviceNotAvailableException | |
getFastbootSerialNumber
public String getFastbootSerialNumber ()
getFastbootVariable
public String getFastbootVariable (String variableName)
Parametri |
---|
variableName | String |
Tiri |
---|
DeviceNotAvailableException | |
getFastbootVersion
public String getFastbootVersion ()
getFileEntry
public IFileEntry getFileEntry (String path)
Tiri |
---|
DeviceNotAvailableException | |
getFileEntry
public IFileEntry getFileEntry (FileListingService.FileEntry entry)
Helper non ufficiale per ottenere un FileEntry
da un percorso non root. FIXME: refactoring del sistema FileEntry per averlo disponibile da qualsiasi percorso. (anche non root).
Parametri |
---|
entry | FileListingService.FileEntry : un FileEntry non necessariamente root come richiede Ddmlib. |
Tiri |
---|
DeviceNotAvailableException | |
getFoldableStates
public getFoldableStates ()
Tiri |
---|
DeviceNotAvailableException | |
getIDevice
public IDevice getIDevice ()
getInstalledPackageNames
public getInstalledPackageNames ()
Tiri |
---|
DeviceNotAvailableException | |
getIntProperty
public long getIntProperty (String name,
long defaultValue)
Parametri |
---|
name | String |
defaultValue | long |
Tiri |
---|
DeviceNotAvailableException | |
getIndirizzoIp
public String getIpAddress ()
Tiri |
---|
DeviceNotAvailableException | |
getKeyguardState
public KeyguardControllerState getKeyguardState ()
ritorna |
---|
KeyguardControllerState | |
Tiri |
---|
DeviceNotAvailableException | |
getLastExpectedRebootTimeMillis
public long getLastExpectedRebootTimeMillis ()
getLaunchApiLevel
public int getLaunchApiLevel ()
Tiri |
---|
DeviceNotAvailableException | |
getLogcat
public InputStreamSource getLogcat ()
ritorna |
---|
InputStreamSource | |
getLogcat
public InputStreamSource getLogcat (int maxBytes)
ritorna |
---|
InputStreamSource | |
getLogcatDump
public InputStreamSource getLogcatDump ()
ritorna |
---|
InputStreamSource | |
getLogcatSince
public InputStreamSource getLogcatSince (long date)
ritorna |
---|
InputStreamSource | |
getMacAddress
public String getMacAddress ()
getMainlineModuleInfo
public getMainlineModuleInfo ()
Tiri |
---|
DeviceNotAvailableException | |
public int getMaxNumberOfRunningUsersSupported ()
Tiri |
---|
DeviceNotAvailableException | |
public int getMaxNumberOfUsersSupported ()
Tiri |
---|
DeviceNotAvailableException | |
getMonitor
public IDeviceStateMonitor getMonitor ()
ritorna |
---|
IDeviceStateMonitor | |
getMountPoint
public String getMountPoint (String mountName)
Parametri |
---|
mountName | String |
getMountPointInfo
public ITestDevice.MountPointInfo getMountPointInfo (String mountpoint)
Parametri |
---|
mountpoint | String |
ritorna |
---|
ITestDevice.MountPointInfo | |
Tiri |
---|
DeviceNotAvailableException | |
getMountPointInfo
public getMountPointInfo ()
Tiri |
---|
DeviceNotAvailableException | |
getOptions
public TestDeviceOptions getOptions ()
ritorna |
---|
TestDeviceOptions | |
getPartitionFreeSpace
public long getPartitionFreeSpace (String partition)
Parametri |
---|
partition | String |
Tiri |
---|
DeviceNotAvailableException | |
getPrimaryUserId
public Integer getPrimaryUserId ()
Tiri |
---|
DeviceNotAvailableException | |
getProcessByName
public ProcessInfo getProcessByName (String processName)
Parametri |
---|
processName | String |
Tiri |
---|
DeviceNotAvailableException | |
getProcessPid
public String getProcessPid (String process)
Tiri |
---|
DeviceNotAvailableException | |
getProductType
public String getProductType ()
Tiri |
---|
DeviceNotAvailableException | |
getProductVariant
public String getProductVariant ()
Tiri |
---|
DeviceNotAvailableException | |
getProperty
public String getProperty (String name)
Tiri |
---|
DeviceNotAvailableException | |
get RecoveryMode
public ITestDevice.RecoveryMode getRecoveryMode ()
ritorna |
---|
ITestDevice.RecoveryMode | |
getScreenshot
public InputStreamSource getScreenshot (String format)
ritorna |
---|
InputStreamSource | |
Tiri |
---|
DeviceNotAvailableException | |
getScreenshot
public InputStreamSource getScreenshot (long displayId)
ritorna |
---|
InputStreamSource | |
Tiri |
---|
DeviceNotAvailableException | |
getScreenshot
public InputStreamSource getScreenshot (String format,
boolean rescale)
Parametri |
---|
format | String |
rescale | boolean |
ritorna |
---|
InputStreamSource | |
Tiri |
---|
DeviceNotAvailableException | |
getScreenshot
public InputStreamSource getScreenshot ()
ritorna |
---|
InputStreamSource | |
Tiri |
---|
DeviceNotAvailableException | |
getSerialNumber
public String getSerialNumber ()
getSetting
public String getSetting (int userId,
String namespace,
String key)
Parametri |
---|
userId | int |
namespace | String |
key | String |
Tiri |
---|
DeviceNotAvailableException | |
getSetting
public String getSetting (String namespace,
String key)
Parametri |
---|
namespace | String |
key | String |
Tiri |
---|
DeviceNotAvailableException | |
getSimOperator
public String getSimOperator ()
getSimState
public String getSimState ()
getTombstones
public getTombstones ()
Tiri |
---|
DeviceNotAvailableException | |
getTotalMemory
public long getTotalMemory ()
getUninstallablePackageNames
public getUninstallablePackageNames ()
Tiri |
---|
DeviceNotAvailableException | |
getUseFastbootErase
public boolean getUseFastbootErase ()
getUserFlags
public int getUserFlags (int userId)
Tiri |
---|
DeviceNotAvailableException | |
getUserInfos
public getUserInfos ()
Tiri |
---|
DeviceNotAvailableException | |
getUserSerialNumber
public int getUserSerialNumber (int userId)
Tiri |
---|
DeviceNotAvailableException | |
handleAllocationEvent
public IManagedTestDevice.DeviceEventResponse handleAllocationEvent (DeviceEvent event)
Elabora il DeviceEvent, che può o meno trasferire questo dispositivo a un nuovo stato di allocazione.
Parametri |
---|
event | DeviceEvent |
ritorna |
---|
IManagedTestDevice.DeviceEventResponse | |
haCaratteristica
public boolean hasFeature (String feature)
Tiri |
---|
DeviceNotAvailableException | |
installPackage
public String installPackage (File packageFile,
boolean reinstall,
String... extraArgs)
Parametri |
---|
packageFile | File |
reinstall | boolean |
extraArgs | String |
Tiri |
---|
DeviceNotAvailableException | |
installPackage
public String installPackage (File packageFile,
boolean reinstall,
boolean grantPermissions,
String... extraArgs)
Parametri |
---|
packageFile | File |
reinstall | boolean |
grantPermissions | boolean |
extraArgs | String |
Tiri |
---|
DeviceNotAvailableException | |
installPackageForUser
public String installPackageForUser (File packageFile,
boolean reinstall,
int userId,
String... extraArgs)
Parametri |
---|
packageFile | File |
reinstall | boolean |
userId | int |
extraArgs | String |
Tiri |
---|
DeviceNotAvailableException | |
installPackageForUser
public String installPackageForUser (File packageFile,
boolean reinstall,
boolean grantPermissions,
int userId,
String... extraArgs)
Parametri |
---|
packageFile | File |
reinstall | boolean |
grantPermissions | boolean |
userId | int |
extraArgs | String |
Tiri |
---|
DeviceNotAvailableException | |
isAdbRoot
public boolean isAdbRoot ()
Tiri |
---|
DeviceNotAvailableException | |
isAdbTcp
public boolean isAdbTcp ()
isAppEnumerationSupported
public boolean isAppEnumerationSupported ()
Tiri |
---|
DeviceNotAvailableException | |
isDeviceEncrypted
public boolean isDeviceEncrypted ()
Tiri |
---|
DeviceNotAvailableException | |
isDirectory
public boolean isDirectory (String path)
Tiri |
---|
DeviceNotAvailableException | |
isEnableAdbRoot
public boolean isEnableAdbRoot ()
ritorna |
---|
boolean | true se adb root deve essere abilitato sul dispositivo |
isEncryptionSupported
public boolean isEncryptionSupported ()
Tiri |
---|
DeviceNotAvailableException | |
isExecutable
public boolean isExecutable (String fullPath)
Parametri |
---|
fullPath | String |
Tiri |
---|
DeviceNotAvailableException | |
isFastbootEnabled
public boolean isFastbootEnabled ()
è senza testa
public boolean isHeadless ()
Tiri |
---|
DeviceNotAvailableException | |
isMultiUserSupported
public boolean isMultiUserSupported ()
Tiri |
---|
DeviceNotAvailableException | |
isPackageInstalled
public boolean isPackageInstalled (String packageName,
String userId)
Parametri |
---|
packageName | String |
userId | String |
Tiri |
---|
DeviceNotAvailableException | |
isPackageInstalled
public boolean isPackageInstalled (String packageName)
Parametri |
---|
packageName | String |
Tiri |
---|
DeviceNotAvailableException | |
isRuntimePermissionSupported
public boolean isRuntimePermissionSupported ()
Tiri |
---|
DeviceNotAvailableException | |
isStateBootloaderOrFastbootd
public boolean isStateBootloaderOrFastbootd ()
isUserRunning
public boolean isUserRunning (int userId)
Tiri |
---|
DeviceNotAvailableException | |
isUserSecondary
public boolean isUserSecondary (int userId)
Tiri |
---|
DeviceNotAvailableException | |
isWifiEnabled
public boolean isWifiEnabled ()
Tiri |
---|
DeviceNotAvailableException | |
listDisplayIds
public listDisplayIds ()
Tiri |
---|
DeviceNotAvailableException | |
listUsers
public listUsers ()
Tiri |
---|
DeviceNotAvailableException | |
logBugreport
public boolean logBugreport (String dataName,
ITestLogger listener)
Parametri |
---|
dataName | String |
listener | ITestLogger |
logOnDevice
public void logOnDevice (String tag,
Log.LogLevel level,
String format,
Object... args)
Parametri |
---|
tag | String |
level | Log.LogLevel |
format | String |
args | Object |
nonBlockingReboot
public void nonBlockingReboot ()
Tiri |
---|
DeviceNotAvailableException | |
postAdbRootAction
public void postAdbRootAction ()
Eseguire l'override se il dispositivo necessita di alcune azioni specifiche da intraprendere dopo adb root e prima che il dispositivo sia di nuovo online. L'implementazione predefinita non include azioni aggiuntive. in questa fase non è garantito che adb root sia abilitato.
Tiri |
---|
DeviceNotAvailableException | |
postAdbUnrootAction
public void postAdbUnrootAction ()
Eseguire l'override se il dispositivo necessita di alcune azioni specifiche da intraprendere dopo adb unroot e prima che il dispositivo sia di nuovo online. L'implementazione predefinita non include azioni aggiuntive. adb root non è garantito per essere disabilitato in questa fase.
Tiri |
---|
DeviceNotAvailableException | |
postBootSetup
public void postBootSetup ()
Tiri |
---|
DeviceNotAvailableException | |
postInvocationTearDown
public void postInvocationTearDown (Throwable exception)
Parametri |
---|
exception | Throwable |
preInvocationSetup
public void preInvocationSetup (IBuildInfo info,
MultiMap<String, String> attributes)
Parametri |
---|
info | IBuildInfo |
attributes | MultiMap |
Tiri |
---|
DeviceNotAvailableException | |
TargetSetupError | |
pullDir
public boolean pullDir (String deviceFilePath,
File localDir)
Parametri |
---|
deviceFilePath | String |
localDir | File |
Tiri |
---|
DeviceNotAvailableException | |
pullFile
public boolean pullFile (String remoteFilePath,
File localFile)
Parametri |
---|
remoteFilePath | String |
localFile | File |
Tiri |
---|
DeviceNotAvailableException | |
pullFile
public File pullFile (String remoteFilePath)
Parametri |
---|
remoteFilePath | String |
Tiri |
---|
DeviceNotAvailableException | |
pullFileContents
public String pullFileContents (String remoteFilePath)
Parametri |
---|
remoteFilePath | String |
Tiri |
---|
DeviceNotAvailableException | |
pullFileFromExternal
public File pullFileFromExternal (String remoteFilePath)
Parametri |
---|
remoteFilePath | String |
Tiri |
---|
DeviceNotAvailableException | |
pushDir
public boolean pushDir (File localFileDir,
String deviceFilePath,
excludedDirectories)
Parametri |
---|
localFileDir | File |
deviceFilePath | String |
excludedDirectories | |
Tiri |
---|
DeviceNotAvailableException | |
pushDir
public boolean pushDir (File localFileDir,
String deviceFilePath)
Parametri |
---|
localFileDir | File |
deviceFilePath | String |
Tiri |
---|
DeviceNotAvailableException | |
pushFile
public boolean pushFile (File localFile,
String remoteFilePath)
Parametri |
---|
localFile | File |
remoteFilePath | String |
Tiri |
---|
DeviceNotAvailableException | |
pushString
public boolean pushString (String contents,
String remoteFilePath)
Parametri |
---|
contents | String |
remoteFilePath | String |
Tiri |
---|
DeviceNotAvailableException | |
riavviare
public void reboot (String reason)
Tiri |
---|
DeviceNotAvailableException | |
riavviare
public void reboot ()
Tiri |
---|
DeviceNotAvailableException | |
riavviareIntoBootloader
public void rebootIntoBootloader ()
Tiri |
---|
DeviceNotAvailableException | |
rebootIntoFastbootd
public void rebootIntoFastbootd ()
Tiri |
---|
DeviceNotAvailableException | |
riavviareIntoRecovery
public void rebootIntoRecovery ()
Tiri |
---|
DeviceNotAvailableException | |
riavviareIntoSideload
public void rebootIntoSideload ()
Tiri |
---|
DeviceNotAvailableException | |
riavviareIntoSideload
public void rebootIntoSideload (boolean autoReboot)
Parametri |
---|
autoReboot | boolean |
Tiri |
---|
DeviceNotAvailableException | |
riavvia fino a Online
public void rebootUntilOnline ()
Tiri |
---|
DeviceNotAvailableException | |
riavvia fino a Online
public void rebootUntilOnline (String reason)
Tiri |
---|
DeviceNotAvailableException | |
rebootUserspace
public void rebootUserspace ()
Tiri |
---|
DeviceNotAvailableException | |
rebootUserspaceUntilOnline
public void rebootUserspaceUntilOnline ()
Tiri |
---|
DeviceNotAvailableException | |
recoveryDevice
public void recoverDevice ()
Tenta di ripristinare la comunicazione del dispositivo.
Tiri |
---|
DeviceNotAvailableException | se il dispositivo non è più disponibile |
remountSystemWritable
public void remountSystemWritable ()
Tiri |
---|
DeviceNotAvailableException | |
remountVendorWritable
public void remountVendorWritable ()
Tiri |
---|
DeviceNotAvailableException | |
removeAdmin
public boolean removeAdmin (String componentName,
int userId)
Parametri |
---|
componentName | String |
userId | int |
Tiri |
---|
DeviceNotAvailableException | |
rimuovereProprietari
public void removeOwners ()
Tiri |
---|
DeviceNotAvailableException | |
removeUser
public boolean removeUser (int userId)
Tiri |
---|
DeviceNotAvailableException | |
resetContentProviderSetup
public void resetContentProviderSetup ()
Reimposta il flag per la configurazione del provider di contenuti per attivarlo di nuovo.
eseguire test di strumentazione
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner,
ITestLifeCycleReceiver... listeners)
Parametri |
---|
runner | IRemoteAndroidTestRunner |
listeners | ITestLifeCycleReceiver |
Tiri |
---|
DeviceNotAvailableException | |
eseguire test di strumentazione
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner,
listeners)
Parametri |
---|
runner | IRemoteAndroidTestRunner |
listeners | |
Tiri |
---|
DeviceNotAvailableException | |
runInstrumentationTestsAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner,
int userId,
ITestLifeCycleReceiver... listeners)
Parametri |
---|
runner | IRemoteAndroidTestRunner |
userId | int |
listeners | ITestLifeCycleReceiver |
Tiri |
---|
DeviceNotAvailableException | |
runInstrumentationTestsAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner,
int userId,
listeners)
Parametri |
---|
runner | IRemoteAndroidTestRunner |
userId | int |
listeners | |
Tiri |
---|
DeviceNotAvailableException | |
setConfigurazione
public void setConfiguration (IConfiguration configuration)
Inserisce la IConfiguration
in uso.
Parametri |
---|
configuration | IConfiguration |
impostare la data
public void setDate (Date date)
Tiri |
---|
DeviceNotAvailableException | |
setDeviceOwner
public boolean setDeviceOwner (String componentName,
int userId)
Parametri |
---|
componentName | String |
userId | int |
Tiri |
---|
DeviceNotAvailableException | |
setDeviceState
public void setDeviceState (TestDeviceState deviceState)
Parametri |
---|
deviceState | TestDeviceState |
setEmulatorOutputStream
public void setEmulatorOutputStream (SizeLimitedOutputStream output)
Per l'emulatore, impostare SizeLimitedOutputStream
per registrare l'output
Parametri |
---|
output | SizeLimitedOutputStream : per registrare l'output |
setEmulatorProcess
public void setEmulatorProcess (Process p)
setFastbootEnabled
public void setFastbootEnabled (boolean fastbootEnabled)
Parametri |
---|
fastbootEnabled | boolean |
setFastbootPath
public void setFastbootPath (String fastbootPath)
Parametri |
---|
fastbootPath | String |
setIDDevice
public void setIDevice (IDevice newDevice)
Parametri |
---|
newDevice | IDevice |
setOptions
public void setOptions (TestDeviceOptions options)
Parametri |
---|
options | TestDeviceOptions |
setProperty
public boolean setProperty (String propKey,
String propValue)
Parametri |
---|
propKey | String |
propValue | String |
Tiri |
---|
DeviceNotAvailableException | |
setRecupero
public void setRecovery (IDeviceRecovery recovery)
Parametri |
---|
recovery | IDeviceRecovery |
imposta la modalità di ripristino
public void setRecoveryMode (ITestDevice.RecoveryMode mode)
Parametri |
---|
mode | ITestDevice.RecoveryMode |
setSetting
public void setSetting (String namespace,
String key,
String value)
Parametri |
---|
namespace | String |
key | String |
value | String |
Tiri |
---|
DeviceNotAvailableException | |
setSetting
public void setSetting (int userId,
String namespace,
String key,
String value)
Parametri |
---|
userId | int |
namespace | String |
key | String |
value | String |
Tiri |
---|
DeviceNotAvailableException | |
setUseFastbootErase
public void setUseFastbootErase (boolean useFastbootErase)
Parametri |
---|
useFastbootErase | boolean |
startLogcat
public void startLogcat ()
startUser
public boolean startUser (int userId)
Tiri |
---|
DeviceNotAvailableException | |
startUser
public boolean startUser (int userId,
boolean waitFlag)
Parametri |
---|
userId | int |
waitFlag | boolean |
Tiri |
---|
DeviceNotAvailableException | |
stopEmulatorOutput
public void stopEmulatorOutput ()
stopLogcat
public void stopLogcat ()
stopUser
public boolean stopUser (int userId)
Tiri |
---|
DeviceNotAvailableException | |
stopUser
public boolean stopUser (int userId,
boolean waitFlag,
boolean forceFlag)
Parametri |
---|
userId | int |
waitFlag | boolean |
forceFlag | boolean |
Tiri |
---|
DeviceNotAvailableException | |
switchToAdbTcp
public String switchToAdbTcp ()
Tiri |
---|
DeviceNotAvailableException | |
switchToAdbUsb
public boolean switchToAdbUsb ()
Tiri |
---|
DeviceNotAvailableException | |
cambia utente
public boolean switchUser (int userId)
Tiri |
---|
DeviceNotAvailableException | |
cambia utente
public boolean switchUser (int userId,
long timeout)
Parametri |
---|
userId | int |
timeout | long |
Tiri |
---|
DeviceNotAvailableException | |
syncFiles
public boolean syncFiles (File localFileDir,
String deviceFilePath)
Parametri |
---|
localFileDir | File |
deviceFilePath | String |
Tiri |
---|
DeviceNotAvailableException | |
prendi Bugreport
public Bugreport takeBugreport ()
unencryptDevice
public boolean unencryptDevice ()
Tiri |
---|
DeviceNotAvailableException | |
uninstallPackage
public String uninstallPackage (String packageName)
Parametri |
---|
packageName | String |
Tiri |
---|
DeviceNotAvailableException | |
uninstallPackageForUser
public String uninstallPackageForUser (String packageName,
int userId)
Parametri |
---|
packageName | String |
userId | int |
Tiri |
---|
DeviceNotAvailableException | |
sbloccareDispositivo
public boolean unlockDevice ()
Tiri |
---|
DeviceNotAvailableException | |
waitForBootComplete
public boolean waitForBootComplete (long timeOut)
Tiri |
---|
DeviceNotAvailableException | |
waitForDeviceDisponibile
public void waitForDeviceAvailable ()
Tiri |
---|
DeviceNotAvailableException | |
waitForDeviceDisponibile
public void waitForDeviceAvailable (long waitTime)
Tiri |
---|
DeviceNotAvailableException | |
waitForDeviceInRecovery
public boolean waitForDeviceInRecovery (long waitTime)
waitForDeviceInSideload
public boolean waitForDeviceInSideload (long waitTime)
waitForDeviceNotAvailable
public boolean waitForDeviceNotAvailable (long waitTime)
waitForDeviceOnline
public void waitForDeviceOnline ()
Tiri |
---|
DeviceNotAvailableException | |
waitForDeviceOnline
public void waitForDeviceOnline (long waitTime)
Tiri |
---|
DeviceNotAvailableException | |
waitForDeviceShell
public boolean waitForDeviceShell (long waitTime)
Metodi protetti
checkApiLevelContro
protected void checkApiLevelAgainst (String feature,
int strictMinLevel)
Parametri |
---|
feature | String |
strictMinLevel | int |
doAdbReboot
protected void doAdbReboot (NativeDevice.RebootMode rebootMode,
String reason)
Esegui un riavvio adb.
Parametri |
---|
rebootMode | NativeDevice.RebootMode : una modalità di questo riavvio. |
reason | String : per questo riavvio. |
Tiri |
---|
DeviceNotAvailableException | |
garantireRuntimePermissionSupported
protected void ensureRuntimePermissionSupported ()
metodo helper per generare un'eccezione se l'autorizzazione di runtime non è supportata
Tiri |
---|
DeviceNotAvailableException | |
getBugreportInternal
protected InputStreamSource getBugreportInternal ()
ritorna |
---|
InputStreamSource | |
getBugreportzInternal
protected File getBugreportzInternal ()
Metodo di supporto interno per ottenere il file zip bugreportz come ERROR(/File)
.
getRunUtil
protected IRunUtil getRunUtil ()
Ottieni l'istanza RunUtil
da utilizzare.
internalGetProperty
protected String internalGetProperty (String propName,
String fastbootVar,
String description)
Recupera una proprietà del dispositivo, dalla cache ddmlib per impostazione predefinita, e torna a `adb shell getprop` o `fastboot getvar` a seconda che il dispositivo sia in Fastboot o meno.
Parametri |
---|
propName | String : il nome della proprietà del dispositivo restituito da `adb shell getprop` |
fastbootVar | String : il nome della variabile di avvio rapido equivalente da interrogare. se null , la query di avvio rapido non verrà tentata |
description | String : una semplice descrizione della variabile. La prima lettera deve essere maiuscola. |
ritorna |
---|
String | Una stringa, possibilmente null o vuota, contenente il valore della proprietà data |
Tiri |
---|
DeviceNotAvailableException | |
è più recente
protected boolean isNewer (File localFile,
IFileEntry entry)
Restituisce true
se il file locale è più recente del file remoto. IFileEntry
preciso al minuto, in caso di tempi uguali, il file sarà considerato più nuovo.
Parametri |
---|
localFile | File |
entry | IFileEntry |
protected boolean performDeviceAction (String actionDescription,
com.android.tradefed.device.NativeDevice.DeviceAction action,
int retryAttempts)
Esegue un'azione su questo dispositivo. Tenta di ripristinare il dispositivo e, facoltativamente, riprovare il comando se l'azione non riesce.
Parametri |
---|
actionDescription | String : una breve descrizione dell'azione da eseguire. Utilizzato solo per scopi di registrazione. |
action | com.android.tradefed.device.NativeDevice.DeviceAction : l'azione da eseguire |
retryAttempts | int : il nuovo tentativo tenta di eseguire un'azione se fallisce ma il ripristino ha esito positivo |
ritorna |
---|
boolean | true se l'azione è stata eseguita correttamente |
Tiri |
---|
DeviceNotAvailableException | se il tentativo di ripristino fallisce o il numero massimo di tentativi eseguiti senza successo |
postAdbReboot
protected void postAdbReboot ()
Possibili azioni extra che possono essere intraprese dopo un riavvio.
Tiri |
---|
DeviceNotAvailableException | |
prePostBootSetup
protected void prePostBootSetup ()
Consente a ogni tipo di dispositivo (AndroidNativeDevice, TestDevice) di sovrascrivere questo metodo per una specifica configurazione post-avvio.
Tiri |
---|
DeviceNotAvailableException | |
imposta l'orologio
protected void setClock (Clock clock)
Imposta l'istanza Clock da usare.
setLogStartDelay
protected void setLogStartDelay (int delay)
Imposta il tempo in ms di attesa prima di avviare l'acquisizione logcat per un dispositivo online.
Parametri |
---|
delay | int : il ritardo in ms |
waitForDeviceNotAvailable
protected void waitForDeviceNotAvailable (String operationDesc,
long time)
Parametri |
---|
operationDesc | String |
time | long |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2022-07-06 UTC.
[]
[]