Urządzenie natywne

public class NativeDevice
extends Object implements IManagedTestDevice, IConfigurationReceiver

Obiekt Java.lang.Object
com.android.tradefed.device.NativeDevice


Domyślna implementacja urządzeń z systemem Android ITestDevice , które nie obsługują pełnego stosu.

Streszczenie

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.

Stałe

int INVALID_USER_ID

Wartość zwrócona w przypadku nieprawidłowego/nieodnalezionego identyfikatora użytkownika: UserHandle zdefiniował wartość -10000

long MAX_HOST_DEVICE_TIME_OFFSET

int MAX_RETRY_ATTEMPTS

domyślna liczba ponownych prób wykonania polecenia

Pola

protected static final String SD_CARD

protected static final String STORAGE_EMULATED

protected TestDeviceOptions mOptions

protected final IDeviceStateMonitor mStateMonitor

Konstruktorzy publiczni

NativeDevice (IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)

Tworzy TestDevice .

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

Zwroty
boolean

Rzuca
DeviceNotAvailableException

sprawdź Łączność

public boolean checkConnectivity ()

Zwroty
boolean

Rzuca
DeviceNotAvailableException

wyczyść okno dialogowe błędów

public boolean clearErrorDialogs ()

Zwroty
boolean

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

Zwroty
boolean

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

Zwroty
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

Zwroty
boolean

Rzuca
DeviceNotAvailableException

połącz się z siecią Wifi w razie potrzeby

public boolean connectToWifiNetworkIfNeeded (String wifiSsid, 
                String wifiPsk)

Parametry
wifiSsid String

wifiPsk String

Zwroty
boolean

Rzuca
DeviceNotAvailableException

Stwórz użytkownika

public int createUser (String name, 
                boolean guest, 
                boolean ephemeral)

Parametry
name String

guest boolean

ephemeral boolean

Zwroty
int

Rzuca
DeviceNotAvailableException

Stwórz użytkownika

public int createUser (String name)

Parametry
name String

Zwroty
int

Rzuca
DeviceNotAvailableException

utwórzUserNoThrow

public int createUserNoThrow (String name)

Parametry
name String

Zwroty
int

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

Zwroty
boolean

Rzuca
DeviceNotAvailableException

urządzenieSoftRestartedSince

public boolean deviceSoftRestartedSince (long utcEpochTime, 
                TimeUnit timeUnit)

Parametry
utcEpochTime long

timeUnit TimeUnit

Zwroty
boolean

Rzuca
DeviceNotAvailableException

wyłączAdbRoot

public boolean disableAdbRoot ()

Zwroty
boolean

Rzuca
DeviceNotAvailableException

wyłącz Keyguarda

public void disableKeyguard ()

Rzuca
DeviceNotAvailableException

wyłącz NetworkMonitor

public boolean disableNetworkMonitor ()

Zwroty
boolean

Rzuca
DeviceNotAvailableException

rozłącz się z Wi-Fi

public boolean disconnectFromWifi ()

Zwroty
boolean

Rzuca
DeviceNotAvailableException

czy plik istnieje

public boolean doesFileExist (String deviceFilePath)

Parametry
deviceFilePath String

Zwroty
boolean

Rzuca
DeviceNotAvailableException

sterta zrzutu

public File dumpHeap (String process, 
                String devicePath)

Parametry
process String

devicePath String

Zwroty
File

Rzuca
DeviceNotAvailableException

włączAdbRoot

public boolean enableAdbRoot ()

Zwroty
boolean

Rzuca
DeviceNotAvailableException

włączMonitor sieci

public boolean enableNetworkMonitor ()

Zwroty
boolean

Rzuca
DeviceNotAvailableException

zaszyfruj urządzenie

public boolean encryptDevice (boolean inplace)

Parametry
inplace boolean

Zwroty
boolean

Rzuca
DeviceNotAvailableException

wykonaj polecenie Adb

public String executeAdbCommand (long timeout, 
                String... cmdArgs)

Parametry
timeout long

cmdArgs String

Zwroty
String

Rzuca
DeviceNotAvailableException

