Appareil natif
public
class
NativeDevice
extends Object
implements
IManagedTestDevice,
IConfigurationReceiver
java.lang.Object | |
↳ | com.android.tradefed.device.NativeDevice |
Implémentation par défaut d'un appareil Android ITestDevice
non full stack.
Résumé
Classes imbriquées | |
---|---|
class |
NativeDevice.AdbAction
|
class |
NativeDevice.AdbShellAction
|
class |
NativeDevice.RebootDeviceAction
|
enum |
NativeDevice.RebootMode
Mode de redémarrage. |
Constantes | |
---|---|
int |
INVALID_USER_ID
Valeur renvoyée pour tout ID utilisateur non valide/introuvable: UserHandle a défini la valeur -10000. |
long |
MAX_HOST_DEVICE_TIME_OFFSET
|
int |
MAX_RETRY_ATTEMPTS
le nombre de tentatives d'exécution de la commande par défaut |
Champs | |
---|---|
protected
static
final
String |
SD_CARD
|
protected
static
final
String |
STORAGE_EMULATED
|
protected
TestDeviceOptions |
mOptions
|
protected
final
IDeviceStateMonitor |
mStateMonitor
|
Constructeurs publics | |
---|---|
NativeDevice(IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)
Crée un |
Méthodes publiques | |
---|---|
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()
Journal contenant tous les journaux |
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)
Outil d'aide non officiel pour obtenir 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)
Traiter DeviceEvent, qui peut ou non faire passer cet appareil à une nouvelle allocation de l'état. |
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()
À remplacer si l'appareil nécessite des actions spécifiques après la racine adb et avant la l'appareil est à nouveau connecté. |
void
|
postAdbUnrootAction()
À remplacer si l'appareil nécessite des actions spécifiques après le retrait d'adb et avant l'appareil est à nouveau connecté. |
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()
Tentatives de récupération de la communication de l'appareil. |
void
|
remountSystemWritable()
|
void
|
remountVendorWritable()
|
boolean
|
removeAdmin(String componentName, int userId)
|
void
|
removeOwners()
|
boolean
|
removeUser(int userId)
|
void
|
resetContentProviderSetup()
Réinitialisez l'indicateur de configuration du fournisseur de contenu afin de le déclencher de nouveau. |
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)
Il injecte les |
void
|
setDate(Date date)
|
boolean
|
setDeviceOwner(String componentName, int userId)
|
void
|
setDeviceState(TestDeviceState deviceState)
|
void
|
setEmulatorOutputStream(SizeLimitedOutputStream output)
Pour l'émulateur, définissez |
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éthodes protégées | |
---|---|
void
|
checkApiLevelAgainst(String feature, int strictMinLevel)
|
NativeDevice.RebootDeviceAction
|
createRebootDeviceAction(NativeDevice.RebootMode rebootMode, String reason)
Créez un |
void
|
doAdbReboot(NativeDevice.RebootMode rebootMode, String reason)
Effectuez un redémarrage adb. |
void
|
ensureRuntimePermissionSupported()
Méthode d'assistance permettant de générer une exception si l'autorisation d'exécution n'est pas prise en charge |
InputStreamSource
|
getBugreportInternal()
|
File
|
getBugreportzInternal()
Méthode d'assistance interne permettant d'obtenir le fichier ZIP bugreportz en tant que |
IRunUtil
|
getRunUtil()
Obtenez l'instance |
String
|
internalGetProperty(String propName, String fastbootVar, String description)
Récupère une propriété d'appareil, à partir du cache ddmlib par défaut, et en revenant à adb shell getprop" ou "fastboot getvar", selon que l'appareil est en Fastboot ou non. |
boolean
|
isNewer(File localFile, IFileEntry entry)
Renvoie |
boolean
|
performDeviceAction(String actionDescription, com.android.tradefed.device.NativeDevice.DeviceAction action, int retryAttempts)
Effectue une action sur cet appareil. |
void
|
postAdbReboot()
Actions supplémentaires possibles après un redémarrage. |
void
|
prePostBootSetup()
Permet à chaque type d'appareil (AndroidNativeDevice, TestDevice) de remplacer cette méthode pour configuration post-amorçage spécifique. |
void
|
setClock(Clock clock)
Définissez l'instance Clock à utiliser. |
void
|
setLogStartDelay(int delay)
Définit le délai d'attente, en millisecondes, avant de lancer la capture logcat pour un appareil en ligne. |
void
|
waitForDeviceNotAvailable(String operationDesc, long time)
|
Constantes
ID_UTILISATEUR_NON_VALIDE
public static final int INVALID_USER_ID
Valeur renvoyée pour tout ID utilisateur non valide/introuvable: UserHandle a défini la valeur -10000.
Valeur constante: -10000 (0xffffd8f0)
MAX_HOST_DEVICE_TIME_OFFSET
protected static final long MAX_HOST_DEVICE_TIME_OFFSET
Valeur constante: 5000 (0x0000000000001388)
MAX_RETRY_ATTEMPTS
protected static final int MAX_RETRY_ATTEMPTS
le nombre de tentatives d'exécution de la commande par défaut
Valeur constante: 2. (0x00000002)
Champs
CARTE_SD
protected static final String SD_CARD
STOCKAGE_ÉMULÉ
protected static final String STORAGE_EMULATED
Options mobiles
protected TestDeviceOptions mOptions
mStateMonitor
protected final IDeviceStateMonitor mStateMonitor
Constructeurs publics
Appareil natif
public NativeDevice (IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)
Crée un TestDevice
.
Paramètres | |
---|---|
device |
IDevice : le IDevice associé |
stateMonitor |
IDeviceStateMonitor : mécanisme IDeviceStateMonitor à utiliser |
allocationMonitor |
IDeviceMonitor : IDeviceMonitor pour informer les changements d'état d'allocation.
Peut être nul
|
Méthodes publiques
checkApiLevelAgainstNextRelease
public boolean checkApiLevelAgainstNextRelease (int strictMinLevel)
Paramètres | |
---|---|
strictMinLevel |
int |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
vérifier la connectivité
public boolean checkConnectivity ()
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
ClearErrorDialogs
public boolean clearErrorDialogs ()
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
ClearLastConnectedWifiNetwork
public void clearLastConnectedWifiNetwork ()
ClearLogcat
public void clearLogcat ()
se connecter au réseauWi-Fi
public boolean connectToWifiNetwork (String wifiSsid, String wifiPsk)
Paramètres | |
---|---|
wifiSsid |
String |
wifiPsk |
String |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
se connecter au réseauWi-Fi
public boolean connectToWifiNetwork (String wifiSsid, String wifiPsk, boolean scanSsid)
Paramètres | |
---|---|
wifiSsid |
String |
wifiPsk |
String |
scanSsid |
boolean |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
ConnectToWifiNetworkIfNeeded
public boolean connectToWifiNetworkIfNeeded (String wifiSsid, String wifiPsk, boolean scanSsid)
Paramètres | |
---|---|
wifiSsid |
String |
wifiPsk |
String |
scanSsid |
boolean |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
ConnectToWifiNetworkIfNeeded
public boolean connectToWifiNetworkIfNeeded (String wifiSsid, String wifiPsk)
Paramètres | |
---|---|
wifiSsid |
String |
wifiPsk |
String |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
créerutilisateur
public int createUser (String name, boolean guest, boolean ephemeral)
Paramètres | |
---|---|
name |
String |
guest |
boolean |
ephemeral |
boolean |
Renvoie | |
---|---|
int |
Génère | |
---|---|
DeviceNotAvailableException |
créerutilisateur
public int createUser (String name)
Paramètres | |
---|---|
name |
String |
Renvoie | |
---|---|
int |
Génère | |
---|---|
DeviceNotAvailableException |
créerUtilisateurPasDeJeter
public int createUserNoThrow (String name)
Paramètres | |
---|---|
name |
String |
Renvoie | |
---|---|
int |
Génère | |
---|---|
DeviceNotAvailableException |
Supprimer le fichier
public void deleteFile (String deviceFilePath)
Paramètres | |
---|---|
deviceFilePath |
String |
Génère | |
---|---|
DeviceNotAvailableException |
appareilSoftRedémarré
public boolean deviceSoftRestarted (ProcessInfo prevSystemServerProcess)
Paramètres | |
---|---|
prevSystemServerProcess |
ProcessInfo |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
deviceSoftRestartedSince
public boolean deviceSoftRestartedSince (long utcEpochTime, TimeUnit timeUnit)
Paramètres | |
---|---|
utcEpochTime |
long |
timeUnit |
TimeUnit |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
désactiverAdbRoot
public boolean disableAdbRoot ()
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
désactiver la protection des touches
public void disableKeyguard ()
Génère | |
---|---|
DeviceNotAvailableException |
désactiver MoniteurRéseau
public boolean disableNetworkMonitor ()
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
déconnecter du Wifi
public boolean disconnectFromWifi ()
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
doesFileExist
public boolean doesFileExist (String deviceFilePath)
Paramètres | |
---|---|
deviceFilePath |
String |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
tas de mémoire
public File dumpHeap (String process, String devicePath)
Paramètres | |
---|---|
process |
String |
devicePath |
String |
Renvoie | |
---|---|
File |
Génère | |
---|---|
DeviceNotAvailableException |
enableAdbRoot
public boolean enableAdbRoot ()
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
enableNetworkMonitor
public boolean enableNetworkMonitor ()
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
Chiffrer l'appareil
public boolean encryptDevice (boolean inplace)
Paramètres | |
---|---|
inplace |
boolean |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
exécuterAdbCommand
public String executeAdbCommand (long timeout, String... cmdArgs)
Paramètres | |
---|---|
timeout |
long |
cmdArgs |
String |
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
exécuterAdbCommand
public String executeAdbCommand (String... cmdArgs)
Paramètres | |
---|---|
cmdArgs |
String |
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
exécuterFastbootCommand
public CommandResult executeFastbootCommand (String... cmdArgs)
Paramètres | |
---|---|
cmdArgs |
String |
Renvoie | |
---|---|
CommandResult |
Génère | |
---|---|
DeviceNotAvailableException |
exécuterFastbootCommand
public CommandResult executeFastbootCommand (long timeout, String... cmdArgs)
Paramètres | |
---|---|
timeout |
long |
cmdArgs |
String |
Renvoie | |
---|---|
CommandResult |
Génère | |
---|---|
DeviceNotAvailableException |
ExécuterLongFastbootCommand
public CommandResult executeLongFastbootCommand (String... cmdArgs)
Paramètres | |
---|---|
cmdArgs |
String |
Renvoie | |
---|---|
CommandResult |
Génère | |
---|---|
DeviceNotAvailableException |
exécuterShellCommand
public String executeShellCommand (String command)
Paramètres | |
---|---|
command |
String |
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
exécuterShellCommand
public void executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts)
Paramètres | |
---|---|
command |
String |
receiver |
IShellOutputReceiver |
maxTimeToOutputShellResponse |
long |
timeUnit |
TimeUnit |
retryAttempts |
int |
Génère | |
---|---|
DeviceNotAvailableException |
exécuterShellCommand
public void executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeoutForCommand, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts)
Paramètres | |
---|---|
command |
String |
receiver |
IShellOutputReceiver |
maxTimeoutForCommand |
long |
maxTimeToOutputShellResponse |
long |
timeUnit |
TimeUnit |
retryAttempts |
int |
Génère | |
---|---|
DeviceNotAvailableException |
exécuterShellCommand
public void executeShellCommand (String command, IShellOutputReceiver receiver)
Paramètres | |
---|---|
command |
String |
receiver |
IShellOutputReceiver |
Génère | |
---|---|
DeviceNotAvailableException |
ExécuterShellV2Command
public CommandResult executeShellV2Command (String cmd)
Paramètres | |
---|---|
cmd |
String |
Renvoie | |
---|---|
CommandResult |
Génère | |
---|---|
DeviceNotAvailableException |
ExécuterShellV2Command
public CommandResult executeShellV2Command (String cmd, OutputStream pipeToOutput)
Paramètres | |
---|---|
cmd |
String |
pipeToOutput |
OutputStream |
Renvoie | |
---|---|
CommandResult |
Génère | |
---|---|
DeviceNotAvailableException |
ExécuterShellV2Command
public CommandResult executeShellV2Command (String cmd, File pipeAsInput)
Paramètres | |
---|---|
cmd |
String |
pipeAsInput |
File |
Renvoie | |
---|---|
CommandResult |
Génère | |
---|---|
DeviceNotAvailableException |
ExécuterShellV2Command
public CommandResult executeShellV2Command (String cmd, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
Paramètres | |
---|---|
cmd |
String |
maxTimeoutForCommand |
long |
timeUnit |
TimeUnit |
retryAttempts |
int |
Renvoie | |
---|---|
CommandResult |
Génère | |
---|---|
DeviceNotAvailableException |
ExécuterShellV2Command
public CommandResult executeShellV2Command (String cmd, long maxTimeoutForCommand, TimeUnit timeUnit)
Paramètres | |
---|---|
cmd |
String |
maxTimeoutForCommand |
long |
timeUnit |
TimeUnit |
Renvoie | |
---|---|
CommandResult |
Génère | |
---|---|
DeviceNotAvailableException |
ExécuterShellV2Command
public CommandResult executeShellV2Command (String cmd, File pipeAsInput, OutputStream pipeToOutput, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
Paramètres | |
---|---|
cmd |
String |
pipeAsInput |
File |
pipeToOutput |
OutputStream |
maxTimeoutForCommand |
long |
timeUnit |
TimeUnit |
retryAttempts |
int |
Renvoie | |
---|---|
CommandResult |
Génère | |
---|---|
DeviceNotAvailableException |
ExécuterShellV2Command
public CommandResult executeShellV2Command (String cmd, File pipeAsInput, OutputStream pipeToOutput, OutputStream pipeToError, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
Paramètres | |
---|---|
cmd |
String |
pipeAsInput |
File |
pipeToOutput |
OutputStream |
pipeToError |
OutputStream |
maxTimeoutForCommand |
long |
timeUnit |
TimeUnit |
retryAttempts |
int |
Renvoie | |
---|---|
CommandResult |
Génère | |
---|---|
DeviceNotAvailableException |
fastbootEffacerPartition
public CommandResult fastbootWipePartition (String partition)
Paramètres | |
---|---|
partition |
String |
Renvoie | |
---|---|
CommandResult |
Génère | |
---|---|
DeviceNotAvailableException |
GetActiveApexes
publicgetActiveApexes ()
Renvoie | |
---|---|
|
Génère | |
---|---|
DeviceNotAvailableException |
getTous les paramètres
publicgetAllSettings (String namespace)
Paramètres | |
---|---|
namespace |
String |
Renvoie | |
---|---|
|
Génère | |
---|---|
DeviceNotAvailableException |
getAllocationState
public DeviceAllocationState getAllocationState ()
Renvoie | |
---|---|
DeviceAllocationState |
getAndroidId
public String getAndroidId (int userId)
Paramètres | |
---|---|
userId |
int |
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
getAndroidIds
publicgetAndroidIds ()
Renvoie | |
---|---|
|
Génère | |
---|---|
DeviceNotAvailableException |
niveau getApi
public int getApiLevel ()
Renvoie | |
---|---|
int |
Génère | |
---|---|
DeviceNotAvailableException |
getAppPackageInfo
public PackageInfo getAppPackageInfo (String packageName)
Paramètres | |
---|---|
packageName |
String |
Renvoie | |
---|---|
PackageInfo |
Génère | |
---|---|
DeviceNotAvailableException |
getAppPackageInfos
publicgetAppPackageInfos ()
Renvoie | |
---|---|
|
Génère | |
---|---|
DeviceNotAvailableException |
getBasebandVersion
public String getBasebandVersion ()
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
getBatterie
public Integer getBattery ()
Renvoie | |
---|---|
Integer |
getBooleanProperty
public boolean getBooleanProperty (String name, boolean defaultValue)
Paramètres | |
---|---|
name |
String |
defaultValue |
boolean |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
getBootHistory
publicgetBootHistory ()
Renvoie | |
---|---|
|
Génère | |
---|---|
DeviceNotAvailableException |
getBootHistorySince
publicgetBootHistorySince (long utcEpochTime, TimeUnit timeUnit)
Paramètres | |
---|---|
utcEpochTime |
long |
timeUnit |
TimeUnit |
Renvoie | |
---|---|
|
Génère | |
---|---|
DeviceNotAvailableException |
getBootloaderVersion
public String getBootloaderVersion ()
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
getBugreport
public InputStreamSource getBugreport ()
Renvoie | |
---|---|
InputStreamSource |
GetBugreportz
public InputStreamSource getBugreportz ()
Renvoie | |
---|---|
InputStreamSource |
getBuildAlias
public String getBuildAlias ()
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
getBuildFlavor
public String getBuildFlavor ()
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
getBuildId
public String getBuildId ()
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
getBuildSigningKeys
public String getBuildSigningKeys ()
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
getCachedDeviceDescriptor
public DeviceDescriptor getCachedDeviceDescriptor ()
Renvoie | |
---|---|
DeviceDescriptor |
EnfantsEnfants
public String[] getChildren (String path)
Paramètres | |
---|---|
path |
String |
Renvoie | |
---|---|
String[] |
Génère | |
---|---|
DeviceNotAvailableException |
getCurrentFoldableState
public DeviceFoldableState getCurrentFoldableState ()
Renvoie | |
---|---|
DeviceFoldableState |
Génère | |
---|---|
DeviceNotAvailableException |
getCurrentUser
public int getCurrentUser ()
Renvoie | |
---|---|
int |
Génère | |
---|---|
DeviceNotAvailableException |
getDeviceClass
public String getDeviceClass ()
Renvoie | |
---|---|
String |
getDeviceDate
public long getDeviceDate ()
Renvoie | |
---|---|
long |
Génère | |
---|---|
DeviceNotAvailableException |
getDeviceDescriptor
public DeviceDescriptor getDeviceDescriptor ()
Renvoie | |
---|---|
DeviceDescriptor |
getDeviceState
public TestDeviceState getDeviceState ()
Renvoie | |
---|---|
TestDeviceState |
getDeviceTimeOffset
public long getDeviceTimeOffset (Date date)
Paramètres | |
---|---|
date |
Date |
Renvoie | |
---|---|
long |
Génère | |
---|---|
DeviceNotAvailableException |
getEmulatorOutput
public InputStreamSource getEmulatorOutput ()
Renvoie | |
---|---|
InputStreamSource |
getEmulatorProcess
public Process getEmulatorProcess ()
Renvoie | |
---|---|
Process |
getExecuteShellCommandLog
public final File getExecuteShellCommandLog ()
Journal contenant tous les journaux executeShellCommand(String)
.
Renvoie | |
---|---|
File |
getExternalStoreFreeSpace
public long getExternalStoreFreeSpace ()
Renvoie | |
---|---|
long |
Génère | |
---|---|
DeviceNotAvailableException |
getFastbootPath
public String getFastbootPath ()
Renvoie | |
---|---|
String |
getFastbootProductType
public String getFastbootProductType ()
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
getFastbootProductVariant
public String getFastbootProductVariant ()
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
getFastbootSerialNumber
public String getFastbootSerialNumber ()
Renvoie | |
---|---|
String |
getFastbootVariable
public String getFastbootVariable (String variableName)
Paramètres | |
---|---|
variableName |
String |
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
getFastbootVersion
public String getFastbootVersion ()
Renvoie | |
---|---|
String |
getFileEntry
public IFileEntry getFileEntry (String path)
Paramètres | |
---|---|
path |
String |
Renvoie | |
---|---|
IFileEntry |
Génère | |
---|---|
DeviceNotAvailableException |
getFileEntry
public IFileEntry getFileEntry (FileListingService.FileEntry entry)
Outil d'aide non officiel pour obtenir un FileEntry
à partir d'un chemin d'accès non racine. PROBLÈME: refactoriser le fichier
FileEntry pour qu'il soit disponible depuis n'importe quel chemin d'accès. (même non racine).
Paramètres | |
---|---|
entry |
FileListingService.FileEntry : un élément FileEntry qui n'est pas nécessairement racine, comme l'exige Ddmlib. |
Renvoie | |
---|---|
IFileEntry |
un FileEntryWrapper représentant l'entrée FileEntry. |
Génère | |
---|---|
DeviceNotAvailableException |
getFoldableStates
publicgetFoldableStates ()
Renvoie | |
---|---|
|
Génère | |
---|---|
DeviceNotAvailableException |
getIDevice
public IDevice getIDevice ()
Renvoie | |
---|---|
IDevice |
getInstallPackageNames
publicgetInstalledPackageNames ()
Renvoie | |
---|---|
|
Génère | |
---|---|
DeviceNotAvailableException |
getIntProperty
public long getIntProperty (String name, long defaultValue)
Paramètres | |
---|---|
name |
String |
defaultValue |
long |
Renvoie | |
---|---|
long |
Génère | |
---|---|
DeviceNotAvailableException |
getIpAddress
public String getIpAddress ()
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
getKeyguardState
public KeyguardControllerState getKeyguardState ()
Renvoie | |
---|---|
KeyguardControllerState |
Génère | |
---|---|
DeviceNotAvailableException |
getLastExpectRestartTimeMillis
public long getLastExpectedRebootTimeMillis ()
Renvoie | |
---|---|
long |
getLaunchApiLevel
public int getLaunchApiLevel ()
Renvoie | |
---|---|
int |
Génère | |
---|---|
DeviceNotAvailableException |
getLogcat
public InputStreamSource getLogcat ()
Renvoie | |
---|---|
InputStreamSource |
getLogcat
public InputStreamSource getLogcat (int maxBytes)
Paramètres | |
---|---|
maxBytes |
int |
Renvoie | |
---|---|
InputStreamSource |
getLogcatDump
public InputStreamSource getLogcatDump ()
Renvoie | |
---|---|
InputStreamSource |
getLogcatLogcat
public InputStreamSource getLogcatSince (long date)
Paramètres | |
---|---|
date |
long |
Renvoie | |
---|---|
InputStreamSource |
getMacAddress
public String getMacAddress ()
Renvoie | |
---|---|
String |
getMainlineModuleInfo
publicgetMainlineModuleInfo ()
Renvoie | |
---|---|
|
Génère | |
---|---|
DeviceNotAvailableException |
getMaxNumberOfRunningUsersCompatibles
public int getMaxNumberOfRunningUsersSupported ()
Renvoie | |
---|---|
int |
Génère | |
---|---|
DeviceNotAvailableException |
getMaxNumberOfUsersCompatibles
public int getMaxNumberOfUsersSupported ()
Renvoie | |
---|---|
int |
Génère | |
---|---|
DeviceNotAvailableException |
getMonitor
public IDeviceStateMonitor getMonitor ()
Renvoie | |
---|---|
IDeviceStateMonitor |
GetMountPoint
public String getMountPoint (String mountName)
Paramètres | |
---|---|
mountName |
String |
Renvoie | |
---|---|
String |
getMountPointInfo
public ITestDevice.MountPointInfo getMountPointInfo (String mountpoint)
Paramètres | |
---|---|
mountpoint |
String |
Renvoie | |
---|---|
ITestDevice.MountPointInfo |
Génère | |
---|---|
DeviceNotAvailableException |
getMountPointInfo
publicgetMountPointInfo ()
Renvoie | |
---|---|
|
Génère | |
---|---|
DeviceNotAvailableException |
getOptions
public TestDeviceOptions getOptions ()
Renvoie | |
---|---|
TestDeviceOptions |
getPartitionFreeSpace
public long getPartitionFreeSpace (String partition)
Paramètres | |
---|---|
partition |
String |
Renvoie | |
---|---|
long |
Génère | |
---|---|
DeviceNotAvailableException |
getPrimaryUserId
public Integer getPrimaryUserId ()
Renvoie | |
---|---|
Integer |
Génère | |
---|---|
DeviceNotAvailableException |
getProcessByName
public ProcessInfo getProcessByName (String processName)
Paramètres | |
---|---|
processName |
String |
Renvoie | |
---|---|
ProcessInfo |
Génère | |
---|---|
DeviceNotAvailableException |
getProcessPid
public String getProcessPid (String process)
Paramètres | |
---|---|
process |
String |
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
getProductType
public String getProductType ()
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
getProductVariant
public String getProductVariant ()
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
getProperty
public String getProperty (String name)
Paramètres | |
---|---|
name |
String |
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
getRecoveryMode
public ITestDevice.RecoveryMode getRecoveryMode ()
Renvoie | |
---|---|
ITestDevice.RecoveryMode |
getScreenshot
public InputStreamSource getScreenshot (String format)
Paramètres | |
---|---|
format |
String |
Renvoie | |
---|---|
InputStreamSource |
Génère | |
---|---|
DeviceNotAvailableException |
getScreenshot
public InputStreamSource getScreenshot (long displayId)
Paramètres | |
---|---|
displayId |
long |
Renvoie | |
---|---|
InputStreamSource |
Génère | |
---|---|
DeviceNotAvailableException |
getScreenshot
public InputStreamSource getScreenshot (String format, boolean rescale)
Paramètres | |
---|---|
format |
String |
rescale |
boolean |
Renvoie | |
---|---|
InputStreamSource |
Génère | |
---|---|
DeviceNotAvailableException |
getScreenshot
public InputStreamSource getScreenshot ()
Renvoie | |
---|---|
InputStreamSource |
Génère | |
---|---|
DeviceNotAvailableException |
getSerialNumber
public String getSerialNumber ()
Renvoie | |
---|---|
String |
getSetting
public String getSetting (int userId, String namespace, String key)
Paramètres | |
---|---|
userId |
int |
namespace |
String |
key |
String |
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
getSetting
public String getSetting (String namespace, String key)
Paramètres | |
---|---|
namespace |
String |
key |
String |
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
getSimOperator
public String getSimOperator ()
Renvoie | |
---|---|
String |
getSimState
public String getSimState ()
Renvoie | |
---|---|
String |
getTombstones
publicgetTombstones ()
Renvoie | |
---|---|
|
Génère | |
---|---|
DeviceNotAvailableException |
getTotalMemory
public long getTotalMemory ()
Renvoie | |
---|---|
long |
getDésinstallerablePackageNames
publicgetUninstallablePackageNames ()
Renvoie | |
---|---|
|
Génère | |
---|---|
DeviceNotAvailableException |
getUseFastbootEffacer
public boolean getUseFastbootErase ()
Renvoie | |
---|---|
boolean |
getUserFlags
public int getUserFlags (int userId)
Paramètres | |
---|---|
userId |
int |
Renvoie | |
---|---|
int |
Génère | |
---|---|
DeviceNotAvailableException |
getUserInfos
publicgetUserInfos ()
Renvoie | |
---|---|
|
Génère | |
---|---|
DeviceNotAvailableException |
getUserSerialNumber
public int getUserSerialNumber (int userId)
Paramètres | |
---|---|
userId |
int |
Renvoie | |
---|---|
int |
Génère | |
---|---|
DeviceNotAvailableException |
Événement de gestion des allocations
public IManagedTestDevice.DeviceEventResponse handleAllocationEvent (DeviceEvent event)
Traiter DeviceEvent, qui peut ou non faire passer cet appareil à une nouvelle allocation de l'état.
Paramètres | |
---|---|
event |
DeviceEvent |
Renvoie | |
---|---|
IManagedTestDevice.DeviceEventResponse |
Fonction
public boolean hasFeature (String feature)
Paramètres | |
---|---|
feature |
String |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
Installer le package
public String installPackage (File packageFile, boolean reinstall, String... extraArgs)
Paramètres | |
---|---|
packageFile |
File |
reinstall |
boolean |
extraArgs |
String |
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
Installer le package
public String installPackage (File packageFile, boolean reinstall, boolean grantPermissions, String... extraArgs)
Paramètres | |
---|---|
packageFile |
File |
reinstall |
boolean |
grantPermissions |
boolean |
extraArgs |
String |
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
installPackageForUser
public String installPackageForUser (File packageFile, boolean reinstall, int userId, String... extraArgs)
Paramètres | |
---|---|
packageFile |
File |
reinstall |
boolean |
userId |
int |
extraArgs |
String |
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
installPackageForUser
public String installPackageForUser (File packageFile, boolean reinstall, boolean grantPermissions, int userId, String... extraArgs)
Paramètres | |
---|---|
packageFile |
File |
reinstall |
boolean |
grantPermissions |
boolean |
userId |
int |
extraArgs |
String |
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
IsAdbRoot
public boolean isAdbRoot ()
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
isAdbTcp
public boolean isAdbTcp ()
Renvoie | |
---|---|
boolean |
isAppEnumerationSupported
public boolean isAppEnumerationSupported ()
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
isDeviceEncrypted
public boolean isDeviceEncrypted ()
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
isDirectory
public boolean isDirectory (String path)
Paramètres | |
---|---|
path |
String |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
isEnableAdbRoot
public boolean isEnableAdbRoot ()
Renvoie | |
---|---|
boolean |
true si la racine adb doit être activée sur l'appareil
|
isChiffrementCompatible
public boolean isEncryptionSupported ()
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
isExecutable (isExecutable)
public boolean isExecutable (String fullPath)
Paramètres | |
---|---|
fullPath |
String |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
IsFastbootEnabled
public boolean isFastbootEnabled ()
Renvoie | |
---|---|
boolean |
IsHeadless
public boolean isHeadless ()
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
isMultiUserCompatible
public boolean isMultiUserSupported ()
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
isPackageInstallée
public boolean isPackageInstalled (String packageName, String userId)
Paramètres | |
---|---|
packageName |
String |
userId |
String |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
isPackageInstallée
public boolean isPackageInstalled (String packageName)
Paramètres | |
---|---|
packageName |
String |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
isRuntimePermissionCompatible
public boolean isRuntimePermissionSupported ()
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
isStateBootloaderOrFastbootd
public boolean isStateBootloaderOrFastbootd ()
Renvoie | |
---|---|
boolean |
isUserRunning
public boolean isUserRunning (int userId)
Paramètres | |
---|---|
userId |
int |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
isUserSecondaire
public boolean isUserSecondary (int userId)
Paramètres | |
---|---|
userId |
int |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
isWifiEnabled
public boolean isWifiEnabled ()
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
listDisplayIds
publiclistDisplayIds ()
Renvoie | |
---|---|
|
Génère | |
---|---|
DeviceNotAvailableException |
Lister les utilisateurs
publiclistUsers ()
Renvoie | |
---|---|
|
Génère | |
---|---|
DeviceNotAvailableException |
Rapport logBug
public boolean logBugreport (String dataName, ITestLogger listener)
Paramètres | |
---|---|
dataName |
String |
listener |
ITestLogger |
Renvoie | |
---|---|
boolean |
ouverture de session sur l'appareil
public void logOnDevice (String tag, Log.LogLevel level, String format, Object... args)
Paramètres | |
---|---|
tag |
String |
level |
Log.LogLevel |
format |
String |
args |
Object |
nonBlockingRedémarrer
public void nonBlockingReboot ()
Génère | |
---|---|
DeviceNotAvailableException |
postAdbRootAction
public void postAdbRootAction ()
À remplacer si l'appareil nécessite des actions spécifiques après la racine adb et avant la l'appareil est à nouveau connecté. L'implémentation par défaut n'inclut aucune action supplémentaire. L'activation de la racine adb n'est pas garantie à ce stade.
Génère | |
---|---|
DeviceNotAvailableException |
postAdbUnrootAction
public void postAdbUnrootAction ()
À remplacer si l'appareil nécessite des actions spécifiques après le retrait d'adb et avant l'appareil est à nouveau connecté. L'implémentation par défaut n'inclut aucune autre action. Il n'est pas garanti que la racine adb soit désactivée à ce stade.
Génère | |
---|---|
DeviceNotAvailableException |
postBootSetup
public void postBootSetup ()
Génère | |
---|---|
DeviceNotAvailableException |
postInvocationTearDown
public void postInvocationTearDown (Throwable exception)
Paramètres | |
---|---|
exception |
Throwable |
PreInvocationSetup
public void preInvocationSetup (IBuildInfo info, MultiMap<String, String> attributes)
Paramètres | |
---|---|
info |
IBuildInfo |
attributes |
MultiMap |
Génère | |
---|---|
DeviceNotAvailableException |
|
TargetSetupError |
Fonction pull Dir
public boolean pullDir (String deviceFilePath, File localDir)
Paramètres | |
---|---|
deviceFilePath |
String |
localDir |
File |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
pullFile
public boolean pullFile (String remoteFilePath, File localFile)
Paramètres | |
---|---|
remoteFilePath |
String |
localFile |
File |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
pullFile
public File pullFile (String remoteFilePath)
Paramètres | |
---|---|
remoteFilePath |
String |
Renvoie | |
---|---|
File |
Génère | |
---|---|
DeviceNotAvailableException |
pullFileContents
public String pullFileContents (String remoteFilePath)
Paramètres | |
---|---|
remoteFilePath |
String |
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
pullFileFromExternal
public File pullFileFromExternal (String remoteFilePath)
Paramètres | |
---|---|
remoteFilePath |
String |
Renvoie | |
---|---|
File |
Génère | |
---|---|
DeviceNotAvailableException |
Rép. push
public boolean pushDir (File localFileDir, String deviceFilePath,excludedDirectories)
Paramètres | |
---|---|
localFileDir |
File |
deviceFilePath |
String |
excludedDirectories |
|
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
Rép. push
public boolean pushDir (File localFileDir, String deviceFilePath)
Paramètres | |
---|---|
localFileDir |
File |
deviceFilePath |
String |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
fichier push
public boolean pushFile (File localFile, String remoteFilePath)
Paramètres | |
---|---|
localFile |
File |
remoteFilePath |
String |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
pushString
public boolean pushString (String contents, String remoteFilePath)
Paramètres | |
---|---|
contents |
String |
remoteFilePath |
String |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
redémarrer
public void reboot (String reason)
Paramètres | |
---|---|
reason |
String |
Génère | |
---|---|
DeviceNotAvailableException |
redémarrer
public void reboot ()
Génère | |
---|---|
DeviceNotAvailableException |
redémarrer le bootloader dans le bootloader
public void rebootIntoBootloader ()
Génère | |
---|---|
DeviceNotAvailableException |
redémarrer
public void rebootIntoFastbootd ()
Génère | |
---|---|
DeviceNotAvailableException |
redémarrer votre navigateur
public void rebootIntoRecovery ()
Génère | |
---|---|
DeviceNotAvailableException |
redémarrer le chargement latéral
public void rebootIntoSideload ()
Génère | |
---|---|
DeviceNotAvailableException |
redémarrer le chargement latéral
public void rebootIntoSideload (boolean autoReboot)
Paramètres | |
---|---|
autoReboot |
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
redémarrer jusqu'au magasin en ligne
public void rebootUntilOnline ()
Génère | |
---|---|
DeviceNotAvailableException |
redémarrer jusqu'au magasin en ligne
public void rebootUntilOnline (String reason)
Paramètres | |
---|---|
reason |
String |
Génère | |
---|---|
DeviceNotAvailableException |
redémarrer l'espace utilisateur
public void rebootUserspace ()
Génère | |
---|---|
DeviceNotAvailableException |
redémarrer l'espaceUtilisateurJusqu'àEnligne
public void rebootUserspaceUntilOnline ()
Génère | |
---|---|
DeviceNotAvailableException |
récupérer l'appareil
public void recoverDevice ()
Tentatives de récupération de la communication de l'appareil.
Génère | |
---|---|
DeviceNotAvailableException |
si l'appareil n'est plus disponible |
remountSystemWritable
public void remountSystemWritable ()
Génère | |
---|---|
DeviceNotAvailableException |
remountVendorWritable
public void remountVendorWritable ()
Génère | |
---|---|
DeviceNotAvailableException |
removeAdmin
public boolean removeAdmin (String componentName, int userId)
Paramètres | |
---|---|
componentName |
String |
userId |
int |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
removeOwners
public void removeOwners ()
Génère | |
---|---|
DeviceNotAvailableException |
Supprimer l'utilisateur
public boolean removeUser (int userId)
Paramètres | |
---|---|
userId |
int |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
réinitialiserContentProviderSetup
public void resetContentProviderSetup ()
Réinitialisez l'indicateur de configuration du fournisseur de contenu afin de le déclencher de nouveau.
exécuterInstrumentationTests
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner, ITestLifeCycleReceiver... listeners)
Paramètres | |
---|---|
runner |
IRemoteAndroidTestRunner |
listeners |
ITestLifeCycleReceiver |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
exécuterInstrumentationTests
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner,listeners)
Paramètres | |
---|---|
runner |
IRemoteAndroidTestRunner |
listeners |
|
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
runInstrumentationTestsAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, ITestLifeCycleReceiver... listeners)
Paramètres | |
---|---|
runner |
IRemoteAndroidTestRunner |
userId |
int |
listeners |
ITestLifeCycleReceiver |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
runInstrumentationTestsAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId,listeners)
Paramètres | |
---|---|
runner |
IRemoteAndroidTestRunner |
userId |
int |
listeners |
|
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
Définir une configuration
public void setConfiguration (IConfiguration configuration)
Il injecte les IConfiguration
en cours d'utilisation.
Paramètres | |
---|---|
configuration |
IConfiguration |
setDate
public void setDate (Date date)
Paramètres | |
---|---|
date |
Date |
Génère | |
---|---|
DeviceNotAvailableException |
setDeviceOwner
public boolean setDeviceOwner (String componentName, int userId)
Paramètres | |
---|---|
componentName |
String |
userId |
int |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
setDeviceState
public void setDeviceState (TestDeviceState deviceState)
Paramètres | |
---|---|
deviceState |
TestDeviceState |
setEmulatorOutputStream
public void setEmulatorOutputStream (SizeLimitedOutputStream output)
Pour l'émulateur, définissez SizeLimitedOutputStream
pour consigner la sortie.
Paramètres | |
---|---|
output |
SizeLimitedOutputStream : pour consigner la sortie
|
setEmulatorProcess
public void setEmulatorProcess (Process p)
Paramètres | |
---|---|
p |
Process |
setFastbootEnabled
public void setFastbootEnabled (boolean fastbootEnabled)
Paramètres | |
---|---|
fastbootEnabled |
boolean |
setFastbootPath
public void setFastbootPath (String fastbootPath)
Paramètres | |
---|---|
fastbootPath |
String |
Définir l'appareil
public void setIDevice (IDevice newDevice)
Paramètres | |
---|---|
newDevice |
IDevice |
Définir les options
public void setOptions (TestDeviceOptions options)
Paramètres | |
---|---|
options |
TestDeviceOptions |
Définir une propriété
public boolean setProperty (String propKey, String propValue)
Paramètres | |
---|---|
propKey |
String |
propValue |
String |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
setRecovery
public void setRecovery (IDeviceRecovery recovery)
Paramètres | |
---|---|
recovery |
IDeviceRecovery |
setRecoveryMode
public void setRecoveryMode (ITestDevice.RecoveryMode mode)
Paramètres | |
---|---|
mode |
ITestDevice.RecoveryMode |
Définir un paramètre
public void setSetting (String namespace, String key, String value)
Paramètres | |
---|---|
namespace |
String |
key |
String |
value |
String |
Génère | |
---|---|
DeviceNotAvailableException |
Définir un paramètre
public void setSetting (int userId, String namespace, String key, String value)
Paramètres | |
---|---|
userId |
int |
namespace |
String |
key |
String |
value |
String |
Génère | |
---|---|
DeviceNotAvailableException |
setUseFastbootEffacer
public void setUseFastbootErase (boolean useFastbootErase)
Paramètres | |
---|---|
useFastbootErase |
boolean |
startLogcat
public void startLogcat ()
utilisateurdémarrer
public boolean startUser (int userId)
Paramètres | |
---|---|
userId |
int |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
utilisateurdémarrer
public boolean startUser (int userId, boolean waitFlag)
Paramètres | |
---|---|
userId |
int |
waitFlag |
boolean |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
stopEmulatorOutput
public void stopEmulatorOutput ()
stopLogcat
public void stopLogcat ()
utilisateur stop
public boolean stopUser (int userId)
Paramètres | |
---|---|
userId |
int |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
utilisateur stop
public boolean stopUser (int userId, boolean waitFlag, boolean forceFlag)
Paramètres | |
---|---|
userId |
int |
waitFlag |
boolean |
forceFlag |
boolean |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
switchToAdbTcp
public String switchToAdbTcp ()
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
switchToAdbUsb
public boolean switchToAdbUsb ()
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
contacteur
public boolean switchUser (int userId)
Paramètres | |
---|---|
userId |
int |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
contacteur
public boolean switchUser (int userId, long timeout)
Paramètres | |
---|---|
userId |
int |
timeout |
long |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
syncFiles
public boolean syncFiles (File localFileDir, String deviceFilePath)
Paramètres | |
---|---|
localFileDir |
File |
deviceFilePath |
String |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
TakeBugreport
public Bugreport takeBugreport ()
Renvoie | |
---|---|
Bugreport |
décrypter l'appareil
public boolean unencryptDevice ()
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
désinstaller le package
public String uninstallPackage (String packageName)
Paramètres | |
---|---|
packageName |
String |
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
désinstallerPackageForUser
public String uninstallPackageForUser (String packageName, int userId)
Paramètres | |
---|---|
packageName |
String |
userId |
int |
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
déverrouiller l'appareil
public boolean unlockDevice ()
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
WaitForBootComplete
public boolean waitForBootComplete (long timeOut)
Paramètres | |
---|---|
timeOut |
long |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
WaitForDeviceAvailable
public void waitForDeviceAvailable ()
Génère | |
---|---|
DeviceNotAvailableException |
WaitForDeviceAvailable
public void waitForDeviceAvailable (long waitTime)
Paramètres | |
---|---|
waitTime |
long |
Génère | |
---|---|
DeviceNotAvailableException |
WaitForDeviceInRecovery
public boolean waitForDeviceInRecovery (long waitTime)
Paramètres | |
---|---|
waitTime |
long |
Renvoie | |
---|---|
boolean |
WaitForDeviceInSideload
public boolean waitForDeviceInSideload (long waitTime)
Paramètres | |
---|---|
waitTime |
long |
Renvoie | |
---|---|
boolean |
WaitForDeviceNotAvailable
public boolean waitForDeviceNotAvailable (long waitTime)
Paramètres | |
---|---|
waitTime |
long |
Renvoie | |
---|---|
boolean |
WaitForDeviceOnline
public void waitForDeviceOnline ()
Génère | |
---|---|
DeviceNotAvailableException |
WaitForDeviceOnline
public void waitForDeviceOnline (long waitTime)
Paramètres | |
---|---|
waitTime |
long |
Génère | |
---|---|
DeviceNotAvailableException |
WaitForDeviceShell
public boolean waitForDeviceShell (long waitTime)
Paramètres | |
---|---|
waitTime |
long |
Renvoie | |
---|---|
boolean |
Méthodes protégées
checkApiLevelA par rapport à
protected void checkApiLevelAgainst (String feature, int strictMinLevel)
Paramètres | |
---|---|
feature |
String |
strictMinLevel |
int |
createRedémarrerDeviceAction
protected NativeDevice.RebootDeviceAction createRebootDeviceAction (NativeDevice.RebootMode rebootMode, String reason)
Créez un RebootDeviceAction
à utiliser lors d'une action de redémarrage.
Paramètres | |
---|---|
rebootMode |
NativeDevice.RebootMode : mode de ce redémarrage. |
reason |
String : pour ce redémarrage. |
Renvoie | |
---|---|
NativeDevice.RebootDeviceAction |
le RebootDeviceAction créé.
|
doAdbRedémarrer
protected void doAdbReboot (NativeDevice.RebootMode rebootMode, String reason)
Effectuez un redémarrage adb.
Paramètres | |
---|---|
rebootMode |
NativeDevice.RebootMode : mode de ce redémarrage. |
reason |
String : pour ce redémarrage. |
Génère | |
---|---|
DeviceNotAvailableException |
Assurez-vous que les autorisations d'exécution sont prises en charge
protected void ensureRuntimePermissionSupported ()
Méthode d'assistance permettant de générer une exception si l'autorisation d'exécution n'est pas prise en charge
Génère | |
---|---|
DeviceNotAvailableException |
getBugreportInternal
protected InputStreamSource getBugreportInternal ()
Renvoie | |
---|---|
InputStreamSource |
getBugreportzInternal
protected File getBugreportzInternal ()
Méthode d'assistance interne permettant d'obtenir le fichier ZIP bugreportz en tant que ERROR(/File)
.
Renvoie | |
---|---|
File |
interneGetProperty
protected String internalGetProperty (String propName, String fastbootVar, String description)
Récupère une propriété d'appareil, à partir du cache ddmlib par défaut, et en revenant à adb shell getprop" ou "fastboot getvar", selon que l'appareil est en Fastboot ou non.
Paramètres | |
---|---|
propName |
String : nom de la propriété de l'appareil renvoyé par "adb shell getprop" |
fastbootVar |
String : nom de la variable fastboot équivalente à interroger. si null ,
la requête fastboot ne sera pas tentée |
description |
String : description simple de la variable. La première lettre doit être en majuscule. |
Renvoie | |
---|---|
String |
Chaîne (éventuellement null ou vide) contenant la valeur de la propriété donnée
|
Génère | |
---|---|
DeviceNotAvailableException |
isNewer (Plus récent)
protected boolean isNewer (File localFile, IFileEntry entry)
Renvoie true
si le fichier local est plus récent que le fichier distant. IFileEntry
étant
à la minute près, le fichier est considéré comme plus récent, même si les heures sont égales.
Paramètres | |
---|---|
localFile |
File |
entry |
IFileEntry |
Renvoie | |
---|---|
boolean |
performanceDeviceAction
protected boolean performDeviceAction (String actionDescription, com.android.tradefed.device.NativeDevice.DeviceAction action, int retryAttempts)
Effectue une action sur cet appareil. Tentatives de récupération de l'appareil et possibilité de relancer la commande si l'action échoue.
Paramètres | |
---|---|
actionDescription |
String : brève description de l'action à effectuer. Utilisé pour la journalisation
uniquement. |
action |
com.android.tradefed.device.NativeDevice.DeviceAction : action à effectuer |
retryAttempts |
int : la nouvelle tentative tente d'effectuer l'action en cas d'échec, mais
récupération réussie |
Renvoie | |
---|---|
boolean |
true si l'action a bien été effectuée |
Génère | |
---|---|
DeviceNotAvailableException |
si la tentative de récupération échoue ou si le nombre maximal de tentatives est atteint sans succès |
postAdbRedémarrer
protected void postAdbReboot ()
Actions supplémentaires possibles après un redémarrage.
Génère | |
---|---|
DeviceNotAvailableException |
configuration prePostBootSetup
protected void prePostBootSetup ()
Permet à chaque type d'appareil (AndroidNativeDevice, TestDevice) de remplacer cette méthode pour configuration post-amorçage spécifique.
Génère | |
---|---|
DeviceNotAvailableException |
régler l'horloge
protected void setClock (Clock clock)
Définissez l'instance Clock à utiliser.
Paramètres | |
---|---|
clock |
Clock |
setLogStartDelay
protected void setLogStartDelay (int delay)
Définit le délai d'attente, en millisecondes, avant de lancer la capture logcat pour un appareil en ligne.
Paramètres | |
---|---|
delay |
int : délai en ms.
|
WaitForDeviceNotAvailable
protected void waitForDeviceNotAvailable (String operationDesc, long time)
Paramètres | |
---|---|
operationDesc |
String |
time |
long |