NativeDevice
public
class
NativeDevice
extends Object
implements
IManagedTestDevice,
IConfigurationReceiver
java.lang.Object | |
😎 | com.android.tradefed.device.NativeDevice. |
Standardimplementierung eines ITestDevice
Nicht-Full-Stack-Android-Geräts.
Zusammenfassung
Verschachtelte Klassen | |
---|---|
class |
NativeDevice.AdbAction
Ein |
class |
NativeDevice.AdbShellAction
|
class |
NativeDevice.RebootDeviceAction
|
enum |
NativeDevice.RebootMode
Ein Neustartmodus. |
Konstanten | |
---|---|
int |
INVALID_USER_ID
Zurückgegebener Wert für ungültige oder nicht gefundene Nutzer-IDs: UserHandle hat -10000 definiert |
long |
MAX_HOST_DEVICE_TIME_OFFSET
|
int |
MAX_RETRY_ATTEMPTS
die Standardanzahl der Wiederholungsversuche für den Befehl |
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 ein |
Ö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 Log, 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)
Inoffizielles Hilfsprogramm zum Abrufen eines |
|
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)
DeviceEvent verarbeiten, wodurch dieses Gerät möglicherweise auf eine neue Zuweisung umgestellt wird Bundesstaat. |
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()
Überschreibt, wenn für das Gerät bestimmte Aktionen nach dem ADB-Root und vor dem Ihr Gerät wieder online ist. |
void
|
postAdbUnrootAction()
Überschreibt, wenn für das Gerät nach dem Aufheben des Root-Status von ADB und vor dem das Gerät 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()
Versuche, die Gerätekommunikation wiederherzustellen. |
void
|
remountSystemWritable()
|
void
|
remountVendorWritable()
|
boolean
|
removeAdmin(String componentName, int userId)
|
void
|
removeOwners()
|
boolean
|
removeUser(int userId)
|
void
|
resetContentProviderSetup()
Setzen Sie die Markierung für die Einrichtung des Contentanbieters zurück, um ihn 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)
Injiziertes |
void
|
setDate(Date date)
|
boolean
|
setDeviceOwner(String componentName, int userId)
|
void
|
setDeviceState(TestDeviceState deviceState)
|
void
|
setEmulatorOutputStream(SizeLimitedOutputStream output)
Legen Sie 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)
Starten Sie ADB-Neustart. |
void
|
ensureRuntimePermissionSupported()
Hilfsmethode zum Auslösen einer Ausnahme, 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)
Ruft standardmäßig eine Geräteeigenschaft aus dem ddmlib-Cache ab und greift dabei entweder auf "adb" zu Shell getprop" oder "fastboot getvar", je nachdem, ob sich das Gerät in Fastboot befindet oder nicht. |
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 jedem Gerätetyp (AndroidNativeDevice, TestDevice), diese Methode für nach der Boot-Einrichtung. |
void
|
setClock(Clock clock)
Legen Sie die zu verwendende Uhrinstanz fest. |
void
|
setLogStartDelay(int delay)
Legt die Wartezeit in ms fest, bevor die Logcat-Erfassung für ein Onlinegerät gestartet wird. |
void
|
waitForDeviceNotAvailable(String operationDesc, long time)
|
Konstanten
UNGÜLTIGE_NUTZER-ID
public static final int INVALID_USER_ID
Zurückgegebener Wert für ungültige oder nicht gefundene Nutzer-IDs: UserHandle hat -10000 definiert
Konstantenwert: -10.000 (0xffffd8f0)
MAX_HOST_DEVICE_TIME_offSET
protected static final long MAX_HOST_DEVICE_TIME_OFFSET
Konstantenwert: 5.000 (0x0000000000001388)
MAX_RETRY_ATTEMPTS
protected static final int MAX_RETRY_ATTEMPTS
die Standardanzahl der Wiederholungsversuche für den Befehl
Konstantenwert: 2. (0x00000002)
Felder
SD-KARTE
protected static final String SD_CARD
SPEICHER_EMPULIERT
protected static final String STORAGE_EMULATED
Optionen
protected TestDeviceOptions mOptions
mStateMonitor
protected final IDeviceStateMonitor mStateMonitor
Öffentliche Konstruktoren
NativeDevice
public NativeDevice (IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)
Erstellt ein TestDevice
.
Parameter | |
---|---|
device |
IDevice : die zugehörige IDevice |
stateMonitor |
IDeviceStateMonitor : der zu verwendende IDeviceStateMonitor -Mechanismus |
allocationMonitor |
IDeviceMonitor : IDeviceMonitor zur Information über Änderungen des Zuweisungsstatus.
Kann null sein
|
Öffentliche Methoden
checkApiLevelAgainstNextRelease (API-LevelAgainstNextRelease)
public boolean checkApiLevelAgainstNextRelease (int strictMinLevel)
Parameter | |
---|---|
strictMinLevel |
int |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
Verbindung prüfen
public boolean checkConnectivity ()
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
ClearErrorDialogs
public boolean clearErrorDialogs ()
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
ClearLastConnectedWifiNetwork
public void clearLastConnectedWifiNetwork ()
ClearLogcat
public void clearLogcat ()
mit Wifi-Netzwerk verbinden
public boolean connectToWifiNetwork (String wifiSsid, String wifiPsk)
Parameter | |
---|---|
wifiSsid |
String |
wifiPsk |
String |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
mit Wifi-Netzwerk verbinden
public boolean connectToWifiNetwork (String wifiSsid, String wifiPsk, boolean scanSsid)
Parameter | |
---|---|
wifiSsid |
String |
wifiPsk |
String |
scanSsid |
boolean |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
Verbindung mit WLAN-Netzwerk herstellen (falls erforderlich)
public boolean connectToWifiNetworkIfNeeded (String wifiSsid, String wifiPsk, boolean scanSsid)
Parameter | |
---|---|
wifiSsid |
String |
wifiPsk |
String |
scanSsid |
boolean |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
Verbindung mit WLAN-Netzwerk herstellen (falls erforderlich)
public boolean connectToWifiNetworkIfNeeded (String wifiSsid, String wifiPsk)
Parameter | |
---|---|
wifiSsid |
String |
wifiPsk |
String |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
Nutzer erstellen
public int createUser (String name, boolean guest, boolean ephemeral)
Parameter | |
---|---|
name |
String |
guest |
boolean |
ephemeral |
boolean |
Returns | |
---|---|
int |
Ausgabe | |
---|---|
DeviceNotAvailableException |
Nutzer erstellen
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 |
Datei löschen
public void deleteFile (String deviceFilePath)
Parameter | |
---|---|
deviceFilePath |
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
deviceSoftNeustart
public boolean deviceSoftRestarted (ProcessInfo prevSystemServerProcess)
Parameter | |
---|---|
prevSystemServerProcess |
ProcessInfo |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
deviceSoftneustart seit
public boolean deviceSoftRestartedSince (long utcEpochTime, TimeUnit timeUnit)
Parameter | |
---|---|
utcEpochTime |
long |
timeUnit |
TimeUnit |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
deaktiviereAdbRoot
public boolean disableAdbRoot ()
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
Keyguard deaktivieren
public void disableKeyguard ()
Ausgabe | |
---|---|
DeviceNotAvailableException |
Netzwerkmonitor deaktivieren
public boolean disableNetworkMonitor ()
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
VonWLAN trennen
public boolean disconnectFromWifi ()
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
tutFileExist
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 |
Gerät verschlüsseln
public boolean encryptDevice (boolean inplace)
Parameter | |
---|---|
inplace |
boolean |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
Befehl ausführen
public String executeAdbCommand (long timeout, String... cmdArgs)
Parameter | |
---|---|
timeout |
long |
cmdArgs |
String |
Returns | |
---|---|
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
Befehl ausführen
public String executeAdbCommand (String... cmdArgs)
Parameter | |
---|---|
cmdArgs |
String |
Returns | |
---|---|
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
Schnellstart-Befehl ausführen
public CommandResult executeFastbootCommand (String... cmdArgs)
Parameter | |
---|---|
cmdArgs |
String |
Returns | |
---|---|
CommandResult |
Ausgabe | |
---|---|
DeviceNotAvailableException |
Schnellstart-Befehl ausführen
public CommandResult executeFastbootCommand (long timeout, String... cmdArgs)
Parameter | |
---|---|
timeout |
long |
cmdArgs |
String |
Returns | |
---|---|
CommandResult |
Ausgabe | |
---|---|
DeviceNotAvailableException |
LongFastbootCommand ausführen
public CommandResult executeLongFastbootCommand (String... cmdArgs)
Parameter | |
---|---|
cmdArgs |
String |
Returns | |
---|---|
CommandResult |
Ausgabe | |
---|---|
DeviceNotAvailableException |
AusführenShellCommand
public String executeShellCommand (String command)
Parameter | |
---|---|
command |
String |
Returns | |
---|---|
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
AusführenShellCommand
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 |
AusführenShellCommand
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 |
AusführenShellCommand
public void executeShellCommand (String command, IShellOutputReceiver receiver)
Parameter | |
---|---|
command |
String |
receiver |
IShellOutputReceiver |
Ausgabe | |
---|---|
DeviceNotAvailableException |
AusführenShellV2Command
public CommandResult executeShellV2Command (String cmd)
Parameter | |
---|---|
cmd |
String |
Returns | |
---|---|
CommandResult |
Ausgabe | |
---|---|
DeviceNotAvailableException |
AusführenShellV2Command
public CommandResult executeShellV2Command (String cmd, OutputStream pipeToOutput)
Parameter | |
---|---|
cmd |
String |
pipeToOutput |
OutputStream |
Returns | |
---|---|
CommandResult |
Ausgabe | |
---|---|
DeviceNotAvailableException |
AusführenShellV2Command
public CommandResult executeShellV2Command (String cmd, File pipeAsInput)
Parameter | |
---|---|
cmd |
String |
pipeAsInput |
File |
Returns | |
---|---|
CommandResult |
Ausgabe | |
---|---|
DeviceNotAvailableException |
AusführenShellV2Command
public CommandResult executeShellV2Command (String cmd, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
Parameter | |
---|---|
cmd |
String |
maxTimeoutForCommand |
long |
timeUnit |
TimeUnit |
retryAttempts |
int |
Returns | |
---|---|
CommandResult |
Ausgabe | |
---|---|
DeviceNotAvailableException |
AusführenShellV2Command
public CommandResult executeShellV2Command (String cmd, long maxTimeoutForCommand, TimeUnit timeUnit)
Parameter | |
---|---|
cmd |
String |
maxTimeoutForCommand |
long |
timeUnit |
TimeUnit |
Returns | |
---|---|
CommandResult |
Ausgabe | |
---|---|
DeviceNotAvailableException |
AusführenShellV2Command
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 |
AusführenShellV2Command
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 |
Einstellungen abrufen
publicgetAllSettings (String namespace)
Parameter | |
---|---|
namespace |
String |
Returns | |
---|---|
|
Ausgabe | |
---|---|
DeviceNotAvailableException |
getAllocationState
public DeviceAllocationState getAllocationState ()
Returns | |
---|---|
DeviceAllocationState |
getAndroidId (GetAndroid-ID)
public String getAndroidId (int userId)
Parameter | |
---|---|
userId |
int |
Returns | |
---|---|
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getAndroidIds (Abrufen von Android-IDs)
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 (App-Paketinformationen abrufen)
publicgetAppPackageInfos ()
Returns | |
---|---|
|
Ausgabe | |
---|---|
DeviceNotAvailableException |
getBasebandVersion
public String getBasebandVersion ()
Returns | |
---|---|
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getAkku
public Integer getBattery ()
Returns | |
---|---|
Integer |
getBoolescheProperty
public boolean getBooleanProperty (String name, boolean defaultValue)
Parameter | |
---|---|
name |
String |
defaultValue |
boolean |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getBootVerlauf
publicgetBootHistory ()
Returns | |
---|---|
|
Ausgabe | |
---|---|
DeviceNotAvailableException |
getBootVerlaufSeit
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 Log, das alle executeShellCommand(String)
-Logs enthält.
Returns | |
---|---|
File |
getExternalStoreFreeSpace
public long getExternalStoreFreeSpace ()
Returns | |
---|---|
long |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getFastbootPath
public String getFastbootPath ()
Returns | |
---|---|
String |
getFastbootProductType (GetFastbootProductType)
public String getFastbootProductType ()
Returns | |
---|---|
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
GetFastbootProductVariant
public String getFastbootProductVariant ()
Returns | |
---|---|
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getFastbootSerialNumber (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)
Inoffizielles Hilfsprogramm zum Abrufen eines FileEntry
aus einem Nicht-Root-Pfad. PROBLEM: Refaktorieren
FileEntry-Systems, damit sie aus jedem Pfad verfügbar sind. (auch Nicht-Root-Zertifikate).
Parameter | |
---|---|
entry |
FileListingService.FileEntry : Ein FileEntry , das nicht unbedingt Root ist, wie von Ddmlib gefordert. |
Returns | |
---|---|
IFileEntry |
Eine FileEntryWrapper , die den FileEntry darstellt. |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getFoldableStates
publicgetFoldableStates ()
Returns | |
---|---|
|
Ausgabe | |
---|---|
DeviceNotAvailableException |
getIDevice
public IDevice getIDevice ()
Returns | |
---|---|
IDevice |
GetInstalldPackageNames
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 |
getLastErwarteteNeustartzeitMillis
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 |
getLogcatDa
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 |
getMaxNumberOfUsersUnterstützt
public int getMaxNumberOfUsersSupported ()
Returns | |
---|---|
int |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getMonitor
public IDeviceStateMonitor getMonitor ()
Returns | |
---|---|
IDeviceStateMonitor |
GetMountPoint
public String getMountPoint (String mountName)
Parameter | |
---|---|
mountName |
String |
Returns | |
---|---|
String |
MountPointInfo abrufen
public ITestDevice.MountPointInfo getMountPointInfo (String mountpoint)
Parameter | |
---|---|
mountpoint |
String |
Returns | |
---|---|
ITestDevice.MountPointInfo |
Ausgabe | |
---|---|
DeviceNotAvailableException |
MountPointInfo abrufen
publicgetMountPointInfo ()
Returns | |
---|---|
|
Ausgabe | |
---|---|
DeviceNotAvailableException |
getOptions
public TestDeviceOptions getOptions ()
Returns | |
---|---|
TestDeviceOptions |
getPartitionFreeSpace
public long getPartitionFreeSpace (String partition)
Parameter | |
---|---|
partition |
String |
Returns | |
---|---|
long |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getPrimaryUserId (Primäre Nutzer-ID)
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 |
Tombstones abrufen
publicgetTombstones ()
Returns | |
---|---|
|
Ausgabe | |
---|---|
DeviceNotAvailableException |
getTotalMemory
public long getTotalMemory ()
Returns | |
---|---|
long |
getUninstallablePackageNames
publicgetUninstallablePackageNames ()
Returns | |
---|---|
|
Ausgabe | |
---|---|
DeviceNotAvailableException |
getUseFastbootDELETE
public boolean getUseFastbootErase ()
Returns | |
---|---|
boolean |
getUserFlags
public int getUserFlags (int userId)
Parameter | |
---|---|
userId |
int |
Returns | |
---|---|
int |
Ausgabe | |
---|---|
DeviceNotAvailableException |
getUserInfos (Nutzerinformationen abrufen)
publicgetUserInfos ()
Returns | |
---|---|
|
Ausgabe | |
---|---|
DeviceNotAvailableException |
getUserSerialNumber
public int getUserSerialNumber (int userId)
Parameter | |
---|---|
userId |
int |
Returns | |
---|---|
int |
Ausgabe | |
---|---|
DeviceNotAvailableException |
HandleAllocationEvent (HandleAllocationEvent)
public IManagedTestDevice.DeviceEventResponse handleAllocationEvent (DeviceEvent event)
DeviceEvent verarbeiten, wodurch dieses Gerät möglicherweise auf eine neue Zuweisung umgestellt wird Bundesstaat.
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 , wenn der ADB-Root auf dem Gerät aktiviert werden soll
|
isEncryptionSupported
public boolean isEncryptionSupported ()
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
isExecutable (Kann ausgeführt werden)
public boolean isExecutable (String fullPath)
Parameter | |
---|---|
fullPath |
String |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
isFastbootEnabled
public boolean isFastbootEnabled ()
Returns | |
---|---|
boolean |
ist monitorlos
public boolean isHeadless ()
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
isMultiUserSupported
public boolean isMultiUserSupported ()
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
isPackageInstalliert
public boolean isPackageInstalled (String packageName, String userId)
Parameter | |
---|---|
packageName |
String |
userId |
String |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
isPackageInstalliert
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 |
istUserSekundär
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 |
Nutzer auflisten
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 |
Neustart ohne Blockierung
public void nonBlockingReboot ()
Ausgabe | |
---|---|
DeviceNotAvailableException |
postAdbRootAction (Post-AdbRootAction)
public void postAdbRootAction ()
Überschreibt, wenn für das Gerät bestimmte Aktionen nach dem ADB-Root und vor dem Ihr Gerät wieder online ist. Die Standardimplementierung enthält keine Hinzufügungsaktionen. Es kann nicht garantiert werden, dass der adb-Stamm zu diesem Zeitpunkt aktiviert ist.
Ausgabe | |
---|---|
DeviceNotAvailableException |
postAdbUnrootAction
public void postAdbUnrootAction ()
Überschreibt, wenn für das Gerät nach dem Aufheben des Root-Status von ADB und vor dem das Gerät wieder online ist. Die Standardimplementierung enthält keine zusätzlichen Aktionen. Es kann nicht garantiert werden, dass der adb-Root zu diesem Zeitpunkt deaktiviert ist.
Ausgabe | |
---|---|
DeviceNotAvailableException |
PostBoot-Einrichtung
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 |
Pull-Datei
public boolean pullFile (String remoteFilePath, File localFile)
Parameter | |
---|---|
remoteFilePath |
String |
localFile |
File |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
Pull-Datei
public File pullFile (String remoteFilePath)
Parameter | |
---|---|
remoteFilePath |
String |
Returns | |
---|---|
File |
Ausgabe | |
---|---|
DeviceNotAvailableException |
PullFileContent
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 |
Push-Datei
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 |
NeustartIntoBootloader
public void rebootIntoBootloader ()
Ausgabe | |
---|---|
DeviceNotAvailableException |
NeustartIntoFastbootd
public void rebootIntoFastbootd ()
Ausgabe | |
---|---|
DeviceNotAvailableException |
NeustartIntoRecovery
public void rebootIntoRecovery ()
Ausgabe | |
---|---|
DeviceNotAvailableException |
NeustartIntoSideload
public void rebootIntoSideload ()
Ausgabe | |
---|---|
DeviceNotAvailableException |
NeustartIntoSideload
public void rebootIntoSideload (boolean autoReboot)
Parameter | |
---|---|
autoReboot |
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
NeustartUntilOnline
public void rebootUntilOnline ()
Ausgabe | |
---|---|
DeviceNotAvailableException |
NeustartUntilOnline
public void rebootUntilOnline (String reason)
Parameter | |
---|---|
reason |
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
Nutzerbereich neu starten
public void rebootUserspace ()
Ausgabe | |
---|---|
DeviceNotAvailableException |
NeustartUserspaceUntilOnline
public void rebootUserspaceUntilOnline ()
Ausgabe | |
---|---|
DeviceNotAvailableException |
Gerät wiederherstellen
public void recoverDevice ()
Versuche, die Gerätekommunikation wiederherzustellen.
Ausgabe | |
---|---|
DeviceNotAvailableException |
wenn das Gerät nicht mehr verfügbar ist |
remountSystemWritable
public void remountSystemWritable ()
Ausgabe | |
---|---|
DeviceNotAvailableException |
remountVendorWritable (remountVendorWritable)
public void remountVendorWritable ()
Ausgabe | |
---|---|
DeviceNotAvailableException |
Admin entfernen
public boolean removeAdmin (String componentName, int userId)
Parameter | |
---|---|
componentName |
String |
userId |
int |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
Inhaber entfernen
public void removeOwners ()
Ausgabe | |
---|---|
DeviceNotAvailableException |
Nutzer entfernen
public boolean removeUser (int userId)
Parameter | |
---|---|
userId |
int |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
Zurücksetzen vonContentProvider-Einrichtung
public void resetContentProviderSetup ()
Setzen Sie die Markierung für die Einrichtung des Contentanbieters zurück, um ihn 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)
Injiziertes IConfiguration
in Gebrauch.
Parameter | |
---|---|
configuration |
IConfiguration |
Datum festlegen
public void setDate (Date date)
Parameter | |
---|---|
date |
Date |
Ausgabe | |
---|---|
DeviceNotAvailableException |
Geräteinhaber festlegen
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)
Legen Sie für den Emulator SizeLimitedOutputStream
fest, um die Ausgabe zu protokollieren
Parameter | |
---|---|
output |
SizeLimitedOutputStream : zum Protokollieren der Ausgabe
|
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 |
Wiederherstellung festlegen
public void setRecovery (IDeviceRecovery recovery)
Parameter | |
---|---|
recovery |
IDeviceRecovery |
Wiederherstellungsmodus festlegen
public void setRecoveryMode (ITestDevice.RecoveryMode mode)
Parameter | |
---|---|
mode |
ITestDevice.RecoveryMode |
Einstellung festlegen
public void setSetting (String namespace, String key, String value)
Parameter | |
---|---|
namespace |
String |
key |
String |
value |
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
Einstellung festlegen
public void setSetting (int userId, String namespace, String key, String value)
Parameter | |
---|---|
userId |
int |
namespace |
String |
key |
String |
value |
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
Schnellstart-Funktion verwenden
public void setUseFastbootErase (boolean useFastbootErase)
Parameter | |
---|---|
useFastbootErase |
boolean |
startLogcat
public void startLogcat ()
startUser (Startnutzer)
public boolean startUser (int userId)
Parameter | |
---|---|
userId |
int |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
startUser (Startnutzer)
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 |
Wechsel zu AdBUsb
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 |
Dateien synchronisieren
public boolean syncFiles (File localFileDir, String deviceFilePath)
Parameter | |
---|---|
localFileDir |
File |
deviceFilePath |
String |
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
TakeBugreport
public Bugreport takeBugreport ()
Returns | |
---|---|
Bugreport |
Entschlüsseln
public boolean unencryptDevice ()
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
Deinstallationspaket
public String uninstallPackage (String packageName)
Parameter | |
---|---|
packageName |
String |
Returns | |
---|---|
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
deinstallierenPackageForUser
public String uninstallPackageForUser (String packageName, int userId)
Parameter | |
---|---|
packageName |
String |
userId |
int |
Returns | |
---|---|
String |
Ausgabe | |
---|---|
DeviceNotAvailableException |
Gerät entsperren
public boolean unlockDevice ()
Returns | |
---|---|
boolean |
Ausgabe | |
---|---|
DeviceNotAvailableException |
WartefürBootAbgeschlossen
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 |
WartefürGerätInSideload
public boolean waitForDeviceInSideload (long waitTime)
Parameter | |
---|---|
waitTime |
long |
Returns | |
---|---|
boolean |
WaitForDeviceNotAvailable
public boolean waitForDeviceNotAvailable (long waitTime)
Parameter | |
---|---|
waitTime |
long |
Returns | |
---|---|
boolean |
WarteFürGerätOnline
public void waitForDeviceOnline ()
Ausgabe | |
---|---|
DeviceNotAvailableException |
WarteFürGerätOnline
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 |
neustartgerätaktion erstellen
protected NativeDevice.RebootDeviceAction createRebootDeviceAction (NativeDevice.RebootMode rebootMode, String reason)
Erstellen Sie eine RebootDeviceAction
, die beim Ausführen eines Neustarts verwendet werden soll.
Parameter | |
---|---|
rebootMode |
NativeDevice.RebootMode : ein Modus dieses Neustarts. |
reason |
String : für diesen Neustart. |
Returns | |
---|---|
NativeDevice.RebootDeviceAction |
die erstellte RebootDeviceAction .
|
doAdbNeustart
protected void doAdbReboot (NativeDevice.RebootMode rebootMode, String reason)
Starten Sie ADB-Neustart.
Parameter | |
---|---|
rebootMode |
NativeDevice.RebootMode : ein Modus dieses Neustarts. |
reason |
String : für diesen Neustart. |
Ausgabe | |
---|---|
DeviceNotAvailableException |
KeepRuntimePermissionSupported
protected void ensureRuntimePermissionSupported ()
Hilfsmethode zum Auslösen einer Ausnahme, 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 (GetRunUtil)
protected IRunUtil getRunUtil ()
Rufen Sie die zu verwendende RunUtil
-Instanz ab.
Returns | |
---|---|
IRunUtil |
InterneGetProperty
protected String internalGetProperty (String propName, String fastbootVar, String description)
Ruft standardmäßig eine Geräteeigenschaft aus dem ddmlib-Cache ab und greift dabei entweder auf "adb" zu Shell getprop" oder "fastboot getvar", je nachdem, ob sich das Gerät in Fastboot befindet oder nicht.
Parameter | |
---|---|
propName |
String : Name des Geräteattributs, wie von „adb shell getprop“ zurückgegeben |
fastbootVar |
String : Der Name der entsprechenden Fastboot-Variable, die abgefragt werden soll. wenn null ,
Fastboot-Abfrage wird nicht versucht, |
description |
String : Eine einfache Beschreibung der Variable. Der erste Buchstabe muss großgeschrieben werden. |
Returns | |
---|---|
String |
Ein String, der den Wert des angegebenen Attributs enthält und möglicherweise null oder leer ist
|
Ausgabe | |
---|---|
DeviceNotAvailableException |
istNeuer
protected boolean isNewer (File localFile, IFileEntry entry)
Gibt true
zurück, wenn die lokale Datei neuer als die Remote-Datei ist. IFileEntry
=
minutengenau. Bei identischen Zeiten gilt die Datei als neuer.
Parameter | |
---|---|
localFile |
File |
entry |
IFileEntry |
Returns | |
---|---|
boolean |
Geräteaktion ausführen
protected boolean performDeviceAction (String actionDescription, com.android.tradefed.device.NativeDevice.DeviceAction action, int retryAttempts)
Führt eine Aktion auf diesem Gerät aus. Versuche, das Gerät wiederherzustellen und den Befehl optional zu wiederholen wenn die Aktion fehlschlägt.
Parameter | |
---|---|
actionDescription |
String : eine kurze Beschreibung der auszuführenden Aktion. Für Logging verwendet
. |
action |
com.android.tradefed.device.NativeDevice.DeviceAction : die auszuführende Aktion |
retryAttempts |
int : Der Wiederholungsversuch, wenn eine Aktion fehlschlägt, aber
Wiederherstellung erfolgreich |
Returns | |
---|---|
boolean |
true , wenn die Aktion erfolgreich ausgeführt wurde |
Ausgabe | |
---|---|
DeviceNotAvailableException |
wenn der Wiederherstellungsversuch fehlschlägt oder die maximale Anzahl von Versuchen ohne Erfolg |
postAdbNeustart
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 jedem Gerätetyp (AndroidNativeDevice, TestDevice), diese Methode für nach der Boot-Einrichtung.
Ausgabe | |
---|---|
DeviceNotAvailableException |
Uhr einstellen
protected void setClock (Clock clock)
Legen Sie die zu verwendende Uhrinstanz fest.
Parameter | |
---|---|
clock |
Clock |
setLogStartDelay
protected void setLogStartDelay (int delay)
Legt die Wartezeit in ms fest, bevor die Logcat-Erfassung für ein Onlinegerät gestartet wird.
Parameter | |
---|---|
delay |
int : die Verzögerung in ms
|
WaitForDeviceNotAvailable
protected void waitForDeviceNotAvailable (String operationDesc, long time)
Parameter | |
---|---|
operationDesc |
String |
time |
long |