wykonaj polecenie Adb

public String executeAdbCommand (String... cmdArgs)

Parametry
cmdArgs String

Zwroty
String

Rzuca
DeviceNotAvailableException

wykonaj polecenie Fastboot

public CommandResult executeFastbootCommand (String... cmdArgs)

Parametry
cmdArgs String

Zwroty
CommandResult

Rzuca
DeviceNotAvailableException

wykonaj polecenie Fastboot

public CommandResult executeFastbootCommand (long timeout, 
                String... cmdArgs)

Parametry
timeout long

cmdArgs String

Zwroty
CommandResult

Rzuca
DeviceNotAvailableException

wykonaj polecenie LongFastboot

public CommandResult executeLongFastbootCommand (String... cmdArgs)

Parametry
cmdArgs String

Zwroty
CommandResult

Rzuca
DeviceNotAvailableException

wykonaj polecenie Shell

public String executeShellCommand (String command)

Parametry
command String

Zwroty
String

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)

Parametry
cmd String

Zwroty
CommandResult

Rzuca
DeviceNotAvailableException

wykonaj polecenie ShellV2

public CommandResult executeShellV2Command (String cmd, 
                OutputStream pipeToOutput)

Parametry
cmd String

pipeToOutput OutputStream

Zwroty
CommandResult

Rzuca
DeviceNotAvailableException

wykonaj polecenie ShellV2

public CommandResult executeShellV2Command (String cmd, 
                File pipeAsInput)

Parametry
cmd String

pipeAsInput File

Zwroty
CommandResult

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

Zwroty
CommandResult

Rzuca
DeviceNotAvailableException

wykonaj polecenie ShellV2

public CommandResult executeShellV2Command (String cmd, 
                long maxTimeoutForCommand, 
                TimeUnit timeUnit)

Parametry
cmd String

maxTimeoutForCommand long

timeUnit TimeUnit

Zwroty
CommandResult

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

Zwroty
CommandResult

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

Zwroty
CommandResult

Rzuca
DeviceNotAvailableException

partycja fastbootWipe

public CommandResult fastbootWipePartition (String partition)

Parametry
partition String

Zwroty
CommandResult

Rzuca
DeviceNotAvailableException

pobierz ActiveApexy

public  getActiveApexes ()

Zwroty

Rzuca
DeviceNotAvailableException

pobierzWszystkieUstawienia

public  getAllSettings (String namespace)

Parametry
namespace String

Zwroty

Rzuca
DeviceNotAvailableException

pobierz stan alokacji

public DeviceAllocationState getAllocationState ()

Zwroty
DeviceAllocationState

pobierz identyfikator Androida

public String getAndroidId (int userId)

Parametry
userId int

Zwroty
String

Rzuca
DeviceNotAvailableException

pobierz identyfikatory Androida

public  getAndroidIds ()

Zwroty

Rzuca
DeviceNotAvailableException

pobierzApiLevel

public int getApiLevel ()

Zwroty
int

Rzuca
DeviceNotAvailableException

pobierz informacje o pakiecie aplikacji

public PackageInfo getAppPackageInfo (String packageName)

Parametry
packageName String

Zwroty
PackageInfo

Rzuca
DeviceNotAvailableException

pobierzInformacje o pakiecie aplikacji

public  getAppPackageInfos ()

Zwroty

Rzuca
DeviceNotAvailableException

pobierz wersję pasma podstawowego

public String getBasebandVersion ()

Zwroty
String

Rzuca
DeviceNotAvailableException

pobierz baterię

public Integer getBattery ()

Zwroty
Integer

getBooleanWłaściwość

public boolean getBooleanProperty (String name, 
                boolean defaultValue)

Parametry
name String

defaultValue boolean

Zwroty
boolean

Rzuca
DeviceNotAvailableException

pobierz historię rozruchu

public  getBootHistory ()

Zwroty

Rzuca
DeviceNotAvailableException

getBootHistorySince

public  getBootHistorySince (long utcEpochTime, 
                TimeUnit timeUnit)

Parametry
utcEpochTime long

timeUnit TimeUnit

Zwroty

