NativeDevice
public
class
NativeDevice
extends Object
implements
IManagedTestDevice,
IConfigurationReceiver
java.lang.Object | |
↳ | com.android.tradefed.device.NativeDevice |
Standardimplementierung eines ITestDevice
nicht vollständigen Stacks für Android-Geräte.
Zusammenfassung
Verschachtelte Klassen | |
---|---|
class |
NativeDevice.AdbAction
Eine |
class |
NativeDevice.AdbShellAction
|
class |
NativeDevice.RebootDeviceAction
|
enum |
NativeDevice.RebootMode
Ein Neustartmodus. |
Konstanten | |
---|---|
int |
INVALID_USER_ID
Wert, der für eine ungültige/nicht gefundene Nutzer-ID zurückgegeben wird: UserHandle hat den Wert -10000 definiert |
long |
MAX_HOST_DEVICE_TIME_OFFSET
|
int |
MAX_RETRY_ATTEMPTS
die Standardanzahl der Wiederholungsversuche für Befehle |
Felder | |
---|---|
protected
static
final
String |
SD_CARD
|
protected
static
final
String |
STORAGE_EMULATED
|
protected
TestDeviceOptions |
mOptions
|
protected
final
IDeviceStateMonitor |
mStateMonitor
|
Öffentliche Konstruktoren | |
---|---|
NativeDevice(IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)
Erstellt einen |
Öffentliche Methoden | |
---|---|
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()
Das Protokoll, das alle |
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)
Inoffizieller Helfer zum Abrufen einer |
|
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)
Verarbeite das DeviceEvent, wodurch dieses Gerät möglicherweise in einen neuen Zuweisungsstatus übergeht. |
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()
Überschreiben Sie diese Option, wenn nach dem Rooten mit adb bestimmte Aktionen auf dem Gerät ausgeführt werden müssen, bevor es wieder online ist. |
void
|
postAdbUnrootAction()
Überschreiben Sie diese Option, wenn nach dem Entfernen des Root-Zugriffs mit adb bestimmte Aktionen auf dem Gerät ausgeführt werden müssen, bevor es wieder online ist. |
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()
Es wird versucht, die Gerätekommunikation wiederherzustellen. |
void
|
remountSystemWritable()
|
void
|
remountVendorWritable()
|
boolean
|
removeAdmin(String componentName, int userId)
|
void
|
removeOwners()
|
boolean
|
removeUser(int userId)
|
void
|
resetContentProviderSetup()
Setze das Flag für die Einrichtung des Inhaltsanbieters zurück, um die Einrichtung noch einmal auszulösen. |
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)
Fügt den verwendeten |
void
|
setDate(Date date)
|
boolean
|
setDeviceOwner(String componentName, int userId)
|
void
|
setDeviceState(TestDeviceState deviceState)
|
void
|
setEmulatorOutputStream(SizeLimitedOutputStream output)
Für den Emulator |
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)
|
Geschützte Methoden | |
---|---|
void
|
checkApiLevelAgainst(String feature, int strictMinLevel)
|
NativeDevice.RebootDeviceAction
|
createRebootDeviceAction(NativeDevice.RebootMode rebootMode, String reason)
Erstellen Sie eine |
void
|
doAdbReboot(NativeDevice.RebootMode rebootMode, String reason)
Führen Sie einen ADB-Neustart durch. |
void
|
ensureRuntimePermissionSupported()
Hilfsmethode, um eine Ausnahme zu werfen, wenn die Laufzeitberechtigung nicht unterstützt wird |
InputStreamSource
|
getBugreportInternal()
|
File
|
getBugreportzInternal()
Interne Hilfsmethode zum Abrufen der ZIP-Datei „bugreportz“ als |
IRunUtil
|
getRunUtil()
Rufen Sie die zu verwendende |
String
|
internalGetProperty(String propName, String fastbootVar, String description)
Eine Geräteeigenschaft wird standardmäßig aus dem ddmlib-Cache abgerufen. Je nachdem, ob sich das Gerät im Fastboot-Modus befindet, wird entweder „adb shell getprop“ oder „fastboot getvar“ verwendet. |
boolean
|
isNewer(File localFile, IFileEntry entry)
Gibt |
boolean
|
performDeviceAction(String actionDescription, com.android.tradefed.device.NativeDevice.DeviceAction action, int retryAttempts)
Führt eine Aktion auf diesem Gerät aus. |
void
|
postAdbReboot()
Mögliche zusätzliche Aktionen, die nach einem Neustart ausgeführt werden können. |
void
|
prePostBootSetup()
Ermöglicht es jedem Gerätetyp (AndroidNativeDevice, TestDevice), diese Methode für die spezifische Einrichtung nach dem Start zu überschreiben. |
void
|
setClock(Clock clock)
Legen Sie die zu verwendende Uhren-Instanz fest. |
void
|
setLogStartDelay(int delay)
Legt die Zeit in Millisekunden fest, die gewartet werden soll, bevor die Logcat-Aufzeichnung für ein online verfügbares Gerät gestartet wird. |
void
|
waitForDeviceNotAvailable(String operationDesc, long time)
|
Konstanten
INVALID_USER_ID
public static final int INVALID_USER_ID
Wert, der für eine ungültige/nicht gefundene Nutzer-ID zurückgegeben wird: UserHandle hat den Wert -10000 definiert
Konstanter Wert: −10.000 (0xffffd8f0)
MAX_HOST_DEVICE_TIME_OFFSET
protected static final long MAX_HOST_DEVICE_TIME_OFFSET
Konstanter Wert: 5.000 (0x0000000000001388)
MAX_RETRY_ATTEMPTS
protected static final int MAX_RETRY_ATTEMPTS
die Standardanzahl der Wiederholungsversuche für Befehle
Konstanter Wert: 2 (0x00000002)
Felder
SD_CARD
protected static final String SD_CARD
STORAGE_EMULATED
protected static final String STORAGE_EMULATED
mOptions
protected TestDeviceOptions mOptions
mStateMonitor
protected final IDeviceStateMonitor mStateMonitor
Öffentliche Konstruktoren
NativeDevice
public NativeDevice (IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)
Erstellt einen TestDevice
.
Parameter | |
---|---|
device |
IDevice : die zugehörige IDevice |
stateMonitor |
IDeviceStateMonitor : Der zu verwendende IDeviceStateMonitor -Mechanismus |
allocationMonitor |
IDeviceMonitor : die IDeviceMonitor , um über Änderungen des Zuweisungsstatus zu informieren.
Kann null sein
|
Öffentliche Methoden
checkApiLevelAgainstNextRelease
public boolean checkApiLevelAgainstNextRelease (int strictMinLevel)
Parameter | |
---|---|
strictMinLevel |
int |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
checkConnectivity
public boolean checkConnectivity ()
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
clearErrorDialogs
public boolean clearErrorDialogs ()
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
clearLastConnectedWifiNetwork
public void clearLastConnectedWifiNetwork ()
clearLogcat
public void clearLogcat ()
connectToWifiNetwork
public boolean connectToWifiNetwork (String wifiSsid, String wifiPsk)
Parameter | |
---|---|
wifiSsid |
String |
wifiPsk |
String |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
connectToWifiNetwork
public boolean connectToWifiNetwork (String wifiSsid, String wifiPsk, boolean scanSsid)
Parameter | |
---|---|
wifiSsid |
String |
wifiPsk |
String |
scanSsid |
boolean |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
connectToWifiNetworkIfNeeded
public boolean connectToWifiNetworkIfNeeded (String wifiSsid, String wifiPsk, boolean scanSsid)
Parameter | |
---|---|
wifiSsid |
String |
wifiPsk |
String |
scanSsid |
boolean |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
connectToWifiNetworkIfNeeded
public boolean connectToWifiNetworkIfNeeded (String wifiSsid, String wifiPsk)
Parameter | |
---|---|
wifiSsid |
String |
wifiPsk |
String |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
createUser
public int createUser (String name, boolean guest, boolean ephemeral)
Parameter | |
---|---|
name |
String |
guest |
boolean |
ephemeral |
boolean |
Returns | |
---|---|
int |
Ausgabe | |
---|---|
DeviceNotAvailableException |
createUser
public int createUser (String name)
Parameter | |
---|---|
name |
String |
Returns | |
---|---|
int |
Ausgabe | |
---|---|
DeviceNotAvailableException |
createUserNoThrow
public int createUserNoThrow (String name)
Parameter | |
---|---|
name |
String |
Returns | |
---|---|
int |
Ausgabe | |
---|---|
DeviceNotAvailableException |
deleteFile
public void deleteFile (String deviceFilePath)
Parameter | |
---|---|
deviceFilePath |
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
deviceSoftRestarted
public boolean deviceSoftRestarted (ProcessInfo prevSystemServerProcess)
Parameter | |
---|---|
prevSystemServerProcess |
ProcessInfo |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
deviceSoftRestartedSince
public boolean deviceSoftRestartedSince (long utcEpochTime, TimeUnit timeUnit)
Parameter | |
---|---|
utcEpochTime |
long |
timeUnit |
TimeUnit |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
disableAdbRoot
public boolean disableAdbRoot ()
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
disableKeyguard
public void disableKeyguard ()
Ausgabe | |
---|---|
DeviceNotAvailableException |
disableNetworkMonitor
public boolean disableNetworkMonitor ()
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
disconnectFromWifi
public boolean disconnectFromWifi ()
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
doesFileExist
public boolean doesFileExist (String deviceFilePath)
Parameter | |
---|---|
deviceFilePath |
String |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
dumpHeap
public File dumpHeap (String process, String devicePath)
Parameter | |
---|---|
process |
String |
devicePath |
String |
Returns | |
---|---|
File |
Ausgabe | |
---|---|
DeviceNotAvailableException |
enableAdbRoot
public boolean enableAdbRoot ()
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
enableNetworkMonitor
public boolean enableNetworkMonitor ()
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
encryptDevice
public boolean encryptDevice (boolean inplace)
Parameter | |
---|---|
inplace |
boolean |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
executeAdbCommand
public String executeAdbCommand (long timeout, String... cmdArgs)
Parameter | |
---|---|
timeout |
long |
cmdArgs |
String |
Returns | |
---|---|
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
executeAdbCommand
public String executeAdbCommand (String... cmdArgs)
Parameter | |
---|---|
cmdArgs |
String |
Returns | |
---|---|
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
executeFastbootCommand
public CommandResult executeFastbootCommand (String... cmdArgs)
Parameter | |
---|---|
cmdArgs |
String |
Returns | |
---|---|
CommandResult |
Ausgabe | |
---|---|
DeviceNotAvailableException |
executeFastbootCommand
public CommandResult executeFastbootCommand (long timeout, String... cmdArgs)
Parameter | |
---|---|
timeout |
long |
cmdArgs |
String |
Returns | |
---|---|
CommandResult |
Ausgabe | |
---|---|
DeviceNotAvailableException |
executeLongFastbootCommand
public CommandResult executeLongFastbootCommand (String... cmdArgs)
Parameter | |
---|---|
cmdArgs |
String |
Returns | |
---|---|
CommandResult |
Ausgabe | |
---|---|
DeviceNotAvailableException |
executeShellCommand
public String executeShellCommand (String command)
Parameter | |
---|---|
command |
String |
Returns | |
---|---|
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
executeShellCommand
public void executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts)
Parameter | |
---|---|
command |
String |
receiver |
IShellOutputReceiver |
maxTimeToOutputShellResponse |
long |
timeUnit |
TimeUnit |
retryAttempts |
int |
Ausgabe | |
---|---|
DeviceNotAvailableException |
executeShellCommand
public void executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeoutForCommand, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts)
Parameter | |
---|---|
command |
String |
receiver |
IShellOutputReceiver |
maxTimeoutForCommand |
long |
maxTimeToOutputShellResponse |
long |
timeUnit |
TimeUnit |
retryAttempts |
int |
Ausgabe | |
---|---|
DeviceNotAvailableException |
executeShellCommand
public void executeShellCommand (String command, IShellOutputReceiver receiver)
Parameter | |
---|---|
command |
String |
receiver |
IShellOutputReceiver |
Ausgabe | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd)
Parameter | |
---|---|
cmd |
String |
Returns | |
---|---|
CommandResult |
Ausgabe | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd, OutputStream pipeToOutput)
Parameter | |
---|---|
cmd |
String |
pipeToOutput |
OutputStream |
Returns | |
---|---|
CommandResult |
Ausgabe | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd, File pipeAsInput)
Parameter | |
---|---|
cmd |
String |
pipeAsInput |
File |
Returns | |
---|---|
CommandResult |
Ausgabe | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
Parameter | |
---|---|
cmd |
String |
maxTimeoutForCommand |
long |
timeUnit |
TimeUnit |
retryAttempts |
int |
Returns | |
---|---|
CommandResult |
Ausgabe | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd, long maxTimeoutForCommand, TimeUnit timeUnit)
Parameter | |
---|---|
cmd |
String |
maxTimeoutForCommand |
long |
timeUnit |
TimeUnit |
Returns | |
---|---|
CommandResult |
Ausgabe | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd, File pipeAsInput, OutputStream pipeToOutput, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
Parameter | |
---|---|
cmd |
String |
pipeAsInput |
File |
pipeToOutput |
OutputStream |
maxTimeoutForCommand |
long |
timeUnit |
TimeUnit |
retryAttempts |
int |
Returns | |
---|---|
CommandResult |
Ausgabe | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd, File pipeAsInput, OutputStream pipeToOutput, OutputStream pipeToError, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
Parameter | |
---|---|
cmd |
String |
pipeAsInput |
File |
pipeToOutput |
OutputStream |
pipeToError |
OutputStream |
maxTimeoutForCommand |
long |
timeUnit |
TimeUnit |
retryAttempts |
int |
Returns | |
---|---|
CommandResult |
Ausgabe | |
---|---|
DeviceNotAvailableException |
fastbootWipePartition
public CommandResult fastbootWipePartition (String partition)
Parameter | |
---|---|
partition |
String |
Returns | |
---|---|
CommandResult |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getActiveApexes
publicgetActiveApexes ()
Returns | |
---|---|
|
Ausgabe | |
---|---|
DeviceNotAvailableException |
getAllSettings
publicgetAllSettings (String namespace)
Parameter | |
---|---|
namespace |
String |
Returns | |
---|---|
|
Ausgabe | |
---|---|
DeviceNotAvailableException |
getAllocationState
public DeviceAllocationState getAllocationState ()
Returns | |
---|---|
DeviceAllocationState |
getAndroidId
public String getAndroidId (int userId)
Parameter | |
---|---|
userId |
int |
Returns | |
---|---|
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getAndroidIds
publicgetAndroidIds ()
Returns | |
---|---|
|
Ausgabe | |
---|---|
DeviceNotAvailableException |
getApiLevel
public int getApiLevel ()
Returns | |
---|---|
int |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getAppPackageInfo
public PackageInfo getAppPackageInfo (String packageName)
Parameter | |
---|---|
packageName |
String |
Returns | |
---|---|
PackageInfo |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getAppPackageInfos
publicgetAppPackageInfos ()
Returns | |
---|---|
|
Ausgabe | |
---|---|
DeviceNotAvailableException |
getBasebandVersion
public String getBasebandVersion ()
Returns | |
---|---|
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getBattery
public Integer getBattery ()
Returns | |
---|---|
Integer |
getBooleanProperty
public boolean getBooleanProperty (String name, boolean defaultValue)
Parameter | |
---|---|
name |
String |
defaultValue |
boolean |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getBootHistory
publicgetBootHistory ()
Returns | |
---|---|
|
Ausgabe | |
---|---|
DeviceNotAvailableException |
getBootHistorySince
publicgetBootHistorySince (long utcEpochTime, TimeUnit timeUnit)
Parameter | |
---|---|
utcEpochTime |
long |
timeUnit |
TimeUnit |
Returns | |
---|---|
|
Ausgabe | |
---|---|
DeviceNotAvailableException |
getBootloaderVersion
public String getBootloaderVersion ()
Returns | |
---|---|
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getBugreport
public InputStreamSource getBugreport ()
Returns | |
---|---|
InputStreamSource |
getBugreportz
public InputStreamSource getBugreportz ()
Returns | |
---|---|
InputStreamSource |
getBuildAlias
public String getBuildAlias ()
Returns | |
---|---|
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getBuildFlavor
public String getBuildFlavor ()
Returns | |
---|---|
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getBuildId
public String getBuildId ()
Returns | |
---|---|
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getBuildSigningKeys
public String getBuildSigningKeys ()
Returns | |
---|---|
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getCachedDeviceDescriptor
public DeviceDescriptor getCachedDeviceDescriptor ()
Returns | |
---|---|
DeviceDescriptor |
getChildren
public String[] getChildren (String path)
Parameter | |
---|---|
path |
String |
Returns | |
---|---|
String[] |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getCurrentFoldableState
public DeviceFoldableState getCurrentFoldableState ()
Returns | |
---|---|
DeviceFoldableState |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getCurrentUser
public int getCurrentUser ()
Returns | |
---|---|
int |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getDeviceClass
public String getDeviceClass ()
Returns | |
---|---|
String |
getDeviceDate
public long getDeviceDate ()
Returns | |
---|---|
long |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getDeviceDescriptor
public DeviceDescriptor getDeviceDescriptor ()
Returns | |
---|---|
DeviceDescriptor |
getDeviceState
public TestDeviceState getDeviceState ()
Returns | |
---|---|
TestDeviceState |
getDeviceTimeOffset
public long getDeviceTimeOffset (Date date)
Parameter | |
---|---|
date |
Date |
Returns | |
---|---|
long |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getEmulatorOutput
public InputStreamSource getEmulatorOutput ()
Returns | |
---|---|
InputStreamSource |
getEmulatorProcess
public Process getEmulatorProcess ()
Returns | |
---|---|
Process |
getExecuteShellCommandLog
public final File getExecuteShellCommandLog ()
Das Protokoll, das alle executeShellCommand(String)
-Protokolle enthält.
Returns | |
---|---|
File |
getExternalStoreFreeSpace
public long getExternalStoreFreeSpace ()
Returns | |
---|---|
long |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getFastbootPath
public String getFastbootPath ()
Returns | |
---|---|
String |
getFastbootProductType
public String getFastbootProductType ()
Returns | |
---|---|
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getFastbootProductVariant
public String getFastbootProductVariant ()
Returns | |
---|---|
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getFastbootSerialNumber
public String getFastbootSerialNumber ()
Returns | |
---|---|
String |
getFastbootVariable
public String getFastbootVariable (String variableName)
Parameter | |
---|---|
variableName |
String |
Returns | |
---|---|
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getFastbootVersion
public String getFastbootVersion ()
Returns | |
---|---|
String |
getFileEntry
public IFileEntry getFileEntry (String path)
Parameter | |
---|---|
path |
String |
Returns | |
---|---|
IFileEntry |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getFileEntry
public IFileEntry getFileEntry (FileListingService.FileEntry entry)
Inoffizieller Helfer zum Abrufen einer FileEntry
von einem nicht übergeordneten Pfad. FIXME: FileEntry-System so umstrukturieren, dass es von jedem Pfad aus verfügbar ist. (auch nicht als Root-Benutzer).
Parameter | |
---|---|
entry |
FileListingService.FileEntry : Ein FileEntry , das nicht unbedingt der Root sein muss, wie es Ddmlib erfordert. |
Returns | |
---|---|
IFileEntry |
FileEntryWrapper für den FileEntry. |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getFoldableStates
publicgetFoldableStates ()
Returns | |
---|---|
|
Ausgabe | |
---|---|
DeviceNotAvailableException |
getIDevice
public IDevice getIDevice ()
Returns | |
---|---|
IDevice |
getInstalledPackageNames
publicgetInstalledPackageNames ()
Returns | |
---|---|
|
Ausgabe | |
---|---|
DeviceNotAvailableException |
getIntProperty
public long getIntProperty (String name, long defaultValue)
Parameter | |
---|---|
name |
String |
defaultValue |
long |
Returns | |
---|---|
long |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getIpAddress
public String getIpAddress ()
Returns | |
---|---|
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getKeyguardState
public KeyguardControllerState getKeyguardState ()
Returns | |
---|---|
KeyguardControllerState |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getLastExpectedRebootTimeMillis
public long getLastExpectedRebootTimeMillis ()
Returns | |
---|---|
long |
getLaunchApiLevel
public int getLaunchApiLevel ()
Returns | |
---|---|
int |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getLogcat
public InputStreamSource getLogcat ()
Returns | |
---|---|
InputStreamSource |
getLogcat
public InputStreamSource getLogcat (int maxBytes)
Parameter | |
---|---|
maxBytes |
int |
Returns | |
---|---|
InputStreamSource |
getLogcatDump
public InputStreamSource getLogcatDump ()
Returns | |
---|---|
InputStreamSource |
getLogcatSince
public InputStreamSource getLogcatSince (long date)
Parameter | |
---|---|
date |
long |
Returns | |
---|---|
InputStreamSource |
getMacAddress
public String getMacAddress ()
Returns | |
---|---|
String |
getMainlineModuleInfo
publicgetMainlineModuleInfo ()
Returns | |
---|---|
|
Ausgabe | |
---|---|
DeviceNotAvailableException |
getMaxNumberOfRunningUsersSupported
public int getMaxNumberOfRunningUsersSupported ()
Returns | |
---|---|
int |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getMaxNumberOfUsersSupported
public int getMaxNumberOfUsersSupported ()
Returns | |
---|---|
int |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getMonitor
public IDeviceStateMonitor getMonitor ()
Returns | |
---|---|
IDeviceStateMonitor |
getMountPoint
public String getMountPoint (String mountName)
Parameter | |
---|---|
mountName |
String |
Returns | |
---|---|
String |
getMountPointInfo
public ITestDevice.MountPointInfo getMountPointInfo (String mountpoint)
Parameter | |
---|---|
mountpoint |
String |
Returns | |
---|---|
ITestDevice.MountPointInfo |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getMountPointInfo
publicgetMountPointInfo ()
Returns | |
---|---|
|
Ausgabe | |
---|---|
DeviceNotAvailableException |
getOptions
public TestDeviceOptions getOptions ()
Returns | |
---|---|
TestDeviceOptions |
getPartitionFreeSpace
public long getPartitionFreeSpace (String partition)
Parameter | |
---|---|
partition |
String |
Returns | |
---|---|
long |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getPrimaryUserId
public Integer getPrimaryUserId ()
Returns | |
---|---|
Integer |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getProcessByName
public ProcessInfo getProcessByName (String processName)
Parameter | |
---|---|
processName |
String |
Returns | |
---|---|
ProcessInfo |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getProcessPid
public String getProcessPid (String process)
Parameter | |
---|---|
process |
String |
Returns | |
---|---|
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getProductType
public String getProductType ()
Returns | |
---|---|
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getProductVariant
public String getProductVariant ()
Returns | |
---|---|
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getProperty
public String getProperty (String name)
Parameter | |
---|---|
name |
String |
Returns | |
---|---|
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getRecoveryMode
public ITestDevice.RecoveryMode getRecoveryMode ()
Returns | |
---|---|
ITestDevice.RecoveryMode |
getScreenshot
public InputStreamSource getScreenshot (String format)
Parameter | |
---|---|
format |
String |
Returns | |
---|---|
InputStreamSource |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getScreenshot
public InputStreamSource getScreenshot (long displayId)
Parameter | |
---|---|
displayId |
long |
Returns | |
---|---|
InputStreamSource |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getScreenshot
public InputStreamSource getScreenshot (String format, boolean rescale)
Parameter | |
---|---|
format |
String |
rescale |
boolean |
Returns | |
---|---|
InputStreamSource |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getScreenshot
public InputStreamSource getScreenshot ()
Returns | |
---|---|
InputStreamSource |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getSerialNumber
public String getSerialNumber ()
Returns | |
---|---|
String |
getSetting
public String getSetting (int userId, String namespace, String key)
Parameter | |
---|---|
userId |
int |
namespace |
String |
key |
String |
Returns | |
---|---|
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getSetting
public String getSetting (String namespace, String key)
Parameter | |
---|---|
namespace |
String |
key |
String |
Returns | |
---|---|
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getSimOperator
public String getSimOperator ()
Returns | |
---|---|
String |
getSimState
public String getSimState ()
Returns | |
---|---|
String |
getTombstones
publicgetTombstones ()
Returns | |
---|---|
|
Ausgabe | |
---|---|
DeviceNotAvailableException |
getTotalMemory
public long getTotalMemory ()
Returns | |
---|---|
long |
getUninstallablePackageNames
publicgetUninstallablePackageNames ()
Returns | |
---|---|
|
Ausgabe | |
---|---|
DeviceNotAvailableException |
getUseFastbootErase
public boolean getUseFastbootErase ()
Returns | |
---|---|
boolean |
getUserFlags
public int getUserFlags (int userId)
Parameter | |
---|---|
userId |
int |
Returns | |
---|---|
int |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getUserInfos
publicgetUserInfos ()
Returns | |
---|---|
|
Ausgabe | |
---|---|
DeviceNotAvailableException |
getUserSerialNumber
public int getUserSerialNumber (int userId)
Parameter | |
---|---|
userId |
int |
Returns | |
---|---|
int |
Ausgabe | |
---|---|
DeviceNotAvailableException |
handleAllocationEvent
public IManagedTestDevice.DeviceEventResponse handleAllocationEvent (DeviceEvent event)
Verarbeite das DeviceEvent, wodurch dieses Gerät möglicherweise in einen neuen Zuweisungsstatus übergeht.
Parameter | |
---|---|
event |
DeviceEvent |
Returns | |
---|---|
IManagedTestDevice.DeviceEventResponse |
hasFeature
public boolean hasFeature (String feature)
Parameter | |
---|---|
feature |
String |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
installPackage
public String installPackage (File packageFile, boolean reinstall, String... extraArgs)
Parameter | |
---|---|
packageFile |
File |
reinstall |
boolean |
extraArgs |
String |
Returns | |
---|---|
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
installPackage
public String installPackage (File packageFile, boolean reinstall, boolean grantPermissions, String... extraArgs)
Parameter | |
---|---|
packageFile |
File |
reinstall |
boolean |
grantPermissions |
boolean |
extraArgs |
String |
Returns | |
---|---|
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
installPackageForUser
public String installPackageForUser (File packageFile, boolean reinstall, int userId, String... extraArgs)
Parameter | |
---|---|
packageFile |
File |
reinstall |
boolean |
userId |
int |
extraArgs |
String |
Returns | |
---|---|
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
installPackageForUser
public String installPackageForUser (File packageFile, boolean reinstall, boolean grantPermissions, int userId, String... extraArgs)
Parameter | |
---|---|
packageFile |
File |
reinstall |
boolean |
grantPermissions |
boolean |
userId |
int |
extraArgs |
String |
Returns | |
---|---|
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
isAdbRoot
public boolean isAdbRoot ()
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
isAdbTcp
public boolean isAdbTcp ()
Returns | |
---|---|
boolean |
isAppEnumerationSupported
public boolean isAppEnumerationSupported ()
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
isDeviceEncrypted
public boolean isDeviceEncrypted ()
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
isDirectory
public boolean isDirectory (String path)
Parameter | |
---|---|
path |
String |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
isEnableAdbRoot
public boolean isEnableAdbRoot ()
Returns | |
---|---|
boolean |
true , ob adb root auf dem Gerät aktiviert werden soll
|
isEncryptionSupported
public boolean isEncryptionSupported ()
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
isExecutable
public boolean isExecutable (String fullPath)
Parameter | |
---|---|
fullPath |
String |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
isFastbootEnabled
public boolean isFastbootEnabled ()
Returns | |
---|---|
boolean |
isHeadless
public boolean isHeadless ()
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
isMultiUserSupported
public boolean isMultiUserSupported ()
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
isPackageInstalled
public boolean isPackageInstalled (String packageName, String userId)
Parameter | |
---|---|
packageName |
String |
userId |
String |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
isPackageInstalled
public boolean isPackageInstalled (String packageName)
Parameter | |
---|---|
packageName |
String |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
isRuntimePermissionSupported
public boolean isRuntimePermissionSupported ()
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
isStateBootloaderOrFastbootd
public boolean isStateBootloaderOrFastbootd ()
Returns | |
---|---|
boolean |
isUserRunning
public boolean isUserRunning (int userId)
Parameter | |
---|---|
userId |
int |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
isUserSecondary
public boolean isUserSecondary (int userId)
Parameter | |
---|---|
userId |
int |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
isWifiEnabled
public boolean isWifiEnabled ()
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
listDisplayIds
publiclistDisplayIds ()
Returns | |
---|---|
|
Ausgabe | |
---|---|
DeviceNotAvailableException |
listUsers
publiclistUsers ()
Returns | |
---|---|
|
Ausgabe | |
---|---|
DeviceNotAvailableException |
logBugreport
public boolean logBugreport (String dataName, ITestLogger listener)
Parameter | |
---|---|
dataName |
String |
listener |
ITestLogger |
Returns | |
---|---|
boolean |
logOnDevice
public void logOnDevice (String tag, Log.LogLevel level, String format, Object... args)
Parameter | |
---|---|
tag |
String |
level |
Log.LogLevel |
format |
String |
args |
Object |
nonBlockingReboot
public void nonBlockingReboot ()
Ausgabe | |
---|---|
DeviceNotAvailableException |
postAdbRootAction
public void postAdbRootAction ()
Überschreiben Sie diese Option, wenn nach dem Rooten mit adb bestimmte Aktionen auf dem Gerät ausgeführt werden müssen, bevor es wieder online ist. Die Standardimplementierung enthält keine zusätzlichen Aktionen. Es ist nicht garantiert, dass „adb root“ in dieser Phase aktiviert ist.
Ausgabe | |
---|---|
DeviceNotAvailableException |
postAdbUnrootAction
public void postAdbUnrootAction ()
Überschreiben Sie diese Option, wenn nach dem Entfernen des Root-Zugriffs mit adb bestimmte Aktionen auf dem Gerät ausgeführt werden müssen, bevor es wieder online ist. Die Standardimplementierung umfasst keine zusätzlichen Aktionen. Es kann nicht garantiert werden, dass adb root in dieser Phase deaktiviert ist.
Ausgabe | |
---|---|
DeviceNotAvailableException |
postBootSetup
public void postBootSetup ()
Ausgabe | |
---|---|
DeviceNotAvailableException |
postInvocationTearDown
public void postInvocationTearDown (Throwable exception)
Parameter | |
---|---|
exception |
Throwable |
preInvocationSetup
public void preInvocationSetup (IBuildInfo info, MultiMap<String, String> attributes)
Parameter | |
---|---|
info |
IBuildInfo |
attributes |
MultiMap |
Ausgabe | |
---|---|
DeviceNotAvailableException |
|
TargetSetupError |
pullDir
public boolean pullDir (String deviceFilePath, File localDir)
Parameter | |
---|---|
deviceFilePath |
String |
localDir |
File |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
pullFile
public boolean pullFile (String remoteFilePath, File localFile)
Parameter | |
---|---|
remoteFilePath |
String |
localFile |
File |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
pullFile
public File pullFile (String remoteFilePath)
Parameter | |
---|---|
remoteFilePath |
String |
Returns | |
---|---|
File |
Ausgabe | |
---|---|
DeviceNotAvailableException |
pullFileContents
public String pullFileContents (String remoteFilePath)
Parameter | |
---|---|
remoteFilePath |
String |
Returns | |
---|---|
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
pullFileFromExternal
public File pullFileFromExternal (String remoteFilePath)
Parameter | |
---|---|
remoteFilePath |
String |
Returns | |
---|---|
File |
Ausgabe | |
---|---|
DeviceNotAvailableException |
pushDir
public boolean pushDir (File localFileDir, String deviceFilePath,excludedDirectories)
Parameter | |
---|---|
localFileDir |
File |
deviceFilePath |
String |
excludedDirectories |
|
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
pushDir
public boolean pushDir (File localFileDir, String deviceFilePath)
Parameter | |
---|---|
localFileDir |
File |
deviceFilePath |
String |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
pushFile
public boolean pushFile (File localFile, String remoteFilePath)
Parameter | |
---|---|
localFile |
File |
remoteFilePath |
String |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
pushString
public boolean pushString (String contents, String remoteFilePath)
Parameter | |
---|---|
contents |
String |
remoteFilePath |
String |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
neu starten
public void reboot (String reason)
Parameter | |
---|---|
reason |
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
neu starten
public void reboot ()
Ausgabe | |
---|---|
DeviceNotAvailableException |
rebootIntoBootloader
public void rebootIntoBootloader ()
Ausgabe | |
---|---|
DeviceNotAvailableException |
rebootIntoFastbootd
public void rebootIntoFastbootd ()
Ausgabe | |
---|---|
DeviceNotAvailableException |
rebootIntoRecovery
public void rebootIntoRecovery ()
Ausgabe | |
---|---|
DeviceNotAvailableException |
rebootIntoSideload
public void rebootIntoSideload ()
Ausgabe | |
---|---|
DeviceNotAvailableException |
rebootIntoSideload
public void rebootIntoSideload (boolean autoReboot)
Parameter | |
---|---|
autoReboot |
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
rebootUntilOnline
public void rebootUntilOnline ()
Ausgabe | |
---|---|
DeviceNotAvailableException |
rebootUntilOnline
public void rebootUntilOnline (String reason)
Parameter | |
---|---|
reason |
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
rebootUserspace
public void rebootUserspace ()
Ausgabe | |
---|---|
DeviceNotAvailableException |
rebootUserspaceUntilOnline
public void rebootUserspaceUntilOnline ()
Ausgabe | |
---|---|
DeviceNotAvailableException |
recoverDevice
public void recoverDevice ()
Es wird versucht, die Gerätekommunikation wiederherzustellen.
Ausgabe | |
---|---|
DeviceNotAvailableException |
Wenn das Gerät nicht mehr verfügbar ist |
remountSystemWritable
public void remountSystemWritable ()
Ausgabe | |
---|---|
DeviceNotAvailableException |
remountVendorWritable
public void remountVendorWritable ()
Ausgabe | |
---|---|
DeviceNotAvailableException |
removeAdmin
public boolean removeAdmin (String componentName, int userId)
Parameter | |
---|---|
componentName |
String |
userId |
int |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
removeOwners
public void removeOwners ()
Ausgabe | |
---|---|
DeviceNotAvailableException |
removeUser
public boolean removeUser (int userId)
Parameter | |
---|---|
userId |
int |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
resetContentProviderSetup
public void resetContentProviderSetup ()
Setze das Flag für die Einrichtung des Inhaltsanbieters zurück, um die Einrichtung noch einmal auszulösen.
runInstrumentationTests
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner, ITestLifeCycleReceiver... listeners)
Parameter | |
---|---|
runner |
IRemoteAndroidTestRunner |
listeners |
ITestLifeCycleReceiver |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
runInstrumentationTests
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner,listeners)
Parameter | |
---|---|
runner |
IRemoteAndroidTestRunner |
listeners |
|
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
runInstrumentationTestsAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, ITestLifeCycleReceiver... listeners)
Parameter | |
---|---|
runner |
IRemoteAndroidTestRunner |
userId |
int |
listeners |
ITestLifeCycleReceiver |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
runInstrumentationTestsAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId,listeners)
Parameter | |
---|---|
runner |
IRemoteAndroidTestRunner |
userId |
int |
listeners |
|
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
setConfiguration
public void setConfiguration (IConfiguration configuration)
Fügt den verwendeten IConfiguration
ein.
Parameter | |
---|---|
configuration |
IConfiguration |
setDate
public void setDate (Date date)
Parameter | |
---|---|
date |
Date |
Ausgabe | |
---|---|
DeviceNotAvailableException |
setDeviceOwner
public boolean setDeviceOwner (String componentName, int userId)
Parameter | |
---|---|
componentName |
String |
userId |
int |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
setDeviceState
public void setDeviceState (TestDeviceState deviceState)
Parameter | |
---|---|
deviceState |
TestDeviceState |
setEmulatorOutputStream
public void setEmulatorOutputStream (SizeLimitedOutputStream output)
Für den Emulator SizeLimitedOutputStream
auf „Logausgabe“ festlegen
Parameter | |
---|---|
output |
SizeLimitedOutputStream : Ausgabe protokollieren
|
setEmulatorProcess
public void setEmulatorProcess (Process p)
Parameter | |
---|---|
p |
Process |
setFastbootEnabled
public void setFastbootEnabled (boolean fastbootEnabled)
Parameter | |
---|---|
fastbootEnabled |
boolean |
setFastbootPath
public void setFastbootPath (String fastbootPath)
Parameter | |
---|---|
fastbootPath |
String |
setIDevice
public void setIDevice (IDevice newDevice)
Parameter | |
---|---|
newDevice |
IDevice |
setOptions
public void setOptions (TestDeviceOptions options)
Parameter | |
---|---|
options |
TestDeviceOptions |
setProperty
public boolean setProperty (String propKey, String propValue)
Parameter | |
---|---|
propKey |
String |
propValue |
String |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
setRecovery
public void setRecovery (IDeviceRecovery recovery)
Parameter | |
---|---|
recovery |
IDeviceRecovery |
setRecoveryMode
public void setRecoveryMode (ITestDevice.RecoveryMode mode)
Parameter | |
---|---|
mode |
ITestDevice.RecoveryMode |
setSetting
public void setSetting (String namespace, String key, String value)
Parameter | |
---|---|
namespace |
String |
key |
String |
value |
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
setSetting
public void setSetting (int userId, String namespace, String key, String value)
Parameter | |
---|---|
userId |
int |
namespace |
String |
key |
String |
value |
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
setUseFastbootErase
public void setUseFastbootErase (boolean useFastbootErase)
Parameter | |
---|---|
useFastbootErase |
boolean |
startLogcat
public void startLogcat ()
startUser
public boolean startUser (int userId)
Parameter | |
---|---|
userId |
int |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
startUser
public boolean startUser (int userId, boolean waitFlag)
Parameter | |
---|---|
userId |
int |
waitFlag |
boolean |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
stopEmulatorOutput
public void stopEmulatorOutput ()
stopLogcat
public void stopLogcat ()
stopUser
public boolean stopUser (int userId)
Parameter | |
---|---|
userId |
int |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
stopUser
public boolean stopUser (int userId, boolean waitFlag, boolean forceFlag)
Parameter | |
---|---|
userId |
int |
waitFlag |
boolean |
forceFlag |
boolean |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
switchToAdbTcp
public String switchToAdbTcp ()
Returns | |
---|---|
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
switchToAdbUsb
public boolean switchToAdbUsb ()
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
switchUser
public boolean switchUser (int userId)
Parameter | |
---|---|
userId |
int |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
switchUser
public boolean switchUser (int userId, long timeout)
Parameter | |
---|---|
userId |
int |
timeout |
long |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
syncFiles
public boolean syncFiles (File localFileDir, String deviceFilePath)
Parameter | |
---|---|
localFileDir |
File |
deviceFilePath |
String |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
takeBugreport
public Bugreport takeBugreport ()
Returns | |
---|---|
Bugreport |
unencryptDevice
public boolean unencryptDevice ()
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
uninstallPackage
public String uninstallPackage (String packageName)
Parameter | |
---|---|
packageName |
String |
Returns | |
---|---|
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
uninstallPackageForUser
public String uninstallPackageForUser (String packageName, int userId)
Parameter | |
---|---|
packageName |
String |
userId |
int |
Returns | |
---|---|
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
unlockDevice
public boolean unlockDevice ()
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
waitForBootComplete
public boolean waitForBootComplete (long timeOut)
Parameter | |
---|---|
timeOut |
long |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
waitForDeviceAvailable
public void waitForDeviceAvailable ()
Ausgabe | |
---|---|
DeviceNotAvailableException |
waitForDeviceAvailable
public void waitForDeviceAvailable (long waitTime)
Parameter | |
---|---|
waitTime |
long |
Ausgabe | |
---|---|
DeviceNotAvailableException |
waitForDeviceInRecovery
public boolean waitForDeviceInRecovery (long waitTime)
Parameter | |
---|---|
waitTime |
long |
Returns | |
---|---|
boolean |
waitForDeviceInSideload
public boolean waitForDeviceInSideload (long waitTime)
Parameter | |
---|---|
waitTime |
long |
Returns | |
---|---|
boolean |
waitForDeviceNotAvailable
public boolean waitForDeviceNotAvailable (long waitTime)
Parameter | |
---|---|
waitTime |
long |
Returns | |
---|---|
boolean |
waitForDeviceOnline
public void waitForDeviceOnline ()
Ausgabe | |
---|---|
DeviceNotAvailableException |
waitForDeviceOnline
public void waitForDeviceOnline (long waitTime)
Parameter | |
---|---|
waitTime |
long |
Ausgabe | |
---|---|
DeviceNotAvailableException |
waitForDeviceShell
public boolean waitForDeviceShell (long waitTime)
Parameter | |
---|---|
waitTime |
long |
Returns | |
---|---|
boolean |
Geschützte Methoden
checkApiLevelAgainst
protected void checkApiLevelAgainst (String feature, int strictMinLevel)
Parameter | |
---|---|
feature |
String |
strictMinLevel |
int |
createRebootDeviceAction
protected NativeDevice.RebootDeviceAction createRebootDeviceAction (NativeDevice.RebootMode rebootMode, String reason)
Erstellen Sie eine RebootDeviceAction
, die beim Ausführen einer Neustartaktion verwendet werden soll.
Parameter | |
---|---|
rebootMode |
NativeDevice.RebootMode : einen Modus dieses Neustarts. |
reason |
String : für diesen Neustart. |
Returns | |
---|---|
NativeDevice.RebootDeviceAction |
den erstellten RebootDeviceAction .
|
doAdbReboot
protected void doAdbReboot (NativeDevice.RebootMode rebootMode, String reason)
Führen Sie einen ADB-Neustart durch.
Parameter | |
---|---|
rebootMode |
NativeDevice.RebootMode : einen Modus dieses Neustarts. |
reason |
String : für diesen Neustart. |
Ausgabe | |
---|---|
DeviceNotAvailableException |
ensureRuntimePermissionSupported
protected void ensureRuntimePermissionSupported ()
Hilfsmethode, um eine Ausnahme zu werfen, wenn die Laufzeitberechtigung nicht unterstützt wird
Ausgabe | |
---|---|
DeviceNotAvailableException |
getBugreportInternal
protected InputStreamSource getBugreportInternal ()
Returns | |
---|---|
InputStreamSource |
getBugreportzInternal
protected File getBugreportzInternal ()
Interne Hilfsmethode zum Abrufen der ZIP-Datei „bugreportz“ als ERROR(/File)
.
Returns | |
---|---|
File |
getRunUtil
protected IRunUtil getRunUtil ()
Rufen Sie die zu verwendende RunUtil
-Instanz ab.
Returns | |
---|---|
IRunUtil |
internalGetProperty
protected String internalGetProperty (String propName, String fastbootVar, String description)
Eine Geräteeigenschaft wird standardmäßig aus dem ddmlib-Cache abgerufen. Je nachdem, ob sich das Gerät im Fastboot-Modus befindet, wird entweder „adb shell getprop“ oder „fastboot getvar“ verwendet.
Parameter | |
---|---|
propName |
String : Der Name der Geräteeigenschaft, wie von „adb shell getprop“ zurückgegeben |
fastbootVar |
String : Der Name der zu abfragenden entsprechenden Fastboot-Variablen. Bei null wird keine Fastboot-Abfrage versucht. |
description |
String : Eine einfache Beschreibung der Variablen. Der erste Buchstabe sollte großgeschrieben werden. |
Returns | |
---|---|
String |
Ein String, möglicherweise null oder leer, der den Wert der angegebenen Property enthält
|
Ausgabe | |
---|---|
DeviceNotAvailableException |
isNewer
protected boolean isNewer (File localFile, IFileEntry entry)
Gibt true
zurück, wenn die lokale Datei neuer ist als die Remotedatei. IFileEntry
muss auf die Minute genau sein. Bei gleicher Uhrzeit gilt die Datei als neuer.
Parameter | |
---|---|
localFile |
File |
entry |
IFileEntry |
Returns | |
---|---|
boolean |
performDeviceAction
protected boolean performDeviceAction (String actionDescription, com.android.tradefed.device.NativeDevice.DeviceAction action, int retryAttempts)
Führt eine Aktion auf diesem Gerät aus. Versucht, das Gerät wiederherzustellen, und führt den Befehl optional noch einmal aus, falls die Aktion fehlschlägt.
Parameter | |
---|---|
actionDescription |
String : Eine kurze Beschreibung der auszuführenden Aktion. Wird nur zu Protokollierungszwecken verwendet. |
action |
com.android.tradefed.device.NativeDevice.DeviceAction : die auszuführende Aktion |
retryAttempts |
int : Die Wiederholungsversuche für die Aktion, wenn sie fehlschlägt, die Wiederherstellung aber erfolgreich ist |
Returns | |
---|---|
boolean |
true , wenn die Aktion erfolgreich war |
Ausgabe | |
---|---|
DeviceNotAvailableException |
if recovery attempt fails or max attempts done without success |
postAdbReboot
protected void postAdbReboot ()
Mögliche zusätzliche Aktionen, die nach einem Neustart ausgeführt werden können.
Ausgabe | |
---|---|
DeviceNotAvailableException |
prePostBootSetup
protected void prePostBootSetup ()
Ermöglicht es jedem Gerätetyp (AndroidNativeDevice, TestDevice), diese Methode für die spezifische Einrichtung nach dem Start zu überschreiben.
Ausgabe | |
---|---|
DeviceNotAvailableException |
setClock
protected void setClock (Clock clock)
Legen Sie die zu verwendende Uhren-Instanz fest.
Parameter | |
---|---|
clock |
Clock |
setLogStartDelay
protected void setLogStartDelay (int delay)
Legt die Zeit in Millisekunden fest, die gewartet werden soll, bevor die Logcat-Aufzeichnung für ein online verfügbares Gerät gestartet wird.
Parameter | |
---|---|
delay |
int : Verzögerung in ms
|
waitForDeviceNotAvailable
protected void waitForDeviceNotAvailable (String operationDesc, long time)
Parameter | |
---|---|
operationDesc |
String |
time |
long |