Zagnieżdżone klasy |
---|
class | NativeDevice.AdbAction Akcja DeviceAction służąca do uruchamiania polecenia „adb…” systemu operacyjnego. |
class | NativeDevice.AdbShellAction |
class | NativeDevice.RebootDeviceAction DeviceAction służąca do ponownego uruchomienia urządzenia. |
enum | NativeDevice.RebootMode Tryb ponownego uruchomienia. |
Metody publiczne |
---|
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 () Dziennik zawierający wszystkie dzienniki executeShellCommand(String) . |
long | getExternalStoreFreeSpace () |
String | getFastbootPath () |
String | getFastbootProductType () |
String | getFastbootProductVariant () |
String | getFastbootSerialNumber () |
String | getFastbootVariable (String variableName) |
String | getFastbootVersion () |
IFileEntry | getFileEntry (String path) |
IFileEntry | getFileEntry (FileListingService.FileEntry entry) Nieoficjalny pomocnik do uzyskania FileEntry ze ścieżki innej niż root. |
| getFoldableStates () |
IDevice | getIDevice () |
| getInstalledPackageNames () |
long | getIntProperty (String name, long defaultValue) |
String | getIpAddress () |
KeyguardControllerState | getKeyguardState () |
long | getLastExpectedRebootTimeMillis () |
int | getLaunchApiLevel () |
InputStreamSource | getLogcat () |
InputStreamSource | getLogcat (int maxBytes) |
InputStreamSource | getLogcatDump () |
InputStreamSource | getLogcatSince (long date) |
String | getMacAddress () |
| getMainlineModuleInfo () |
int | getMaxNumberOfRunningUsersSupported () |
int | getMaxNumberOfUsersSupported () |
IDeviceStateMonitor | getMonitor () |
String | getMountPoint (String mountName) |
ITestDevice.MountPointInfo | getMountPointInfo (String mountpoint) |
| getMountPointInfo () |
TestDeviceOptions | getOptions () |
long | getPartitionFreeSpace (String partition) |
Integer | getPrimaryUserId () |
ProcessInfo | getProcessByName (String processName) |
String | getProcessPid (String process) |
String | getProductType () |
String | getProductVariant () |
String | getProperty (String name) |
ITestDevice.RecoveryMode | getRecoveryMode () |
InputStreamSource | getScreenshot (String format) |
InputStreamSource | getScreenshot (long displayId) |
InputStreamSource | getScreenshot (String format, boolean rescale) |
InputStreamSource | getScreenshot () |
String | getSerialNumber () |
String | getSetting (int userId, String namespace, String key) |
String | getSetting (String namespace, String key) |
String | getSimOperator () |
String | getSimState () |
| getTombstones () |
long | getTotalMemory () |
| getUninstallablePackageNames () |
boolean | getUseFastbootErase () |
int | getUserFlags (int userId) |
| getUserInfos () |
int | getUserSerialNumber (int userId) |
IManagedTestDevice.DeviceEventResponse | handleAllocationEvent (DeviceEvent event) Przetwórz zdarzenie DeviceEvent, które może, ale nie musi, przenieść to urządzenie do nowego stanu alokacji. |
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 () Zastąp, jeśli urządzenie wymaga podjęcia określonych działań po rootowaniu adb i zanim urządzenie wróci do trybu online. |
void | postAdbUnrootAction () Zastąp, jeśli urządzenie wymaga podjęcia określonych działań po unrootowaniu adb i zanim urządzenie wróci do trybu online. |
void | postBootSetup () |
void | postInvocationTearDown (Throwable exception) |
void | preInvocationSetup (IBuildInfo info, MultiMap<String, String> attributes) |
boolean | pullDir (String deviceFilePath, File localDir) |
boolean | pullFile (String remoteFilePath, File localFile) |
File | pullFile (String remoteFilePath) |
String | pullFileContents (String remoteFilePath) |
File | pullFileFromExternal (String remoteFilePath) |
boolean | pushDir (File localFileDir, String deviceFilePath, excludedDirectories) pushDir (File localFileDir, String deviceFilePath, excludedDirectories) |
boolean | pushDir (File localFileDir, String deviceFilePath) |
boolean | pushFile (File localFile, String remoteFilePath) |
boolean | pushString (String contents, String remoteFilePath) |
void | reboot (String reason) |
void | reboot () |
void | rebootIntoBootloader () |
void | rebootIntoFastbootd () |
void | rebootIntoRecovery () |
void | rebootIntoSideload () |
void | rebootIntoSideload (boolean autoReboot) |
void | rebootUntilOnline () |
void | rebootUntilOnline (String reason) |
void | rebootUserspace () |
void | rebootUserspaceUntilOnline () |
void | recoverDevice () Próbuje odzyskać komunikację z urządzeniem. |
void | remountSystemWritable () |
void | remountVendorWritable () |
boolean | removeAdmin (String componentName, int userId) |
void | removeOwners () |
boolean | removeUser (int userId) |
void | resetContentProviderSetup () Zresetuj flagę konfiguracji dostawcy treści, aby uruchomić ją ponownie. |
boolean | runInstrumentationTests (IRemoteAndroidTestRunner runner, ITestLifeCycleReceiver... listeners) |
boolean | runInstrumentationTests (IRemoteAndroidTestRunner runner, listeners) runInstrumentationTests (IRemoteAndroidTestRunner runner, listeners) |
boolean | runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, ITestLifeCycleReceiver... listeners) |
boolean | runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, listeners) runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, listeners) |
void | setConfiguration ( IConfiguration configuration) Wstrzykuje używaną IConfiguration . |
void | setDate (Date date) |
boolean | setDeviceOwner (String componentName, int userId) |
void | setDeviceState (TestDeviceState deviceState) |
void | setEmulatorOutputStream ( SizeLimitedOutputStream output) W przypadku emulatora ustaw SizeLimitedOutputStream aby logować dane wyjściowe |
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) |
Metody chronione |
---|
void | checkApiLevelAgainst (String feature, int strictMinLevel) |
NativeDevice.RebootDeviceAction | createRebootDeviceAction ( NativeDevice.RebootMode rebootMode, String reason) Utwórz RebootDeviceAction , która będzie używana podczas wykonywania akcji ponownego uruchomienia. |
void | doAdbReboot ( NativeDevice.RebootMode rebootMode, String reason) Wykonaj ponowne uruchomienie adb. |
void | ensureRuntimePermissionSupported () metoda pomocnicza, aby zgłosić wyjątek, jeśli uprawnienia środowiska wykonawczego nie są obsługiwane |
InputStreamSource | getBugreportInternal () |
File | getBugreportzInternal () Metoda wewnętrznego pomocnika, aby uzyskać plik zip raportu o błędach jako ERROR(/File) . |
IRunUtil | getRunUtil () Pobierz instancję RunUtil do użycia. |
String | internalGetProperty (String propName, String fastbootVar, String description) Pobierz właściwość urządzenia, domyślnie z pamięci podręcznej ddmlib i wróć do `adb Shell getprop` lub `fastboot getvar`, w zależności od tego, czy urządzenie znajduje się w trybie Fastboot, czy nie. |
boolean | isNewer (File localFile, IFileEntry entry) Zwróć wartość true , jeśli plik lokalny jest nowszy niż plik zdalny. |
boolean | performDeviceAction (String actionDescription, com.android.tradefed.device.NativeDevice.DeviceAction action, int retryAttempts) Wykonuje akcję na tym urządzeniu. |
void | postAdbReboot () Możliwe dodatkowe działania, które można podjąć po ponownym uruchomieniu. |
void | prePostBootSetup () Umożliwia każdemu typowi urządzenia (AndroidNativeDevice, TestDevice) zastąpienie tej metody w przypadku określonej konfiguracji po rozruchu. |
void | setClock (Clock clock) Ustaw instancję Clock do użycia. |
void | setLogStartDelay (int delay) Ustawia czas oczekiwania w ms przed rozpoczęciem przechwytywania logcat dla urządzenia online. |
void | waitForDeviceNotAvailable (String operationDesc, long time) |
Stałe
NIEPRAWIDŁOWY IDENTYFIKATOR UŻYTKOWNIKA
public static final int INVALID_USER_ID
Wartość zwrócona w przypadku nieprawidłowego/nieodnalezionego identyfikatora użytkownika: UserHandle zdefiniował wartość -10000
Wartość stała: -10000 (0xffffd8f0)
MAX_HOST_DEVICE_TIME_OFFSET
protected static final long MAX_HOST_DEVICE_TIME_OFFSET
Wartość stała: 5000 (0x0000000000001388)
MAX_RETRY_ATTEMPTS
protected static final int MAX_RETRY_ATTEMPTS
domyślna liczba ponownych prób wykonania polecenia
Wartość stała: 2 (0x00000002)
Pola
KARTA SD
protected static final String SD_CARD
STORAGE_EMULATED
protected static final String STORAGE_EMULATED
mOpcje
protected TestDeviceOptions mOptions
mStateMonitor
protected final IDeviceStateMonitor mStateMonitor
Konstruktorzy publiczni
Urządzenie natywne
public NativeDevice (IDevice device,
IDeviceStateMonitor stateMonitor,
IDeviceMonitor allocationMonitor)
Tworzy TestDevice
.
Parametry |
---|
device | IDevice : powiązane IDevice |
stateMonitor | IDeviceStateMonitor : mechanizm IDeviceStateMonitor do użycia |
allocationMonitor | IDeviceMonitor : IDeviceMonitor informujący o zmianach stanu alokacji. Może mieć wartość zerową |
Metody publiczne
sprawdźApiLevelAgainstNextRelease
public boolean checkApiLevelAgainstNextRelease (int strictMinLevel)
Parametry |
---|
strictMinLevel | int |
Rzuca |
---|
DeviceNotAvailableException | |
sprawdź Łączność
public boolean checkConnectivity ()
Rzuca |
---|
DeviceNotAvailableException | |
wyczyść okno dialogowe błędów
public boolean clearErrorDialogs ()
Rzuca |
---|
DeviceNotAvailableException | |
clearLastConnectedWifiNetwork
public void clearLastConnectedWifiNetwork ()
wyczyśćLogcat
public void clearLogcat ()
połącz się z siecią Wi-Fi
public boolean connectToWifiNetwork (String wifiSsid,
String wifiPsk)
Parametry |
---|
wifiSsid | String |
wifiPsk | String |
Rzuca |
---|
DeviceNotAvailableException | |
połącz się z siecią Wi-Fi
public boolean connectToWifiNetwork (String wifiSsid,
String wifiPsk,
boolean scanSsid)
Parametry |
---|
wifiSsid | String |
wifiPsk | String |
scanSsid | boolean |
Rzuca |
---|
DeviceNotAvailableException | |
połącz się z siecią Wifi w razie potrzeby
public boolean connectToWifiNetworkIfNeeded (String wifiSsid,
String wifiPsk,
boolean scanSsid)
Parametry |
---|
wifiSsid | String |
wifiPsk | String |
scanSsid | boolean |
Rzuca |
---|
DeviceNotAvailableException | |
połącz się z siecią Wifi w razie potrzeby
public boolean connectToWifiNetworkIfNeeded (String wifiSsid,
String wifiPsk)
Parametry |
---|
wifiSsid | String |
wifiPsk | String |
Rzuca |
---|
DeviceNotAvailableException | |
Stwórz użytkownika
public int createUser (String name,
boolean guest,
boolean ephemeral)
Parametry |
---|
name | String |
guest | boolean |
ephemeral | boolean |
Rzuca |
---|
DeviceNotAvailableException | |
Stwórz użytkownika
public int createUser (String name)
Rzuca |
---|
DeviceNotAvailableException | |
utwórzUserNoThrow
public int createUserNoThrow (String name)
Rzuca |
---|
DeviceNotAvailableException | |
usunąć plik
public void deleteFile (String deviceFilePath)
Parametry |
---|
deviceFilePath | String |
Rzuca |
---|
DeviceNotAvailableException | |
urządzenieSoft uruchomiono ponownie
public boolean deviceSoftRestarted (ProcessInfo prevSystemServerProcess)
Parametry |
---|
prevSystemServerProcess | ProcessInfo |
Rzuca |
---|
DeviceNotAvailableException | |
urządzenieSoftRestartedSince
public boolean deviceSoftRestartedSince (long utcEpochTime,
TimeUnit timeUnit)
Parametry |
---|
utcEpochTime | long |
timeUnit | TimeUnit |
Rzuca |
---|
DeviceNotAvailableException | |
wyłączAdbRoot
public boolean disableAdbRoot ()
Rzuca |
---|
DeviceNotAvailableException | |
wyłącz Keyguarda
public void disableKeyguard ()
Rzuca |
---|
DeviceNotAvailableException | |
wyłącz NetworkMonitor
public boolean disableNetworkMonitor ()
Rzuca |
---|
DeviceNotAvailableException | |
rozłącz się z Wi-Fi
public boolean disconnectFromWifi ()
Rzuca |
---|
DeviceNotAvailableException | |
czy plik istnieje
public boolean doesFileExist (String deviceFilePath)
Parametry |
---|
deviceFilePath | String |
Rzuca |
---|
DeviceNotAvailableException | |
sterta zrzutu
public File dumpHeap (String process,
String devicePath)
Parametry |
---|
process | String |
devicePath | String |
Rzuca |
---|
DeviceNotAvailableException | |
włączAdbRoot
public boolean enableAdbRoot ()
Rzuca |
---|
DeviceNotAvailableException | |
włączMonitor sieci
public boolean enableNetworkMonitor ()
Rzuca |
---|
DeviceNotAvailableException | |
zaszyfruj urządzenie
public boolean encryptDevice (boolean inplace)
Parametry |
---|
inplace | boolean |
Rzuca |
---|
DeviceNotAvailableException | |
wykonaj polecenie Adb
public String executeAdbCommand (long timeout,
String... cmdArgs)
Parametry |
---|
timeout | long |
cmdArgs | String |
Rzuca |
---|
DeviceNotAvailableException | |
wykonaj polecenie Adb
public String executeAdbCommand (String... cmdArgs)
Rzuca |
---|
DeviceNotAvailableException | |
wykonaj polecenie Fastboot
public CommandResult executeFastbootCommand (String... cmdArgs)
Rzuca |
---|
DeviceNotAvailableException | |
wykonaj polecenie Fastboot
public CommandResult executeFastbootCommand (long timeout,
String... cmdArgs)
Parametry |
---|
timeout | long |
cmdArgs | String |
Rzuca |
---|
DeviceNotAvailableException | |
wykonaj polecenie LongFastboot
public CommandResult executeLongFastbootCommand (String... cmdArgs)
Rzuca |
---|
DeviceNotAvailableException | |
wykonaj polecenie Shell
public String executeShellCommand (String command)
Rzuca |
---|
DeviceNotAvailableException | |
wykonaj polecenie Shell
public void executeShellCommand (String command,
IShellOutputReceiver receiver,
long maxTimeToOutputShellResponse,
TimeUnit timeUnit,
int retryAttempts)
Parametry |
---|
command | String |
receiver | IShellOutputReceiver |
maxTimeToOutputShellResponse | long |
timeUnit | TimeUnit |
retryAttempts | int |
Rzuca |
---|
DeviceNotAvailableException | |
wykonaj polecenie Shell
public void executeShellCommand (String command,
IShellOutputReceiver receiver,
long maxTimeoutForCommand,
long maxTimeToOutputShellResponse,
TimeUnit timeUnit,
int retryAttempts)
Parametry |
---|
command | String |
receiver | IShellOutputReceiver |
maxTimeoutForCommand | long |
maxTimeToOutputShellResponse | long |
timeUnit | TimeUnit |
retryAttempts | int |
Rzuca |
---|
DeviceNotAvailableException | |
wykonaj polecenie Shell
public void executeShellCommand (String command,
IShellOutputReceiver receiver)
Parametry |
---|
command | String |
receiver | IShellOutputReceiver |
Rzuca |
---|
DeviceNotAvailableException | |
wykonaj polecenie ShellV2
public CommandResult executeShellV2Command (String cmd)
Rzuca |
---|
DeviceNotAvailableException | |
wykonaj polecenie ShellV2
public CommandResult executeShellV2Command (String cmd,
OutputStream pipeToOutput)
Parametry |
---|
cmd | String |
pipeToOutput | OutputStream |
Rzuca |
---|
DeviceNotAvailableException | |
wykonaj polecenie ShellV2
public CommandResult executeShellV2Command (String cmd,
File pipeAsInput)
Parametry |
---|
cmd | String |
pipeAsInput | File |
Rzuca |
---|
DeviceNotAvailableException | |
wykonaj polecenie ShellV2
public CommandResult executeShellV2Command (String cmd,
long maxTimeoutForCommand,
TimeUnit timeUnit,
int retryAttempts)
Parametry |
---|
cmd | String |
maxTimeoutForCommand | long |
timeUnit | TimeUnit |
retryAttempts | int |
Rzuca |
---|
DeviceNotAvailableException | |
wykonaj polecenie ShellV2
public CommandResult executeShellV2Command (String cmd,
long maxTimeoutForCommand,
TimeUnit timeUnit)
Parametry |
---|
cmd | String |
maxTimeoutForCommand | long |
timeUnit | TimeUnit |
Rzuca |
---|
DeviceNotAvailableException | |
wykonaj polecenie ShellV2
public CommandResult executeShellV2Command (String cmd,
File pipeAsInput,
OutputStream pipeToOutput,
long maxTimeoutForCommand,
TimeUnit timeUnit,
int retryAttempts)
Parametry |
---|
cmd | String |
pipeAsInput | File |
pipeToOutput | OutputStream |
maxTimeoutForCommand | long |
timeUnit | TimeUnit |
retryAttempts | int |
Rzuca |
---|
DeviceNotAvailableException | |
wykonaj polecenie ShellV2
public CommandResult executeShellV2Command (String cmd,
File pipeAsInput,
OutputStream pipeToOutput,
OutputStream pipeToError,
long maxTimeoutForCommand,
TimeUnit timeUnit,
int retryAttempts)
Parametry |
---|
cmd | String |
pipeAsInput | File |
pipeToOutput | OutputStream |
pipeToError | OutputStream |
maxTimeoutForCommand | long |
timeUnit | TimeUnit |
retryAttempts | int |
Rzuca |
---|
DeviceNotAvailableException | |
partycja fastbootWipe
public CommandResult fastbootWipePartition (String partition)
Parametry |
---|
partition | String |
Rzuca |
---|
DeviceNotAvailableException | |
pobierz ActiveApexy
public getActiveApexes ()
Rzuca |
---|
DeviceNotAvailableException | |
pobierzWszystkieUstawienia
public getAllSettings (String namespace)
Parametry |
---|
namespace | String |
Rzuca |
---|
DeviceNotAvailableException | |
pobierz stan alokacji
public DeviceAllocationState getAllocationState ()
Zwroty |
---|
DeviceAllocationState | |
pobierz identyfikator Androida
public String getAndroidId (int userId)
Rzuca |
---|
DeviceNotAvailableException | |
pobierz identyfikatory Androida
public getAndroidIds ()
Rzuca |
---|
DeviceNotAvailableException | |
pobierzApiLevel
public int getApiLevel ()
Rzuca |
---|
DeviceNotAvailableException | |
pobierz informacje o pakiecie aplikacji
public PackageInfo getAppPackageInfo (String packageName)
Parametry |
---|
packageName | String |
Rzuca |
---|
DeviceNotAvailableException | |
pobierzInformacje o pakiecie aplikacji
public getAppPackageInfos ()
Rzuca |
---|
DeviceNotAvailableException | |
pobierz wersję pasma podstawowego
public String getBasebandVersion ()
Rzuca |
---|
DeviceNotAvailableException | |
pobierz baterię
public Integer getBattery ()
getBooleanWłaściwość
public boolean getBooleanProperty (String name,
boolean defaultValue)
Parametry |
---|
name | String |
defaultValue | boolean |
Rzuca |
---|
DeviceNotAvailableException | |
pobierz historię rozruchu
public getBootHistory ()
Rzuca |
---|
DeviceNotAvailableException | |
getBootHistorySince
public getBootHistorySince (long utcEpochTime,
TimeUnit timeUnit)
Parametry |
---|
utcEpochTime | long |
timeUnit | TimeUnit |
Rzuca |
---|
DeviceNotAvailableException | |
pobierz wersję Bootloadera
public String getBootloaderVersion ()
Rzuca |
---|
DeviceNotAvailableException | |
pobierz raport błędów
public InputStreamSource getBugreport ()
pobierz Bugreportz
public InputStreamSource getBugreportz ()
pobierzBuildAlias
public String getBuildAlias ()
Rzuca |
---|
DeviceNotAvailableException | |
pobierzBuildFlavor
public String getBuildFlavor ()
Rzuca |
---|
DeviceNotAvailableException | |
getBuildId
public String getBuildId ()
Rzuca |
---|
DeviceNotAvailableException | |
getBuildSigningKeys
public String getBuildSigningKeys ()
Rzuca |
---|
DeviceNotAvailableException | |
getCachedDeviceDescriptor
public DeviceDescriptor getCachedDeviceDescriptor ()
zdobądź dzieci
public String[] getChildren (String path)
Rzuca |
---|
DeviceNotAvailableException | |
getCurrentFoldableState
public DeviceFoldableState getCurrentFoldableState ()
Zwroty |
---|
DeviceFoldableState | |
Rzuca |
---|
DeviceNotAvailableException | |
pobierz bieżącego użytkownika
public int getCurrentUser ()
Rzuca |
---|
DeviceNotAvailableException | |
pobierz klasę urządzenia
public String getDeviceClass ()
pobierzDatęUrządzenia
public long getDeviceDate ()
Rzuca |
---|
DeviceNotAvailableException | |
pobierzDeviceDescriptor
public DeviceDescriptor getDeviceDescriptor ()
pobierz stan urządzenia
public TestDeviceState getDeviceState ()
pobierzDeviceTimeOffset
public long getDeviceTimeOffset (Date date)
Rzuca |
---|
DeviceNotAvailableException | |
pobierz wyjście emulatora
public InputStreamSource getEmulatorOutput ()
pobierz proces emulatora
public Process getEmulatorProcess ()
getExecuteShellCommandLog
public final File getExecuteShellCommandLog ()
Dziennik zawierający wszystkie dzienniki executeShellCommand(String)
.
getExternalStoreFreeSpace
public long getExternalStoreFreeSpace ()
Rzuca |
---|
DeviceNotAvailableException | |
pobierzFastbootPath
public String getFastbootPath ()
getFastbootProductType
public String getFastbootProductType ()
Rzuca |
---|
DeviceNotAvailableException | |
getFastbootProductVariant
public String getFastbootProductVariant ()
Rzuca |
---|
DeviceNotAvailableException | |
getFastbootSerialNumber
public String getFastbootSerialNumber ()
pobierz zmienną Fastboot
public String getFastbootVariable (String variableName)
Parametry |
---|
variableName | String |
Rzuca |
---|
DeviceNotAvailableException | |
pobierz wersję Fastboot
public String getFastbootVersion ()
pobierz plikEntry
public IFileEntry getFileEntry (String path)
Rzuca |
---|
DeviceNotAvailableException | |
pobierz plikEntry
public IFileEntry getFileEntry (FileListingService.FileEntry entry)
Nieoficjalny pomocnik do uzyskania FileEntry
ze ścieżki innej niż root. FIXME: Zrefaktoryzuj system FileEntry, aby był dostępny z dowolnej ścieżki. (nawet bez roota).
Parametry |
---|
entry | FileListingService.FileEntry : FileEntry niekoniecznie musi być rootem, jak wymaga tego Ddmlib. |
Rzuca |
---|
DeviceNotAvailableException | |
getFoldableStates
public getFoldableStates ()
Rzuca |
---|
DeviceNotAvailableException | |
pobierzIDevice
public IDevice getIDevice ()
getInstalledPackageNames
public getInstalledPackageNames ()
Rzuca |
---|
DeviceNotAvailableException | |
pobierzIntProperty
public long getIntProperty (String name,
long defaultValue)
Parametry |
---|
name | String |
defaultValue | long |
Rzuca |
---|
DeviceNotAvailableException | |
pobierz adres IP
public String getIpAddress ()
Rzuca |
---|
DeviceNotAvailableException | |
pobierzKeyguardState
public KeyguardControllerState getKeyguardState ()
Zwroty |
---|
KeyguardControllerState | |
Rzuca |
---|
DeviceNotAvailableException | |
getLastExpectedRebootTimeMillis
public long getLastExpectedRebootTimeMillis ()
getLaunchApiLevel
public int getLaunchApiLevel ()
Rzuca |
---|
DeviceNotAvailableException | |
pobierzLogcat
public InputStreamSource getLogcat ()
pobierzLogcat
public InputStreamSource getLogcat (int maxBytes)
pobierz LogcatDump
public InputStreamSource getLogcatDump ()
pobierzLogcatSince
public InputStreamSource getLogcatSince (long date)
pobierz adres Mac
public String getMacAddress ()
pobierzMainlineModuleInfo
public getMainlineModuleInfo ()
Rzuca |
---|
DeviceNotAvailableException | |
public int getMaxNumberOfRunningUsersSupported ()
Rzuca |
---|
DeviceNotAvailableException | |
public int getMaxNumberOfUsersSupported ()
Rzuca |
---|
DeviceNotAvailableException | |
pobierzMonitor
public IDeviceStateMonitor getMonitor ()
Zwroty |
---|
IDeviceStateMonitor | |
pobierzMountPoint
public String getMountPoint (String mountName)
Parametry |
---|
mountName | String |
pobierzMountPointInfo
public ITestDevice.MountPointInfo getMountPointInfo (String mountpoint)
Parametry |
---|
mountpoint | String |
Zwroty |
---|
ITestDevice.MountPointInfo | |
Rzuca |
---|
DeviceNotAvailableException | |
pobierzMountPointInfo
public getMountPointInfo ()
Rzuca |
---|
DeviceNotAvailableException | |
pobierzOpcje
public TestDeviceOptions getOptions ()
getPartitionFreeSpace
public long getPartitionFreeSpace (String partition)
Parametry |
---|
partition | String |
Rzuca |
---|
DeviceNotAvailableException | |
pobierz identyfikator użytkownika podstawowego
public Integer getPrimaryUserId ()
Rzuca |
---|
DeviceNotAvailableException | |
getProcessByName
public ProcessInfo getProcessByName (String processName)
Parametry |
---|
processName | String |
Rzuca |
---|
DeviceNotAvailableException | |
pobierzPidProcesu
public String getProcessPid (String process)
Rzuca |
---|
DeviceNotAvailableException | |
pobierz typ produktu
public String getProductType ()
Rzuca |
---|
DeviceNotAvailableException | |
pobierzWariantProduktu
public String getProductVariant ()
Rzuca |
---|
DeviceNotAvailableException | |
pobierzWłaściwość
public String getProperty (String name)
Rzuca |
---|
DeviceNotAvailableException | |
pobierz tryb odzyskiwania
public ITestDevice.RecoveryMode getRecoveryMode ()
Zwroty |
---|
ITestDevice.RecoveryMode | |
pobierz zrzut ekranu
public InputStreamSource getScreenshot (String format)
Rzuca |
---|
DeviceNotAvailableException | |
pobierz zrzut ekranu
public InputStreamSource getScreenshot (long displayId)
Rzuca |
---|
DeviceNotAvailableException | |
pobierz zrzut ekranu
public InputStreamSource getScreenshot (String format,
boolean rescale)
Parametry |
---|
format | String |
rescale | boolean |
Rzuca |
---|
DeviceNotAvailableException | |
pobierz zrzut ekranu
public InputStreamSource getScreenshot ()
Rzuca |
---|
DeviceNotAvailableException | |
pobierz numer seryjny
public String getSerialNumber ()
pobierz ustawienie
public String getSetting (int userId,
String namespace,
String key)
Parametry |
---|
userId | int |
namespace | String |
key | String |
Rzuca |
---|
DeviceNotAvailableException | |
pobierz ustawienie
public String getSetting (String namespace,
String key)
Parametry |
---|
namespace | String |
key | String |
Rzuca |
---|
DeviceNotAvailableException | |
pobierz SimOperatora
public String getSimOperator ()
pobierzSimState
public String getSimState ()
zdobądź nagrobki
public getTombstones ()
Rzuca |
---|
DeviceNotAvailableException | |
pobierz TotalMemory
public long getTotalMemory ()
getUninstallablePackageNames
public getUninstallablePackageNames ()
Rzuca |
---|
DeviceNotAvailableException | |
getUseFastbootErase
public boolean getUseFastbootErase ()
pobierz flagi użytkownika
public int getUserFlags (int userId)
Rzuca |
---|
DeviceNotAvailableException | |
pobierz informacje o użytkowniku
public getUserInfos ()
Rzuca |
---|
DeviceNotAvailableException | |
pobierz numer seryjny użytkownika
public int getUserSerialNumber (int userId)
Rzuca |
---|
DeviceNotAvailableException | |
uchwytAllocationEvent
public IManagedTestDevice.DeviceEventResponse handleAllocationEvent (DeviceEvent event)
Przetwórz zdarzenie DeviceEvent, które może, ale nie musi, przenieść to urządzenie do nowego stanu alokacji.
Parametry |
---|
event | DeviceEvent |
Zwroty |
---|
IManagedTestDevice.DeviceEventResponse | |
ma funkcję
public boolean hasFeature (String feature)
Rzuca |
---|
DeviceNotAvailableException | |
zainstaluj pakiet
public String installPackage (File packageFile,
boolean reinstall,
String... extraArgs)
Parametry |
---|
packageFile | File |
reinstall | boolean |
extraArgs | String |
Rzuca |
---|
DeviceNotAvailableException | |
zainstaluj pakiet
public String installPackage (File packageFile,
boolean reinstall,
boolean grantPermissions,
String... extraArgs)
Parametry |
---|
packageFile | File |
reinstall | boolean |
grantPermissions | boolean |
extraArgs | String |
Rzuca |
---|
DeviceNotAvailableException | |
zainstalujPakietDlaUżytkownika
public String installPackageForUser (File packageFile,
boolean reinstall,
int userId,
String... extraArgs)
Parametry |
---|
packageFile | File |
reinstall | boolean |
userId | int |
extraArgs | String |
Rzuca |
---|
DeviceNotAvailableException | |
zainstalujPakietDlaUżytkownika
public String installPackageForUser (File packageFile,
boolean reinstall,
boolean grantPermissions,
int userId,
String... extraArgs)
Parametry |
---|
packageFile | File |
reinstall | boolean |
grantPermissions | boolean |
userId | int |
extraArgs | String |
Rzuca |
---|
DeviceNotAvailableException | |
jestAdbRoot
public boolean isAdbRoot ()
Rzuca |
---|
DeviceNotAvailableException | |
isAdbTcp
public boolean isAdbTcp ()
isAppEnumerationSupported
public boolean isAppEnumerationSupported ()
Rzuca |
---|
DeviceNotAvailableException | |
jest zaszyfrowany
public boolean isDeviceEncrypted ()
Rzuca |
---|
DeviceNotAvailableException | |
jestKatalog
public boolean isDirectory (String path)
Rzuca |
---|
DeviceNotAvailableException | |
isEnableAdbRoot
public boolean isEnableAdbRoot ()
Zwroty |
---|
boolean | true , jeśli na urządzeniu powinien być włączony root adb |
Obsługiwane jest szyfrowanie
public boolean isEncryptionSupported ()
Rzuca |
---|
DeviceNotAvailableException | |
jest wykonywalny
public boolean isExecutable (String fullPath)
Parametry |
---|
fullPath | String |
Rzuca |
---|
DeviceNotAvailableException | |
jest włączone Fastboot
public boolean isFastbootEnabled ()
jest Bezgłowy
public boolean isHeadless ()
Rzuca |
---|
DeviceNotAvailableException | |
isMultiUserSupported
public boolean isMultiUserSupported ()
Rzuca |
---|
DeviceNotAvailableException | |
jestZainstalowany pakiet
public boolean isPackageInstalled (String packageName,
String userId)
Parametry |
---|
packageName | String |
userId | String |
Rzuca |
---|
DeviceNotAvailableException | |
jestZainstalowany pakiet
public boolean isPackageInstalled (String packageName)
Parametry |
---|
packageName | String |
Rzuca |
---|
DeviceNotAvailableException | |
isRuntimePermissionSupported
public boolean isRuntimePermissionSupported ()
Rzuca |
---|
DeviceNotAvailableException | |
isStateBootloaderOrFastbootd
public boolean isStateBootloaderOrFastbootd ()
isUserRunning
public boolean isUserRunning (int userId)
Rzuca |
---|
DeviceNotAvailableException | |
jestUserSecondary
public boolean isUserSecondary (int userId)
Rzuca |
---|
DeviceNotAvailableException | |
jest włączone Wi-Fi
public boolean isWifiEnabled ()
Rzuca |
---|
DeviceNotAvailableException | |
listaDisplayIds
public listDisplayIds ()
Rzuca |
---|
DeviceNotAvailableException | |
listaUżytkownicy
public listUsers ()
Rzuca |
---|
DeviceNotAvailableException | |
logBłędny raport
public boolean logBugreport (String dataName,
ITestLogger listener)
Parametry |
---|
dataName | String |
listener | ITestLogger |
zaloguj się na urządzeniu
public void logOnDevice (String tag,
Log.LogLevel level,
String format,
Object... args)
Parametry |
---|
tag | String |
level | Log.LogLevel |
format | String |
args | Object |
nieblokującyPonowne uruchomienie
public void nonBlockingReboot ()
Rzuca |
---|
DeviceNotAvailableException | |
postAdbRootAction
public void postAdbRootAction ()
Zastąp, jeśli urządzenie wymaga podjęcia określonych działań po rootowaniu adb i zanim urządzenie wróci do trybu online. Domyślna implementacja nie obejmuje żadnych dodatkowych akcji. Nie ma gwarancji, że adb root zostanie włączony na tym etapie.
Rzuca |
---|
DeviceNotAvailableException | |
akcja postAdbUnroot
public void postAdbUnrootAction ()
Zastąp, jeśli urządzenie wymaga podjęcia określonych działań po unrootowaniu adb i zanim urządzenie wróci do trybu online. Domyślna implementacja nie obejmuje żadnych dodatkowych akcji. Nie ma gwarancji, że adb root zostanie wyłączony na tym etapie.
Rzuca |
---|
DeviceNotAvailableException | |
po konfiguracji rozruchu
public void postBootSetup ()
Rzuca |
---|
DeviceNotAvailableException | |
postInwokacjaTearDown
public void postInvocationTearDown (Throwable exception)
Parametry |
---|
exception | Throwable |
konfiguracja przed wywołaniem
public void preInvocationSetup (IBuildInfo info,
MultiMap<String, String> attributes)
Parametry |
---|
info | IBuildInfo |
attributes | MultiMap |
Rzuca |
---|
DeviceNotAvailableException | |
TargetSetupError | |
pullDir
public boolean pullDir (String deviceFilePath,
File localDir)
Parametry |
---|
deviceFilePath | String |
localDir | File |
Rzuca |
---|
DeviceNotAvailableException | |
plik pull
public boolean pullFile (String remoteFilePath,
File localFile)
Parametry |
---|
remoteFilePath | String |
localFile | File |
Rzuca |
---|
DeviceNotAvailableException | |
plik pull
public File pullFile (String remoteFilePath)
Parametry |
---|
remoteFilePath | String |
Rzuca |
---|
DeviceNotAvailableException | |
pullZawartość pliku
public String pullFileContents (String remoteFilePath)
Parametry |
---|
remoteFilePath | String |
Rzuca |
---|
DeviceNotAvailableException | |
pullFileFromExternal
public File pullFileFromExternal (String remoteFilePath)
Parametry |
---|
remoteFilePath | String |
Rzuca |
---|
DeviceNotAvailableException | |
pushDir
public boolean pushDir (File localFileDir,
String deviceFilePath,
excludedDirectories)
Parametry |
---|
localFileDir | File |
deviceFilePath | String |
excludedDirectories | |
Rzuca |
---|
DeviceNotAvailableException | |
pushDir
public boolean pushDir (File localFileDir,
String deviceFilePath)
Parametry |
---|
localFileDir | File |
deviceFilePath | String |
Rzuca |
---|
DeviceNotAvailableException | |
plik push
public boolean pushFile (File localFile,
String remoteFilePath)
Parametry |
---|
localFile | File |
remoteFilePath | String |
Rzuca |
---|
DeviceNotAvailableException | |
PushString
public boolean pushString (String contents,
String remoteFilePath)
Parametry |
---|
contents | String |
remoteFilePath | String |
Rzuca |
---|
DeviceNotAvailableException | |
ponowne uruchomienie
public void reboot (String reason)
Rzuca |
---|
DeviceNotAvailableException | |
ponowne uruchomienie
public void reboot ()
Rzuca |
---|
DeviceNotAvailableException | |
uruchom ponownie program Bootloader
public void rebootIntoBootloader ()
Rzuca |
---|
DeviceNotAvailableException | |
uruchom ponownie w Fastbootd
public void rebootIntoFastbootd ()
Rzuca |
---|
DeviceNotAvailableException | |
uruchom ponownie w trybie odzyskiwania
public void rebootIntoRecovery ()
Rzuca |
---|
DeviceNotAvailableException | |
uruchom ponownieIntoSideload
public void rebootIntoSideload ()
Rzuca |
---|
DeviceNotAvailableException | |
uruchom ponownieIntoSideload
public void rebootIntoSideload (boolean autoReboot)
Parametry |
---|
autoReboot | boolean |
Rzuca |
---|
DeviceNotAvailableException | |
uruchom ponownieDopókiOnline
public void rebootUntilOnline ()
Rzuca |
---|
DeviceNotAvailableException | |
uruchom ponownieDopókiOnline
public void rebootUntilOnline (String reason)
Rzuca |
---|
DeviceNotAvailableException | |
uruchom ponownie przestrzeń użytkownika
public void rebootUserspace ()
Rzuca |
---|
DeviceNotAvailableException | |
restartUserspaceUntilOnline
public void rebootUserspaceUntilOnline ()
Rzuca |
---|
DeviceNotAvailableException | |
odzyskać urządzenie
public void recoverDevice ()
Próbuje odzyskać komunikację z urządzeniem.
Rzuca |
---|
DeviceNotAvailableException | jeśli urządzenie nie jest już dostępne |
remountSystemZapisowy
public void remountSystemWritable ()
Rzuca |
---|
DeviceNotAvailableException | |
remountVendorWritable
public void remountVendorWritable ()
Rzuca |
---|
DeviceNotAvailableException | |
usuńAdministratora
public boolean removeAdmin (String componentName,
int userId)
Parametry |
---|
componentName | String |
userId | int |
Rzuca |
---|
DeviceNotAvailableException | |
usuń właścicieli
public void removeOwners ()
Rzuca |
---|
DeviceNotAvailableException | |
usuń użytkownika
public boolean removeUser (int userId)
Rzuca |
---|
DeviceNotAvailableException | |
resetContentProviderSetup
public void resetContentProviderSetup ()
Zresetuj flagę konfiguracji dostawcy treści, aby uruchomić ją ponownie.
uruchom testy oprzyrządowania
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner,
ITestLifeCycleReceiver... listeners)
Parametry |
---|
runner | IRemoteAndroidTestRunner |
listeners | ITestLifeCycleReceiver |
Rzuca |
---|
DeviceNotAvailableException | |
uruchom testy oprzyrządowania
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner,
listeners)
Parametry |
---|
runner | IRemoteAndroidTestRunner |
listeners | |
Rzuca |
---|
DeviceNotAvailableException | |
runInstrumentationTestsAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner,
int userId,
ITestLifeCycleReceiver... listeners)
Parametry |
---|
runner | IRemoteAndroidTestRunner |
userId | int |
listeners | ITestLifeCycleReceiver |
Rzuca |
---|
DeviceNotAvailableException | |
runInstrumentationTestsAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner,
int userId,
listeners)
Parametry |
---|
runner | IRemoteAndroidTestRunner |
userId | int |
listeners | |
Rzuca |
---|
DeviceNotAvailableException | |
ustaw konfigurację
public void setConfiguration (IConfiguration configuration)
Wstrzykuje używaną IConfiguration
.
Parametry |
---|
configuration | IConfiguration |
ustawić datę
public void setDate (Date date)
Rzuca |
---|
DeviceNotAvailableException | |
ustaw właściciela urządzenia
public boolean setDeviceOwner (String componentName,
int userId)
Parametry |
---|
componentName | String |
userId | int |
Rzuca |
---|
DeviceNotAvailableException | |
ustaw stan urządzenia
public void setDeviceState (TestDeviceState deviceState)
Parametry |
---|
deviceState | TestDeviceState |
setEmulatorOutputStream
public void setEmulatorOutputStream (SizeLimitedOutputStream output)
W przypadku emulatora ustaw SizeLimitedOutputStream
aby logować dane wyjściowe
Parametry |
---|
output | SizeLimitedOutputStream : do rejestrowania danych wyjściowych |
setEmulatorProces
public void setEmulatorProcess (Process p)
setFastbootWłączony
public void setFastbootEnabled (boolean fastbootEnabled)
Parametry |
---|
fastbootEnabled | boolean |
ustawFastbootPath
public void setFastbootPath (String fastbootPath)
Parametry |
---|
fastbootPath | String |
ustaw urządzenie
public void setIDevice (IDevice newDevice)
Parametry |
---|
newDevice | IDevice |
ustawOpcje
public void setOptions (TestDeviceOptions options)
Parametry |
---|
options | TestDeviceOptions |
ustawWłaściwość
public boolean setProperty (String propKey,
String propValue)
Parametry |
---|
propKey | String |
propValue | String |
Rzuca |
---|
DeviceNotAvailableException | |
ustaw odzyskiwanie
public void setRecovery (IDeviceRecovery recovery)
Parametry |
---|
recovery | IDeviceRecovery |
ustaw tryb odzyskiwania
public void setRecoveryMode (ITestDevice.RecoveryMode mode)
Parametry |
---|
mode | ITestDevice.RecoveryMode |
ustawUstawienie
public void setSetting (String namespace,
String key,
String value)
Parametry |
---|
namespace | String |
key | String |
value | String |
Rzuca |
---|
DeviceNotAvailableException | |
ustawUstawienie
public void setSetting (int userId,
String namespace,
String key,
String value)
Parametry |
---|
userId | int |
namespace | String |
key | String |
value | String |
Rzuca |
---|
DeviceNotAvailableException | |
setUseFastbootErase
public void setUseFastbootErase (boolean useFastbootErase)
Parametry |
---|
useFastbootErase | boolean |
uruchomLogcat
public void startLogcat ()
uruchom użytkownika
public boolean startUser (int userId)
Rzuca |
---|
DeviceNotAvailableException | |
uruchom użytkownika
public boolean startUser (int userId,
boolean waitFlag)
Parametry |
---|
userId | int |
waitFlag | boolean |
Rzuca |
---|
DeviceNotAvailableException | |
zatrzymaj wyjście emulatora
public void stopEmulatorOutput ()
zatrzymajLogcat
public void stopLogcat ()
zatrzymajUżytkownika
public boolean stopUser (int userId)
Rzuca |
---|
DeviceNotAvailableException | |
zatrzymajUżytkownika
public boolean stopUser (int userId,
boolean waitFlag,
boolean forceFlag)
Parametry |
---|
userId | int |
waitFlag | boolean |
forceFlag | boolean |
Rzuca |
---|
DeviceNotAvailableException | |
przełącz na AdbTcp
public String switchToAdbTcp ()
Rzuca |
---|
DeviceNotAvailableException | |
przełącz na AdbUsb
public boolean switchToAdbUsb ()
Rzuca |
---|
DeviceNotAvailableException | |
Zmień użytkownika
public boolean switchUser (int userId)
Rzuca |
---|
DeviceNotAvailableException | |
Zmień użytkownika
public boolean switchUser (int userId,
long timeout)
Parametry |
---|
userId | int |
timeout | long |
Rzuca |
---|
DeviceNotAvailableException | |
synchronizacja plików
public boolean syncFiles (File localFileDir,
String deviceFilePath)
Parametry |
---|
localFileDir | File |
deviceFilePath | String |
Rzuca |
---|
DeviceNotAvailableException | |
weź raport Bugre
public Bugreport takeBugreport ()
odszyfruj urządzenie
public boolean unencryptDevice ()
Rzuca |
---|
DeviceNotAvailableException | |
odinstaluj pakiet
public String uninstallPackage (String packageName)
Parametry |
---|
packageName | String |
Rzuca |
---|
DeviceNotAvailableException | |
odinstalujPakietForUser
public String uninstallPackageForUser (String packageName,
int userId)
Parametry |
---|
packageName | String |
userId | int |
Rzuca |
---|
DeviceNotAvailableException | |
odblokuj urządzenie
public boolean unlockDevice ()
Rzuca |
---|
DeviceNotAvailableException | |
poczekaj na ukończenie rozruchu
public boolean waitForBootComplete (long timeOut)
Rzuca |
---|
DeviceNotAvailableException | |
czekaj na urządzenie dostępne
public void waitForDeviceAvailable ()
Rzuca |
---|
DeviceNotAvailableException | |
czekaj na urządzenie dostępne
public void waitForDeviceAvailable (long waitTime)
Rzuca |
---|
DeviceNotAvailableException | |
poczekaj na urządzenie w odzyskiwaniu
public boolean waitForDeviceInRecovery (long waitTime)
waitForDeviceInSideload
public boolean waitForDeviceInSideload (long waitTime)
waitForDeviceNotAvailable
public boolean waitForDeviceNotAvailable (long waitTime)
poczekaj na urządzenie online
public void waitForDeviceOnline ()
Rzuca |
---|
DeviceNotAvailableException | |
poczekaj na urządzenie online
public void waitForDeviceOnline (long waitTime)
Rzuca |
---|
DeviceNotAvailableException | |
poczekaj naDeviceShell
public boolean waitForDeviceShell (long waitTime)
Metody chronione
sprawdźApiLevelPrzeciw
protected void checkApiLevelAgainst (String feature,
int strictMinLevel)
Parametry |
---|
feature | String |
strictMinLevel | int |
utwórz akcję ponownego uruchomienia urządzenia
protected NativeDevice.RebootDeviceAction createRebootDeviceAction (NativeDevice.RebootMode rebootMode,
String reason)
Utwórz RebootDeviceAction
, która będzie używana podczas wykonywania akcji ponownego uruchomienia.
Parametry |
---|
rebootMode | NativeDevice.RebootMode : tryb tego ponownego uruchomienia. |
reason | String : dla tego ponownego uruchomienia. |
wykonaj AdbReboot
protected void doAdbReboot (NativeDevice.RebootMode rebootMode,
String reason)
Wykonaj ponowne uruchomienie adb.
Parametry |
---|
rebootMode | NativeDevice.RebootMode : tryb tego ponownego uruchomienia. |
reason | String : dla tego ponownego uruchomienia. |
Rzuca |
---|
DeviceNotAvailableException | |
upewnij się, żeRuntimePermissionSupported
protected void ensureRuntimePermissionSupported ()
metoda pomocnicza, aby zgłosić wyjątek, jeśli uprawnienia środowiska wykonawczego nie są obsługiwane
Rzuca |
---|
DeviceNotAvailableException | |
pobierz BugreportInternal
protected InputStreamSource getBugreportInternal ()
getBugreportzInternal
protected File getBugreportzInternal ()
Metoda wewnętrznego pomocnika, aby uzyskać plik zip raportu o błędach jako ERROR(/File)
.
getRunUtil
protected IRunUtil getRunUtil ()
Pobierz instancję RunUtil
do użycia.
internalGetProperty
protected String internalGetProperty (String propName,
String fastbootVar,
String description)
Pobierz właściwość urządzenia, domyślnie z pamięci podręcznej ddmlib i wróć do `adb Shell getprop` lub `fastboot getvar`, w zależności od tego, czy urządzenie znajduje się w trybie Fastboot, czy nie.
Parametry |
---|
propName | String : Nazwa właściwości urządzenia zwrócona przez „adb Shell getprop”. |
fastbootVar | String : nazwa równoważnej zmiennej fastboot, której dotyczy zapytanie. jeśli null , zapytanie Fastboot nie zostanie wykonane |
description | String : Prosty opis zmiennej. Pierwsza litera powinna być wielka. |
Zwroty |
---|
String | Ciąg znaków, prawdopodobnie null lub pusty, zawierający wartość danej właściwości |
Rzuca |
---|
DeviceNotAvailableException | |
jest nowszy
protected boolean isNewer (File localFile,
IFileEntry entry)
Zwróć wartość true
, jeśli plik lokalny jest nowszy niż plik zdalny. IFileEntry
z dokładnością do minuty, w przypadku równych czasów, plik zostanie uznany za nowszy.
Parametry |
---|
localFile | File |
entry | IFileEntry |
protected boolean performDeviceAction (String actionDescription,
com.android.tradefed.device.NativeDevice.DeviceAction action,
int retryAttempts)
Wykonuje akcję na tym urządzeniu. Próbuje odzyskać urządzenie i opcjonalnie ponowić polecenie, jeśli akcja się nie powiedzie.
Parametry |
---|
actionDescription | String : krótki opis akcji, która ma zostać wykonana. Używane wyłącznie do celów rejestrowania. |
action | com.android.tradefed.device.NativeDevice.DeviceAction : akcja, która ma zostać wykonana |
retryAttempts | int : ponowna próba podjęcia działania, jeśli się nie powiedzie, ale odzyskiwanie powiedzie się |
Zwroty |
---|
boolean | true , jeśli akcja została wykonana pomyślnie |
Rzuca |
---|
DeviceNotAvailableException | jeśli próba odzyskania nie powiedzie się lub maksymalna liczba prób zostanie wykonana bez powodzenia |
po ponownym uruchomieniu Adb
protected void postAdbReboot ()
Możliwe dodatkowe działania, które można podjąć po ponownym uruchomieniu.
Rzuca |
---|
DeviceNotAvailableException | |
konfiguracja przedPostBoot
protected void prePostBootSetup ()
Umożliwia każdemu typowi urządzenia (AndroidNativeDevice, TestDevice) zastąpienie tej metody w przypadku określonej konfiguracji po rozruchu.
Rzuca |
---|
DeviceNotAvailableException | |
Ustaw zegarek
protected void setClock (Clock clock)
Ustaw instancję Clock do użycia.
setLogStartOpóźnienie
protected void setLogStartDelay (int delay)
Ustawia czas oczekiwania w ms przed rozpoczęciem przechwytywania logcat dla urządzenia online.
Parametry |
---|
delay | int : opóźnienie w ms |
waitForDeviceNotAvailable
protected void waitForDeviceNotAvailable (String operationDesc,
long time)
Parametry |
---|
operationDesc | String |
time | long |
Treść strony i umieszczone na niej fragmenty kodu podlegają licencjom opisanym w Licencji na treści. Java i OpenJDK są znakami towarowymi lub zastrzeżonymi znakami towarowymi należącymi do firmy Oracle lub jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2023-12-01 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Brak potrzebnych mi informacji"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Zbyt skomplikowane / zbyt wiele czynności do wykonania"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Nieaktualne treści"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"Problem z tłumaczeniem"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Problem z przykładami/kodem"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Inne"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Łatwo zrozumieć"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Rozwiązało to mój problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Inne"
}]