Rzuca
DeviceNotAvailableException

pobierz wersję Bootloadera

public String getBootloaderVersion ()

Zwroty
String

Rzuca
DeviceNotAvailableException

pobierz raport błędów

public InputStreamSource getBugreport ()

Zwroty
InputStreamSource

pobierz Bugreportz

public InputStreamSource getBugreportz ()

Zwroty
InputStreamSource

pobierzBuildAlias

public String getBuildAlias ()

Zwroty
String

Rzuca
DeviceNotAvailableException

pobierzBuildFlavor

public String getBuildFlavor ()

Zwroty
String

Rzuca
DeviceNotAvailableException

getBuildId

public String getBuildId ()

Zwroty
String

Rzuca
DeviceNotAvailableException

getBuildSigningKeys

public String getBuildSigningKeys ()

Zwroty
String

Rzuca
DeviceNotAvailableException

getCachedDeviceDescriptor

public DeviceDescriptor getCachedDeviceDescriptor ()

Zwroty
DeviceDescriptor

zdobądź dzieci

public String[] getChildren (String path)

Parametry
path String

Zwroty
String[]

Rzuca
DeviceNotAvailableException

getCurrentFoldableState

public DeviceFoldableState getCurrentFoldableState ()

Zwroty
DeviceFoldableState

Rzuca
DeviceNotAvailableException

pobierz bieżącego użytkownika

public int getCurrentUser ()

Zwroty
int

Rzuca
DeviceNotAvailableException

pobierz klasę urządzenia

public String getDeviceClass ()

Zwroty
String

pobierzDatęUrządzenia

public long getDeviceDate ()

Zwroty
long

Rzuca
DeviceNotAvailableException

pobierzDeviceDescriptor

public DeviceDescriptor getDeviceDescriptor ()

Zwroty
DeviceDescriptor

pobierz stan urządzenia

public TestDeviceState getDeviceState ()

Zwroty
TestDeviceState

pobierzDeviceTimeOffset

public long getDeviceTimeOffset (Date date)

Parametry
date Date

Zwroty
long

Rzuca
DeviceNotAvailableException

pobierz wyjście emulatora

public InputStreamSource getEmulatorOutput ()

Zwroty
InputStreamSource

pobierz proces emulatora

public Process getEmulatorProcess ()

Zwroty
Process

getExecuteShellCommandLog

public final File getExecuteShellCommandLog ()

Dziennik zawierający wszystkie dzienniki executeShellCommand(String) .

Zwroty
File

getExternalStoreFreeSpace

public long getExternalStoreFreeSpace ()

Zwroty
long

Rzuca
DeviceNotAvailableException

pobierzFastbootPath

public String getFastbootPath ()

Zwroty
String

getFastbootProductType

public String getFastbootProductType ()

Zwroty
String

Rzuca
DeviceNotAvailableException

getFastbootProductVariant

public String getFastbootProductVariant ()

Zwroty
String

Rzuca
DeviceNotAvailableException

getFastbootSerialNumber

public String getFastbootSerialNumber ()

Zwroty
String

pobierz zmienną Fastboot

public String getFastbootVariable (String variableName)

Parametry
variableName String

Zwroty
String

Rzuca
DeviceNotAvailableException

pobierz wersję Fastboot

public String getFastbootVersion ()

Zwroty
String

pobierz plikEntry

public IFileEntry getFileEntry (String path)

Parametry
path String

Zwroty
IFileEntry

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.

Zwroty
IFileEntry FileEntryWrapper reprezentujący FileEntry.

Rzuca
DeviceNotAvailableException

getFoldableStates

public  getFoldableStates ()

Zwroty

Rzuca
DeviceNotAvailableException

pobierzIDevice

public IDevice getIDevice ()

Zwroty
IDevice

getInstalledPackageNames

public  getInstalledPackageNames ()

Zwroty

Rzuca
DeviceNotAvailableException

pobierzIntProperty

public long getIntProperty (String name, 
                long defaultValue)

Parametry
name String

defaultValue long

Zwroty
long

Rzuca
DeviceNotAvailableException

pobierz adres IP

public String getIpAddress ()

Zwroty
String

Rzuca
DeviceNotAvailableException

pobierzKeyguardState

public KeyguardControllerState getKeyguardState ()

Zwroty
KeyguardControllerState

Rzuca
DeviceNotAvailableException

getLastExpectedRebootTimeMillis

public long getLastExpectedRebootTimeMillis ()

Zwroty
long

getLaunchApiLevel

public int getLaunchApiLevel ()

Zwroty
int

Rzuca
DeviceNotAvailableException

pobierzLogcat

public InputStreamSource getLogcat ()

Zwroty
InputStreamSource

pobierzLogcat

public InputStreamSource getLogcat (int maxBytes)

Parametry
maxBytes int

Zwroty
InputStreamSource

pobierz LogcatDump

public InputStreamSource getLogcatDump ()

Zwroty
InputStreamSource

pobierzLogcatSince

public InputStreamSource getLogcatSince (long date)

Parametry
date long

Zwroty
InputStreamSource

pobierz adres Mac

public String getMacAddress ()

Zwroty
String

pobierzMainlineModuleInfo

public  getMainlineModuleInfo ()

Zwroty

Rzuca
DeviceNotAvailableException

getMaxNumberOfRunningUsersSupported

public int getMaxNumberOfRunningUsersSupported ()

Zwroty
int

Rzuca
DeviceNotAvailableException

getMaxNumberOfUsersSupported

public int getMaxNumberOfUsersSupported ()

Zwroty
int

Rzuca
DeviceNotAvailableException

pobierzMonitor

public IDeviceStateMonitor getMonitor ()

Zwroty
IDeviceStateMonitor

pobierzMountPoint

public String getMountPoint (String mountName)

Parametry
mountName String

Zwroty
String

pobierzMountPointInfo

public ITestDevice.MountPointInfo getMountPointInfo (String mountpoint)

Parametry
mountpoint String

Zwroty
ITestDevice.MountPointInfo

Rzuca
DeviceNotAvailableException

pobierzMountPointInfo

public  getMountPointInfo ()

Zwroty

Rzuca
DeviceNotAvailableException

pobierzOpcje

public TestDeviceOptions getOptions ()

Zwroty
TestDeviceOptions

getPartitionFreeSpace

public long getPartitionFreeSpace (String partition)

Parametry
partition String

Zwroty
long

Rzuca
DeviceNotAvailableException

pobierz identyfikator użytkownika podstawowego

public Integer getPrimaryUserId ()

Zwroty
Integer

Rzuca
DeviceNotAvailableException

getProcessByName

public ProcessInfo getProcessByName (String processName)

Parametry
processName String

Zwroty
ProcessInfo

Rzuca
DeviceNotAvailableException

pobierzPidProcesu

public String getProcessPid (String process)

Parametry
process String

Zwroty
String

Rzuca
DeviceNotAvailableException

pobierz typ produktu

public String getProductType ()

Zwroty
String

Rzuca
DeviceNotAvailableException

pobierzWariantProduktu

public String getProductVariant ()

Zwroty
String

Rzuca
DeviceNotAvailableException

pobierzWłaściwość

public String getProperty (String name)

Parametry
name String

Zwroty
String

Rzuca
DeviceNotAvailableException

pobierz tryb odzyskiwania

public ITestDevice.RecoveryMode getRecoveryMode ()

Zwroty
ITestDevice.RecoveryMode

pobierz zrzut ekranu

public InputStreamSource getScreenshot (String format)

Parametry
format String

Zwroty
InputStreamSource

Rzuca
DeviceNotAvailableException

pobierz zrzut ekranu

public InputStreamSource getScreenshot (long displayId)

Parametry
displayId long

Zwroty
InputStreamSource

Rzuca
DeviceNotAvailableException

pobierz zrzut ekranu

public InputStreamSource getScreenshot (String format, 
                boolean rescale)

Parametry
format String

rescale boolean

Zwroty
InputStreamSource

Rzuca
DeviceNotAvailableException

pobierz zrzut ekranu

public InputStreamSource getScreenshot ()

Zwroty
InputStreamSource

Rzuca
DeviceNotAvailableException

pobierz numer seryjny

public String getSerialNumber ()

Zwroty
String

pobierz ustawienie

public String getSetting (int userId, 
                String namespace, 
                String key)

Parametry
userId int

namespace String

key String

Zwroty
String

Rzuca
DeviceNotAvailableException

pobierz ustawienie

public String getSetting (String namespace, 
                String key)

Parametry
namespace String

key String

Zwroty
String

Rzuca
DeviceNotAvailableException

pobierz SimOperatora

public String getSimOperator ()

Zwroty
String

pobierzSimState

public String getSimState ()

Zwroty
String

zdobądź nagrobki

public  getTombstones ()

Zwroty

Rzuca
DeviceNotAvailableException

pobierz TotalMemory

public long getTotalMemory ()

Zwroty
long

getUninstallablePackageNames

public  getUninstallablePackageNames ()

Zwroty

Rzuca
DeviceNotAvailableException

getUseFastbootErase

public boolean getUseFastbootErase ()

Zwroty
boolean

pobierz flagi użytkownika

public int getUserFlags (int userId)

Parametry
userId int

Zwroty
int

Rzuca
DeviceNotAvailableException

pobierz informacje o użytkowniku

public  getUserInfos ()

Zwroty

Rzuca
DeviceNotAvailableException

pobierz numer seryjny użytkownika

public int getUserSerialNumber (int userId)

Parametry
userId int

Zwroty
int

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)

Parametry
feature String

Zwroty
boolean

Rzuca
DeviceNotAvailableException

zainstaluj pakiet

public String installPackage (File packageFile, 
                boolean reinstall, 
                String... extraArgs)

Parametry
packageFile File

reinstall boolean

extraArgs String

Zwroty
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

Zwroty
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

Zwroty
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

Zwroty
String

Rzuca
DeviceNotAvailableException

jestAdbRoot

public boolean isAdbRoot ()

Zwroty
boolean

Rzuca
DeviceNotAvailableException

isAdbTcp

public boolean isAdbTcp ()

Zwroty
boolean

isAppEnumerationSupported

public boolean isAppEnumerationSupported ()

Zwroty
boolean

Rzuca
DeviceNotAvailableException

jest zaszyfrowany

public boolean isDeviceEncrypted ()

Zwroty
boolean

Rzuca
DeviceNotAvailableException

jestKatalog

public boolean isDirectory (String path)

Parametry
path String

Zwroty
boolean

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 ()

Zwroty
boolean

Rzuca
DeviceNotAvailableException

jest wykonywalny

public boolean isExecutable (String fullPath)

Parametry
fullPath String

Zwroty
boolean

Rzuca
DeviceNotAvailableException

jest włączone Fastboot

public boolean isFastbootEnabled ()

Zwroty
boolean

jest Bezgłowy

public boolean isHeadless ()

Zwroty
boolean

Rzuca
DeviceNotAvailableException

isMultiUserSupported

public boolean isMultiUserSupported ()

Zwroty
boolean

Rzuca
DeviceNotAvailableException

jestZainstalowany pakiet

public boolean isPackageInstalled (String packageName, 
                String userId)

Parametry
packageName String

userId String

Zwroty
boolean

Rzuca
DeviceNotAvailableException

jestZainstalowany pakiet

public boolean isPackageInstalled (String packageName)

Parametry
packageName String

Zwroty
boolean

Rzuca
DeviceNotAvailableException

isRuntimePermissionSupported

public boolean isRuntimePermissionSupported ()

Zwroty
boolean

Rzuca
DeviceNotAvailableException

isStateBootloaderOrFastbootd

public boolean isStateBootloaderOrFastbootd ()

Zwroty
boolean

isUserRunning

public boolean isUserRunning (int userId)

Parametry
userId int

Zwroty
boolean

Rzuca
DeviceNotAvailableException

jestUserSecondary

public boolean isUserSecondary (int userId)

Parametry
userId int

Zwroty
boolean

Rzuca
DeviceNotAvailableException

jest włączone Wi-Fi

public boolean isWifiEnabled ()

Zwroty
boolean

Rzuca
DeviceNotAvailableException

listaDisplayIds

public  listDisplayIds ()

Zwroty

Rzuca
DeviceNotAvailableException

listaUżytkownicy

public  listUsers ()

Zwroty

Rzuca
DeviceNotAvailableException

logBłędny raport

public boolean logBugreport (String dataName, 
                ITestLogger listener)

Parametry
dataName String

listener ITestLogger

Zwroty
boolean

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

Zwroty
boolean

Rzuca
DeviceNotAvailableException

plik pull

public boolean pullFile (String remoteFilePath, 
                File localFile)

Parametry
remoteFilePath String

localFile File

Zwroty
boolean

Rzuca
DeviceNotAvailableException

plik pull

public File pullFile (String remoteFilePath)

Parametry
remoteFilePath String

Zwroty
File

Rzuca
DeviceNotAvailableException

pullZawartość pliku

public String pullFileContents (String remoteFilePath)

Parametry
remoteFilePath String

Zwroty
String

Rzuca
DeviceNotAvailableException

pullFileFromExternal

public File pullFileFromExternal (String remoteFilePath)

Parametry
remoteFilePath String

Zwroty
File

Rzuca
DeviceNotAvailableException

pushDir

public boolean pushDir (File localFileDir, 
                String deviceFilePath, 
                 excludedDirectories)

Parametry
localFileDir File

deviceFilePath String

excludedDirectories

Zwroty
boolean

Rzuca
DeviceNotAvailableException

pushDir

public boolean pushDir (File localFileDir, 
                String deviceFilePath)

Parametry
localFileDir File

deviceFilePath String

Zwroty
boolean

Rzuca
DeviceNotAvailableException

plik push

public boolean pushFile (File localFile, 
                String remoteFilePath)

Parametry
localFile File

remoteFilePath String

Zwroty
boolean

Rzuca
DeviceNotAvailableException

PushString

public boolean pushString (String contents, 
                String remoteFilePath)

Parametry
contents String

remoteFilePath String

Zwroty
boolean

Rzuca
DeviceNotAvailableException

ponowne uruchomienie

public void reboot (String reason)

Parametry
reason String

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)

Parametry
reason String

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

Zwroty
boolean

Rzuca
DeviceNotAvailableException

usuń właścicieli

public void removeOwners ()

Rzuca
DeviceNotAvailableException

usuń użytkownika

public boolean removeUser (int userId)

Parametry
userId int

Zwroty
boolean

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

Zwroty
boolean

Rzuca
DeviceNotAvailableException

uruchom testy oprzyrządowania

public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner, 
                 listeners)

Parametry
runner IRemoteAndroidTestRunner

listeners

Zwroty
boolean

Rzuca
DeviceNotAvailableException

runInstrumentationTestsAsUser

public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, 
                int userId, 
                ITestLifeCycleReceiver... listeners)

Parametry
runner IRemoteAndroidTestRunner

userId int

listeners ITestLifeCycleReceiver

Zwroty
boolean

Rzuca
DeviceNotAvailableException

runInstrumentationTestsAsUser

public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, 
                int userId, 
                 listeners)

Parametry
runner IRemoteAndroidTestRunner

userId int

listeners

Zwroty
boolean

Rzuca
DeviceNotAvailableException

ustaw konfigurację

public void setConfiguration (IConfiguration configuration)

Wstrzykuje używaną IConfiguration .

Parametry
configuration IConfiguration

ustawić datę

public void setDate (Date date)

Parametry
date Date

Rzuca
DeviceNotAvailableException

ustaw właściciela urządzenia

public boolean setDeviceOwner (String componentName, 
                int userId)

Parametry
componentName String

userId int

Zwroty
boolean

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)

Parametry
p Process

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

Zwroty
boolean

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)

Parametry
userId int

Zwroty
boolean

Rzuca
DeviceNotAvailableException

uruchom użytkownika

public boolean startUser (int userId, 
                boolean waitFlag)

Parametry
userId int

waitFlag boolean

Zwroty
boolean

Rzuca
DeviceNotAvailableException

zatrzymaj wyjście emulatora

public void stopEmulatorOutput ()

zatrzymajLogcat

public void stopLogcat ()

zatrzymajUżytkownika

public boolean stopUser (int userId)

Parametry
userId int

Zwroty
boolean

Rzuca
DeviceNotAvailableException

zatrzymajUżytkownika

public boolean stopUser (int userId, 
                boolean waitFlag, 
                boolean forceFlag)

Parametry
userId int

waitFlag boolean

forceFlag boolean

Zwroty
boolean

Rzuca
DeviceNotAvailableException

przełącz na AdbTcp

public String switchToAdbTcp ()

Zwroty
String

Rzuca
DeviceNotAvailableException

przełącz na AdbUsb

public boolean switchToAdbUsb ()

Zwroty
boolean

Rzuca
DeviceNotAvailableException

Zmień użytkownika

public boolean switchUser (int userId)

Parametry
userId int

Zwroty
boolean

Rzuca
DeviceNotAvailableException

Zmień użytkownika

public boolean switchUser (int userId, 
                long timeout)

Parametry
userId int

timeout long

Zwroty
boolean

Rzuca
DeviceNotAvailableException

synchronizacja plików

public boolean syncFiles (File localFileDir, 
                String deviceFilePath)

Parametry
localFileDir File

deviceFilePath String

Zwroty
boolean

Rzuca
DeviceNotAvailableException

weź raport Bugre

public Bugreport takeBugreport ()

Zwroty
Bugreport

odszyfruj urządzenie

public boolean unencryptDevice ()

Zwroty
boolean

Rzuca
DeviceNotAvailableException

odinstaluj pakiet

public String uninstallPackage (String packageName)

Parametry
packageName String

Zwroty
String

Rzuca
DeviceNotAvailableException

odinstalujPakietForUser

public String uninstallPackageForUser (String packageName, 
                int userId)

Parametry
packageName String

userId int

Zwroty
String

Rzuca
DeviceNotAvailableException

odblokuj urządzenie

public boolean unlockDevice ()

Zwroty
boolean

Rzuca
DeviceNotAvailableException

poczekaj na ukończenie rozruchu

public boolean waitForBootComplete (long timeOut)

Parametry
timeOut long

Zwroty
boolean

Rzuca
DeviceNotAvailableException

czekaj na urządzenie dostępne

public void waitForDeviceAvailable ()

Rzuca
DeviceNotAvailableException

czekaj na urządzenie dostępne

public void waitForDeviceAvailable (long waitTime)

Parametry
waitTime long

Rzuca
DeviceNotAvailableException

poczekaj na urządzenie w odzyskiwaniu

public boolean waitForDeviceInRecovery (long waitTime)

Parametry
waitTime long

Zwroty
boolean

waitForDeviceInSideload

public boolean waitForDeviceInSideload (long waitTime)

Parametry
waitTime long

Zwroty
boolean

waitForDeviceNotAvailable

public boolean waitForDeviceNotAvailable (long waitTime)

Parametry
waitTime long

Zwroty
boolean

poczekaj na urządzenie online

public void waitForDeviceOnline ()

Rzuca
DeviceNotAvailableException

poczekaj na urządzenie online

public void waitForDeviceOnline (long waitTime)

Parametry
waitTime long

Rzuca
DeviceNotAvailableException

poczekaj naDeviceShell

public boolean waitForDeviceShell (long waitTime)

Parametry
waitTime long

Zwroty
boolean

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.

Zwroty
NativeDevice.RebootDeviceAction utworzona RebootDeviceAction .

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 ()

Zwroty
InputStreamSource

getBugreportzInternal

protected File getBugreportzInternal ()

Metoda wewnętrznego pomocnika, aby uzyskać plik zip raportu o błędach jako ERROR(/File) .

Zwroty
File

getRunUtil

protected IRunUtil getRunUtil ()

Pobierz instancję RunUtil do użycia.

Zwroty
IRunUtil

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

Zwroty
boolean

wykonaj akcję urządzenia

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.

Parametry
clock Clock

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