Kelas bersarang |
---|
class | NativeDevice.AdbAction Sebuah DeviceAction untuk menjalankan OS 'adb ....' perintah. |
class | NativeDevice.AdbShellAction |
class | NativeDevice.RebootDeviceAction DeviceAction untuk reboot perangkat. |
enum | NativeDevice.RebootMode Sebuah mode reboot. |
Metode publik |
---|
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 () Log yang berisi semua executeShellCommand(String) log. |
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) Helper tidak resmi untuk mendapatkan FileEntry dari jalur non-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) Memproses DeviceEvent, yang mungkin atau mungkin tidak mentransisikan perangkat ini ke status alokasi baru. |
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 () Ganti jika perangkat memerlukan beberapa tindakan khusus yang harus diambil setelah adb root dan sebelum perangkat kembali online. |
void | postAdbUnrootAction () Ganti jika perangkat memerlukan beberapa tindakan khusus yang harus diambil setelah adb unroot dan sebelum perangkat kembali 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 () Upaya untuk memulihkan komunikasi perangkat. |
void | remountSystemWritable () |
void | remountVendorWritable () |
boolean | removeAdmin (String componentName, int userId) |
void | removeOwners () |
boolean | removeUser (int userId) |
void | resetContentProviderSetup () Setel ulang tanda untuk penyiapan penyedia konten untuk memicunya lagi. |
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) Menyuntikkan yang IConfiguration digunakan. |
void | setDate (Date date) |
boolean | setDeviceOwner (String componentName, int userId) |
void | setDeviceState (TestDeviceState deviceState) |
void | setEmulatorOutputStream ( SizeLimitedOutputStream output) Untuk emulator mengatur SizeLimitedOutputStream untuk log keluaran |
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) |
Metode yang dilindungi |
---|
void | checkApiLevelAgainst (String feature, int strictMinLevel) |
NativeDevice.RebootDeviceAction | createRebootDeviceAction ( NativeDevice.RebootMode rebootMode, String reason) Buat RebootDeviceAction yang akan digunakan saat melakukan tindakan reboot. |
void | doAdbReboot ( NativeDevice.RebootMode rebootMode, String reason) Lakukan reboot adb. |
void | ensureRuntimePermissionSupported () metode pembantu untuk membuang pengecualian jika izin runtime tidak didukung |
InputStreamSource | getBugreportInternal () |
File | getBugreportzInternal () Metode internal Helper untuk mendapatkan file zip bugreportz sebagai ERROR(/File) . |
IRunUtil | getRunUtil () Dapatkan RunUtil misalnya untuk digunakan. |
String | internalGetProperty (String propName, String fastbootVar, String description) Ambil properti perangkat, dari cache ddmlib secara default, dan kembali ke `adb shell getprop` atau `fastboot getvar` tergantung pada apakah perangkat dalam Fastboot atau tidak. |
boolean | isNewer (File localFile, IFileEntry entry) Kembali true jika file lokal lebih baru dari file jarak jauh. |
boolean | performDeviceAction (String actionDescription, com.android.tradefed.device.NativeDevice.DeviceAction action, int retryAttempts) Melakukan tindakan pada perangkat ini. |
void | postAdbReboot () Kemungkinan tindakan tambahan yang dapat diambil setelah reboot. |
void | prePostBootSetup () Mengizinkan setiap jenis perangkat (AndroidNativeDevice, TestDevice) mengganti metode ini untuk penyiapan booting pos tertentu. |
void | setClock (Clock clock) Setel instance Jam untuk digunakan. |
void | setLogStartDelay (int delay) Menyetel waktu dalam ms untuk menunggu sebelum memulai pengambilan logcat untuk perangkat online. |
void | waitForDeviceNotAvailable (String operationDesc, long time) |
Konstanta
INVALID_USER_ID
public static final int INVALID_USER_ID
Nilai yang dikembalikan untuk id pengguna yang tidak valid/tidak ditemukan: UserHandle mendefinisikan nilai -10000
Nilai Konstan: -10000 (0xffffd8f0)
MAX_HOST_DEVICE_TIME_OFFSET
protected static final long MAX_HOST_DEVICE_TIME_OFFSET
Nilai Konstan: 5000 (0x0000000000001388)
MAX_RETRY_ATTEMPTS
protected static final int MAX_RETRY_ATTEMPTS
jumlah default dari upaya percobaan ulang perintah untuk dilakukan
Nilai Konstan: 2 (0x00000002)
bidang
KARTU SD
protected static final String SD_CARD
STORAGE_EMULATED
protected static final String STORAGE_EMULATED
mPilihan
protected TestDeviceOptions mOptions
mStateMonitor
protected final IDeviceStateMonitor mStateMonitor
Konstruktor publik
Perangkat Asli
public NativeDevice (IDevice device,
IDeviceStateMonitor stateMonitor,
IDeviceMonitor allocationMonitor)
Menciptakan TestDevice
.
Parameter |
---|
device | IDevice : yang terkait IDevice |
stateMonitor | IDeviceStateMonitor : yang IDeviceStateMonitor mekanisme untuk digunakan |
allocationMonitor | IDeviceMonitor : yang IDeviceMonitor untuk menginformasikan perubahan negara alokasi. Bisa nol |
Metode publik
checkApiLevelAgainstNextRelease
public boolean checkApiLevelAgainstNextRelease (int strictMinLevel)
Parameter |
---|
strictMinLevel | int |
Melempar |
---|
DeviceNotAvailableException | |
periksaKonektivitas
public boolean checkConnectivity ()
Melempar |
---|
DeviceNotAvailableException | |
clearErrorDialog
public boolean clearErrorDialogs ()
Melempar |
---|
DeviceNotAvailableException | |
clearLastConnectedWifiNetwork
public void clearLastConnectedWifiNetwork ()
jelasLogcat
public void clearLogcat ()
connectToWifiNetwork
public boolean connectToWifiNetwork (String wifiSsid,
String wifiPsk)
Parameter |
---|
wifiSsid | String |
wifiPsk | String |
Melempar |
---|
DeviceNotAvailableException | |
connectToWifiNetwork
public boolean connectToWifiNetwork (String wifiSsid,
String wifiPsk,
boolean scanSsid)
Parameter |
---|
wifiSsid | String |
wifiPsk | String |
scanSsid | boolean |
Melempar |
---|
DeviceNotAvailableException | |
connectToWifiNetworkIfNeeded
public boolean connectToWifiNetworkIfNeeded (String wifiSsid,
String wifiPsk,
boolean scanSsid)
Parameter |
---|
wifiSsid | String |
wifiPsk | String |
scanSsid | boolean |
Melempar |
---|
DeviceNotAvailableException | |
connectToWifiNetworkIfNeeded
public boolean connectToWifiNetworkIfNeeded (String wifiSsid,
String wifiPsk)
Parameter |
---|
wifiSsid | String |
wifiPsk | String |
Melempar |
---|
DeviceNotAvailableException | |
buat pengguna
public int createUser (String name,
boolean guest,
boolean ephemeral)
Parameter |
---|
name | String |
guest | boolean |
ephemeral | boolean |
Melempar |
---|
DeviceNotAvailableException | |
buat pengguna
public int createUser (String name)
Melempar |
---|
DeviceNotAvailableException | |
buatUserNoThrow
public int createUserNoThrow (String name)
Melempar |
---|
DeviceNotAvailableException | |
menghapus berkas
public void deleteFile (String deviceFilePath)
Parameter |
---|
deviceFilePath | String |
Melempar |
---|
DeviceNotAvailableException | |
perangkatSoftRestart
public boolean deviceSoftRestarted (ProcessInfo prevSystemServerProcess)
Parameter |
---|
prevSystemServerProcess | ProcessInfo |
Melempar |
---|
DeviceNotAvailableException | |
perangkatSoftRestartedSejak
public boolean deviceSoftRestartedSince (long utcEpochTime,
TimeUnit timeUnit)
Parameter |
---|
utcEpochTime | long |
timeUnit | TimeUnit |
Melempar |
---|
DeviceNotAvailableException | |
nonaktifkanAdbRoot
public boolean disableAdbRoot ()
Melempar |
---|
DeviceNotAvailableException | |
nonaktifkan Keyguard
public void disableKeyguard ()
Melempar |
---|
DeviceNotAvailableException | |
nonaktifkanNetworkMonitor
public boolean disableNetworkMonitor ()
Melempar |
---|
DeviceNotAvailableException | |
putuskanDariWifi
public boolean disconnectFromWifi ()
Melempar |
---|
DeviceNotAvailableException | |
apakahFileAda?
public boolean doesFileExist (String deviceFilePath)
Parameter |
---|
deviceFilePath | String |
Melempar |
---|
DeviceNotAvailableException | |
timbunan sampah
public File dumpHeap (String process,
String devicePath)
Parameter |
---|
process | String |
devicePath | String |
Melempar |
---|
DeviceNotAvailableException | |
aktifkanAdbRoot
public boolean enableAdbRoot ()
Melempar |
---|
DeviceNotAvailableException | |
aktifkanNetworkMonitor
public boolean enableNetworkMonitor ()
Melempar |
---|
DeviceNotAvailableException | |
mengenkripsiPerangkat
public boolean encryptDevice (boolean inplace)
Parameter |
---|
inplace | boolean |
Melempar |
---|
DeviceNotAvailableException | |
jalankanAdbCommand
public String executeAdbCommand (long timeout,
String... cmdArgs)
Parameter |
---|
timeout | long |
cmdArgs | String |
Melempar |
---|
DeviceNotAvailableException | |
jalankanAdbCommand
public String executeAdbCommand (String... cmdArgs)
Melempar |
---|
DeviceNotAvailableException | |
mengeksekusiFastbootCommand
public CommandResult executeFastbootCommand (String... cmdArgs)
Melempar |
---|
DeviceNotAvailableException | |
mengeksekusiFastbootCommand
public CommandResult executeFastbootCommand (long timeout,
String... cmdArgs)
Parameter |
---|
timeout | long |
cmdArgs | String |
Melempar |
---|
DeviceNotAvailableException | |
mengeksekusiLongFastbootCommand
public CommandResult executeLongFastbootCommand (String... cmdArgs)
Melempar |
---|
DeviceNotAvailableException | |
mengeksekusiShellCommand
public String executeShellCommand (String command)
Melempar |
---|
DeviceNotAvailableException | |
mengeksekusiShellCommand
public void executeShellCommand (String command,
IShellOutputReceiver receiver,
long maxTimeToOutputShellResponse,
TimeUnit timeUnit,
int retryAttempts)
Parameter |
---|
command | String |
receiver | IShellOutputReceiver |
maxTimeToOutputShellResponse | long |
timeUnit | TimeUnit |
retryAttempts | int |
Melempar |
---|
DeviceNotAvailableException | |
mengeksekusiShellCommand
public void executeShellCommand (String command,
IShellOutputReceiver receiver,
long maxTimeoutForCommand,
long maxTimeToOutputShellResponse,
TimeUnit timeUnit,
int retryAttempts)
Parameter |
---|
command | String |
receiver | IShellOutputReceiver |
maxTimeoutForCommand | long |
maxTimeToOutputShellResponse | long |
timeUnit | TimeUnit |
retryAttempts | int |
Melempar |
---|
DeviceNotAvailableException | |
mengeksekusiShellCommand
public void executeShellCommand (String command,
IShellOutputReceiver receiver)
Parameter |
---|
command | String |
receiver | IShellOutputReceiver |
Melempar |
---|
DeviceNotAvailableException | |
jalankanShellV2Command
public CommandResult executeShellV2Command (String cmd)
Melempar |
---|
DeviceNotAvailableException | |
jalankanShellV2Command
public CommandResult executeShellV2Command (String cmd,
OutputStream pipeToOutput)
Parameter |
---|
cmd | String |
pipeToOutput | OutputStream |
Melempar |
---|
DeviceNotAvailableException | |
jalankanShellV2Command
public CommandResult executeShellV2Command (String cmd,
File pipeAsInput)
Parameter |
---|
cmd | String |
pipeAsInput | File |
Melempar |
---|
DeviceNotAvailableException | |
jalankanShellV2Command
public CommandResult executeShellV2Command (String cmd,
long maxTimeoutForCommand,
TimeUnit timeUnit,
int retryAttempts)
Parameter |
---|
cmd | String |
maxTimeoutForCommand | long |
timeUnit | TimeUnit |
retryAttempts | int |
Melempar |
---|
DeviceNotAvailableException | |
jalankanShellV2Command
public CommandResult executeShellV2Command (String cmd,
long maxTimeoutForCommand,
TimeUnit timeUnit)
Parameter |
---|
cmd | String |
maxTimeoutForCommand | long |
timeUnit | TimeUnit |
Melempar |
---|
DeviceNotAvailableException | |
jalankanShellV2Command
public CommandResult executeShellV2Command (String cmd,
File pipeAsInput,
OutputStream pipeToOutput,
long maxTimeoutForCommand,
TimeUnit timeUnit,
int retryAttempts)
Parameter |
---|
cmd | String |
pipeAsInput | File |
pipeToOutput | OutputStream |
maxTimeoutForCommand | long |
timeUnit | TimeUnit |
retryAttempts | int |
Melempar |
---|
DeviceNotAvailableException | |
jalankanShellV2Command
public CommandResult executeShellV2Command (String cmd,
File pipeAsInput,
OutputStream pipeToOutput,
OutputStream pipeToError,
long maxTimeoutForCommand,
TimeUnit timeUnit,
int retryAttempts)
Parameter |
---|
cmd | String |
pipeAsInput | File |
pipeToOutput | OutputStream |
pipeToError | OutputStream |
maxTimeoutForCommand | long |
timeUnit | TimeUnit |
retryAttempts | int |
Melempar |
---|
DeviceNotAvailableException | |
fastbootWipePartition
public CommandResult fastbootWipePartition (String partition)
Parameter |
---|
partition | String |
Melempar |
---|
DeviceNotAvailableException | |
getActiveApex
public getActiveApexes ()
Melempar |
---|
DeviceNotAvailableException | |
dapatkanSemuaPengaturan
public getAllSettings (String namespace)
Parameter |
---|
namespace | String |
Melempar |
---|
DeviceNotAvailableException | |
getAllocationState
public DeviceAllocationState getAllocationState ()
Kembali |
---|
DeviceAllocationState | |
dapatkanAndroidId
public String getAndroidId (int userId)
Melempar |
---|
DeviceNotAvailableException | |
dapatkanAndroidIds
public getAndroidIds ()
Melempar |
---|
DeviceNotAvailableException | |
dapatkanApiLevel
public int getApiLevel ()
Melempar |
---|
DeviceNotAvailableException | |
getAppPackageInfo
public PackageInfo getAppPackageInfo (String packageName)
Parameter |
---|
packageName | String |
Melempar |
---|
DeviceNotAvailableException | |
getAppPackageInfos
public getAppPackageInfos ()
Melempar |
---|
DeviceNotAvailableException | |
getBasebandVersion
public String getBasebandVersion ()
Melempar |
---|
DeviceNotAvailableException | |
dapatkanBaterai
public Integer getBattery ()
getBooleanProperty
public boolean getBooleanProperty (String name,
boolean defaultValue)
Parameter |
---|
name | String |
defaultValue | boolean |
Melempar |
---|
DeviceNotAvailableException | |
dapatkanSejarahBoot
public getBootHistory ()
Melempar |
---|
DeviceNotAvailableException | |
getBootHistorySejak
public getBootHistorySince (long utcEpochTime,
TimeUnit timeUnit)
Parameter |
---|
utcEpochTime | long |
timeUnit | TimeUnit |
Melempar |
---|
DeviceNotAvailableException | |
getBootloaderVersion
public String getBootloaderVersion ()
Melempar |
---|
DeviceNotAvailableException | |
dapatkan laporan bug
public InputStreamSource getBugreport ()
Kembali |
---|
InputStreamSource | |
dapatkan Bugreportz
public InputStreamSource getBugreportz ()
Kembali |
---|
InputStreamSource | |
getBuildAlias
public String getBuildAlias ()
Melempar |
---|
DeviceNotAvailableException | |
getBuildFlavor
public String getBuildFlavor ()
Melempar |
---|
DeviceNotAvailableException | |
getBuildId
public String getBuildId ()
Melempar |
---|
DeviceNotAvailableException | |
getBuildSigningKeys
public String getBuildSigningKeys ()
Melempar |
---|
DeviceNotAvailableException | |
getCachedDeviceDescriptor
public DeviceDescriptor getCachedDeviceDescriptor ()
dapatkanAnak-anak
public String[] getChildren (String path)
Melempar |
---|
DeviceNotAvailableException | |
getCurrentFoldableState
public DeviceFoldableState getCurrentFoldableState ()
Kembali |
---|
DeviceFoldableState | |
Melempar |
---|
DeviceNotAvailableException | |
getCurrentUser
public int getCurrentUser ()
Melempar |
---|
DeviceNotAvailableException | |
dapatkanKelasPerangkat
public String getDeviceClass ()
getDeviceDate
public long getDeviceDate ()
Melempar |
---|
DeviceNotAvailableException | |
getDeviceDescriptor
public DeviceDescriptor getDeviceDescriptor ()
getDeviceState
public TestDeviceState getDeviceState ()
getDeviceTimeOffset
public long getDeviceTimeOffset (Date date)
Melempar |
---|
DeviceNotAvailableException | |
getEmulatorOutput
public InputStreamSource getEmulatorOutput ()
Kembali |
---|
InputStreamSource | |
getEmulatorProcess
public Process getEmulatorProcess ()
getExternalStoreFreeSpace
public long getExternalStoreFreeSpace ()
Melempar |
---|
DeviceNotAvailableException | |
getFastbootPath
public String getFastbootPath ()
getFastbootProductType
public String getFastbootProductType ()
Melempar |
---|
DeviceNotAvailableException | |
getFastbootProductVariant
public String getFastbootProductVariant ()
Melempar |
---|
DeviceNotAvailableException | |
getFastbootSerialNumber
public String getFastbootSerialNumber ()
getFastbootVariable
public String getFastbootVariable (String variableName)
Parameter |
---|
variableName | String |
Melempar |
---|
DeviceNotAvailableException | |
getFastbootVersion
public String getFastbootVersion ()
getFileEntry
public IFileEntry getFileEntry (String path)
Melempar |
---|
DeviceNotAvailableException | |
getFileEntry
public IFileEntry getFileEntry (FileListingService.FileEntry entry)
Helper tidak resmi untuk mendapatkan FileEntry
dari jalur non-root. FIXME: Memfaktorkan ulang sistem FileEntry agar tersedia dari jalur mana pun. (bahkan bukan root).
Parameter |
---|
entry | FileListingService.FileEntry : a FileEntry belum tentu akar sebagai Ddmlib membutuhkan. |
Melempar |
---|
DeviceNotAvailableException | |
getFoldableStates
public getFoldableStates ()
Melempar |
---|
DeviceNotAvailableException | |
getIdevice
public IDevice getIDevice ()
getInstalledPackageNames
public getInstalledPackageNames ()
Melempar |
---|
DeviceNotAvailableException | |
getIntProperty
public long getIntProperty (String name,
long defaultValue)
Parameter |
---|
name | String |
defaultValue | long |
Melempar |
---|
DeviceNotAvailableException | |
getIpAddress
public String getIpAddress ()
Melempar |
---|
DeviceNotAvailableException | |
getKeyguardState
public KeyguardControllerState getKeyguardState ()
Kembali |
---|
KeyguardControllerState | |
Melempar |
---|
DeviceNotAvailableException | |
getLastExpectedRebootTimeMillis
public long getLastExpectedRebootTimeMillis ()
dapatkanLaunchApiLevel
public int getLaunchApiLevel ()
Melempar |
---|
DeviceNotAvailableException | |
dapatkan Logcat
public InputStreamSource getLogcat ()
Kembali |
---|
InputStreamSource | |
dapatkan Logcat
public InputStreamSource getLogcat (int maxBytes)
Kembali |
---|
InputStreamSource | |
dapatkanLogcatDump
public InputStreamSource getLogcatDump ()
Kembali |
---|
InputStreamSource | |
getLogcatSejak
public InputStreamSource getLogcatSince (long date)
Kembali |
---|
InputStreamSource | |
getMacAddress
public String getMacAddress ()
getMainlineModuleInfo
public getMainlineModuleInfo ()
Melempar |
---|
DeviceNotAvailableException | |
public int getMaxNumberOfRunningUsersSupported ()
Melempar |
---|
DeviceNotAvailableException | |
public int getMaxNumberOfUsersSupported ()
Melempar |
---|
DeviceNotAvailableException | |
dapatkan monitor
public IDeviceStateMonitor getMonitor ()
Kembali |
---|
IDeviceStateMonitor | |
dapatkanMountPoint
public String getMountPoint (String mountName)
Parameter |
---|
mountName | String |
dapatkanMountPointInfo
public ITestDevice.MountPointInfo getMountPointInfo (String mountpoint)
Parameter |
---|
mountpoint | String |
Kembali |
---|
ITestDevice.MountPointInfo | |
Melempar |
---|
DeviceNotAvailableException | |
dapatkanMountPointInfo
public getMountPointInfo ()
Melempar |
---|
DeviceNotAvailableException | |
getOptions
public TestDeviceOptions getOptions ()
Kembali |
---|
TestDeviceOptions | |
getPartitionFreeSpace
public long getPartitionFreeSpace (String partition)
Parameter |
---|
partition | String |
Melempar |
---|
DeviceNotAvailableException | |
getPrimaryUserId
public Integer getPrimaryUserId ()
Melempar |
---|
DeviceNotAvailableException | |
getProcessByName
public ProcessInfo getProcessByName (String processName)
Parameter |
---|
processName | String |
Melempar |
---|
DeviceNotAvailableException | |
dapatkanProcessPid
public String getProcessPid (String process)
Melempar |
---|
DeviceNotAvailableException | |
getProductType
public String getProductType ()
Melempar |
---|
DeviceNotAvailableException | |
dapatkanVarian Produk
public String getProductVariant ()
Melempar |
---|
DeviceNotAvailableException | |
dapatkan Properti
public String getProperty (String name)
Melempar |
---|
DeviceNotAvailableException | |
dapatkanModePemulihan
public ITestDevice.RecoveryMode getRecoveryMode ()
Kembali |
---|
ITestDevice.RecoveryMode | |
dapatkan Tangkapan Layar
public InputStreamSource getScreenshot (String format)
Kembali |
---|
InputStreamSource | |
Melempar |
---|
DeviceNotAvailableException | |
dapatkan Tangkapan Layar
public InputStreamSource getScreenshot (long displayId)
Kembali |
---|
InputStreamSource | |
Melempar |
---|
DeviceNotAvailableException | |
dapatkan Tangkapan Layar
public InputStreamSource getScreenshot (String format,
boolean rescale)
Parameter |
---|
format | String |
rescale | boolean |
Kembali |
---|
InputStreamSource | |
Melempar |
---|
DeviceNotAvailableException | |
dapatkan Tangkapan Layar
public InputStreamSource getScreenshot ()
Kembali |
---|
InputStreamSource | |
Melempar |
---|
DeviceNotAvailableException | |
dapatkanSerialNumber
public String getSerialNumber ()
dapatkanSetelan
public String getSetting (int userId,
String namespace,
String key)
Parameter |
---|
userId | int |
namespace | String |
key | String |
Melempar |
---|
DeviceNotAvailableException | |
dapatkanSetelan
public String getSetting (String namespace,
String key)
Parameter |
---|
namespace | String |
key | String |
Melempar |
---|
DeviceNotAvailableException | |
getSimOperator
public String getSimOperator ()
dapatkanSimState
public String getSimState ()
dapatkan batu nisan
public getTombstones ()
Melempar |
---|
DeviceNotAvailableException | |
dapatkanTotalMemory
public long getTotalMemory ()
getUninstallablePackageNames
public getUninstallablePackageNames ()
Melempar |
---|
DeviceNotAvailableException | |
getUseFastbootErase
public boolean getUseFastbootErase ()
getUserFlags
public int getUserFlags (int userId)
Melempar |
---|
DeviceNotAvailableException | |
getUserInfos
public getUserInfos ()
Melempar |
---|
DeviceNotAvailableException | |
getUserSerialNumber
public int getUserSerialNumber (int userId)
Melempar |
---|
DeviceNotAvailableException | |
menanganiAlokasiAcara
public IManagedTestDevice.DeviceEventResponse handleAllocationEvent (DeviceEvent event)
Memproses DeviceEvent, yang mungkin atau mungkin tidak mentransisikan perangkat ini ke status alokasi baru.
Parameter |
---|
event | DeviceEvent |
Kembali |
---|
IManagedTestDevice.DeviceEventResponse | |
memilikiFitur
public boolean hasFeature (String feature)
Melempar |
---|
DeviceNotAvailableException | |
instalPaket
public String installPackage (File packageFile,
boolean reinstall,
String... extraArgs)
Parameter |
---|
packageFile | File |
reinstall | boolean |
extraArgs | String |
Melempar |
---|
DeviceNotAvailableException | |
instalPaket
public String installPackage (File packageFile,
boolean reinstall,
boolean grantPermissions,
String... extraArgs)
Parameter |
---|
packageFile | File |
reinstall | boolean |
grantPermissions | boolean |
extraArgs | String |
Melempar |
---|
DeviceNotAvailableException | |
installPackageForUser
public String installPackageForUser (File packageFile,
boolean reinstall,
int userId,
String... extraArgs)
Parameter |
---|
packageFile | File |
reinstall | boolean |
userId | int |
extraArgs | String |
Melempar |
---|
DeviceNotAvailableException | |
installPackageForUser
public String installPackageForUser (File packageFile,
boolean reinstall,
boolean grantPermissions,
int userId,
String... extraArgs)
Parameter |
---|
packageFile | File |
reinstall | boolean |
grantPermissions | boolean |
userId | int |
extraArgs | String |
Melempar |
---|
DeviceNotAvailableException | |
adalahAdbRoot
public boolean isAdbRoot ()
Melempar |
---|
DeviceNotAvailableException | |
adalahAdbTcp
public boolean isAdbTcp ()
isAppEnumeration Didukung
public boolean isAppEnumerationSupported ()
Melempar |
---|
DeviceNotAvailableException | |
isDeviceEncrypted
public boolean isDeviceEncrypted ()
Melempar |
---|
DeviceNotAvailableException | |
adalahDirektori
public boolean isDirectory (String path)
Melempar |
---|
DeviceNotAvailableException | |
isEnableAdbRoot
public boolean isEnableAdbRoot ()
Kembali |
---|
boolean | true jika akar adb harus diaktifkan pada perangkat |
adalahEnkripsi Didukung
public boolean isEncryptionSupported ()
Melempar |
---|
DeviceNotAvailableException | |
dapat dieksekusi
public boolean isExecutable (String fullPath)
Parameter |
---|
fullPath | String |
Melempar |
---|
DeviceNotAvailableException | |
isFastbootEnabled
public boolean isFastbootEnabled ()
isHeadless
public boolean isHeadless ()
Melempar |
---|
DeviceNotAvailableException | |
adalah MultiPengguna Didukung
public boolean isMultiUserSupported ()
Melempar |
---|
DeviceNotAvailableException | |
isPackageInstalled
public boolean isPackageInstalled (String packageName,
String userId)
Parameter |
---|
packageName | String |
userId | String |
Melempar |
---|
DeviceNotAvailableException | |
isPackageInstalled
public boolean isPackageInstalled (String packageName)
Parameter |
---|
packageName | String |
Melempar |
---|
DeviceNotAvailableException | |
isRuntimePermissionDidukung
public boolean isRuntimePermissionSupported ()
Melempar |
---|
DeviceNotAvailableException | |
isStateBootloaderOrFastbootd
public boolean isStateBootloaderOrFastbootd ()
adalahPenggunaBerjalan
public boolean isUserRunning (int userId)
Melempar |
---|
DeviceNotAvailableException | |
adalahPenggunaSekunder
public boolean isUserSecondary (int userId)
Melempar |
---|
DeviceNotAvailableException | |
adalahWifiEnabled
public boolean isWifiEnabled ()
Melempar |
---|
DeviceNotAvailableException | |
daftarDisplayIds
public listDisplayIds ()
Melempar |
---|
DeviceNotAvailableException | |
daftarPengguna
public listUsers ()
Melempar |
---|
DeviceNotAvailableException | |
logLaporan Bug
public boolean logBugreport (String dataName,
ITestLogger listener)
Parameter |
---|
dataName | String |
listener | ITestLogger |
masukPerangkat
public void logOnDevice (String tag,
Log.LogLevel level,
String format,
Object... args)
Parameter |
---|
tag | String |
level | Log.LogLevel |
format | String |
args | Object |
nonBlockingReboot
public void nonBlockingReboot ()
Melempar |
---|
DeviceNotAvailableException | |
postAdbRootAction
public void postAdbRootAction ()
Ganti jika perangkat memerlukan beberapa tindakan khusus yang harus diambil setelah adb root dan sebelum perangkat kembali online. Implementasi default tidak menyertakan tindakan tambahan apa pun. adb root tidak dijamin akan diaktifkan pada tahap ini.
Melempar |
---|
DeviceNotAvailableException | |
postAdbUnrootAction
public void postAdbUnrootAction ()
Ganti jika perangkat memerlukan beberapa tindakan khusus yang harus diambil setelah adb unroot dan sebelum perangkat kembali online. Implementasi default tidak menyertakan tindakan tambahan apa pun. adb root tidak dijamin dinonaktifkan pada tahap ini.
Melempar |
---|
DeviceNotAvailableException | |
postBootSetup
public void postBootSetup ()
Melempar |
---|
DeviceNotAvailableException | |
postDoaTearDown
public void postInvocationTearDown (Throwable exception)
Parameter |
---|
exception | Throwable |
praPemanggilanSetup
public void preInvocationSetup (IBuildInfo info,
MultiMap<String, String> attributes)
Parameter |
---|
info | IBuildInfo |
attributes | MultiMap |
Melempar |
---|
DeviceNotAvailableException | |
TargetSetupError | |
tarikDir
public boolean pullDir (String deviceFilePath,
File localDir)
Parameter |
---|
deviceFilePath | String |
localDir | File |
Melempar |
---|
DeviceNotAvailableException | |
tarikFile
public boolean pullFile (String remoteFilePath,
File localFile)
Parameter |
---|
remoteFilePath | String |
localFile | File |
Melempar |
---|
DeviceNotAvailableException | |
tarikFile
public File pullFile (String remoteFilePath)
Parameter |
---|
remoteFilePath | String |
Melempar |
---|
DeviceNotAvailableException | |
pullFileContents
public String pullFileContents (String remoteFilePath)
Parameter |
---|
remoteFilePath | String |
Melempar |
---|
DeviceNotAvailableException | |
pullFileFromExternal
public File pullFileFromExternal (String remoteFilePath)
Parameter |
---|
remoteFilePath | String |
Melempar |
---|
DeviceNotAvailableException | |
dorongDir
public boolean pushDir (File localFileDir,
String deviceFilePath,
excludedDirectories)
Parameter |
---|
localFileDir | File |
deviceFilePath | String |
excludedDirectories | |
Melempar |
---|
DeviceNotAvailableException | |
dorongDir
public boolean pushDir (File localFileDir,
String deviceFilePath)
Parameter |
---|
localFileDir | File |
deviceFilePath | String |
Melempar |
---|
DeviceNotAvailableException | |
file push
public boolean pushFile (File localFile,
String remoteFilePath)
Parameter |
---|
localFile | File |
remoteFilePath | String |
Melempar |
---|
DeviceNotAvailableException | |
pushString
public boolean pushString (String contents,
String remoteFilePath)
Parameter |
---|
contents | String |
remoteFilePath | String |
Melempar |
---|
DeviceNotAvailableException | |
menyalakan ulang
public void reboot (String reason)
Melempar |
---|
DeviceNotAvailableException | |
menyalakan ulang
public void reboot ()
Melempar |
---|
DeviceNotAvailableException | |
rebootIntoBootloader
public void rebootIntoBootloader ()
Melempar |
---|
DeviceNotAvailableException | |
rebootIntoFastbootd
public void rebootIntoFastbootd ()
Melempar |
---|
DeviceNotAvailableException | |
rebootIntoRecovery
public void rebootIntoRecovery ()
Melempar |
---|
DeviceNotAvailableException | |
rebootIntoSideload
public void rebootIntoSideload ()
Melempar |
---|
DeviceNotAvailableException | |
rebootIntoSideload
public void rebootIntoSideload (boolean autoReboot)
Parameter |
---|
autoReboot | boolean |
Melempar |
---|
DeviceNotAvailableException | |
rebootSampaiOnline
public void rebootUntilOnline ()
Melempar |
---|
DeviceNotAvailableException | |
rebootSampaiOnline
public void rebootUntilOnline (String reason)
Melempar |
---|
DeviceNotAvailableException | |
rebootUserspace
public void rebootUserspace ()
Melempar |
---|
DeviceNotAvailableException | |
rebootUserspaceSampaiOnline
public void rebootUserspaceUntilOnline ()
Melempar |
---|
DeviceNotAvailableException | |
pulihkanPerangkat
public void recoverDevice ()
Upaya untuk memulihkan komunikasi perangkat.
Melempar |
---|
DeviceNotAvailableException | jika perangkat tidak lagi tersedia |
remountSystemWritable
public void remountSystemWritable ()
Melempar |
---|
DeviceNotAvailableException | |
remountVendorWritable
public void remountVendorWritable ()
Melempar |
---|
DeviceNotAvailableException | |
hapusAdmin
public boolean removeAdmin (String componentName,
int userId)
Parameter |
---|
componentName | String |
userId | int |
Melempar |
---|
DeviceNotAvailableException | |
hapusPemilik
public void removeOwners ()
Melempar |
---|
DeviceNotAvailableException | |
hapusPengguna
public boolean removeUser (int userId)
Melempar |
---|
DeviceNotAvailableException | |
resetContentProviderSetup
public void resetContentProviderSetup ()
Setel ulang tanda untuk penyiapan penyedia konten untuk memicunya lagi.
jalankanInstrumentationTests
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner,
ITestLifeCycleReceiver... listeners)
Parameter |
---|
runner | IRemoteAndroidTestRunner |
listeners | ITestLifeCycleReceiver |
Melempar |
---|
DeviceNotAvailableException | |
jalankanInstrumentationTests
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner,
listeners)
Parameter |
---|
runner | IRemoteAndroidTestRunner |
listeners | |
Melempar |
---|
DeviceNotAvailableException | |
runInstrumentationTestsAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner,
int userId,
ITestLifeCycleReceiver... listeners)
Parameter |
---|
runner | IRemoteAndroidTestRunner |
userId | int |
listeners | ITestLifeCycleReceiver |
Melempar |
---|
DeviceNotAvailableException | |
runInstrumentationTestsAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner,
int userId,
listeners)
Parameter |
---|
runner | IRemoteAndroidTestRunner |
userId | int |
listeners | |
Melempar |
---|
DeviceNotAvailableException | |
setKonfigurasi
public void setConfiguration (IConfiguration configuration)
Menyuntikkan yang IConfiguration
digunakan.
Parameter |
---|
configuration | IConfiguration |
Atur tanggal
public void setDate (Date date)
Melempar |
---|
DeviceNotAvailableException | |
setPerangkatPemilik
public boolean setDeviceOwner (String componentName,
int userId)
Parameter |
---|
componentName | String |
userId | int |
Melempar |
---|
DeviceNotAvailableException | |
aturDeviceState
public void setDeviceState (TestDeviceState deviceState)
Parameter |
---|
deviceState | TestDeviceState |
setEmulatorProcess
public void setEmulatorProcess (Process p)
setFastbootEnabled
public void setFastbootEnabled (boolean fastbootEnabled)
Parameter |
---|
fastbootEnabled | boolean |
setFastbootPath
public void setFastbootPath (String fastbootPath)
Parameter |
---|
fastbootPath | String |
setIdevice
public void setIDevice (IDevice newDevice)
Parameter |
---|
newDevice | IDevice |
setPilihan
public void setOptions (TestDeviceOptions options)
Parameter |
---|
options | TestDeviceOptions |
setProperti
public boolean setProperty (String propKey,
String propValue)
Parameter |
---|
propKey | String |
propValue | String |
Melempar |
---|
DeviceNotAvailableException | |
set Pemulihan
public void setRecovery (IDeviceRecovery recovery)
Parameter |
---|
recovery | IDeviceRecovery |
atur Mode Pemulihan
public void setRecoveryMode (ITestDevice.RecoveryMode mode)
Parameter |
---|
mode | ITestDevice.RecoveryMode |
setSetelan
public void setSetting (String namespace,
String key,
String value)
Parameter |
---|
namespace | String |
key | String |
value | String |
Melempar |
---|
DeviceNotAvailableException | |
setSetelan
public void setSetting (int userId,
String namespace,
String key,
String value)
Parameter |
---|
userId | int |
namespace | String |
key | String |
value | String |
Melempar |
---|
DeviceNotAvailableException | |
setUseFastbootErase
public void setUseFastbootErase (boolean useFastbootErase)
Parameter |
---|
useFastbootErase | boolean |
mulaiLogcat
public void startLogcat ()
pengguna awal
public boolean startUser (int userId)
Melempar |
---|
DeviceNotAvailableException | |
pengguna awal
public boolean startUser (int userId,
boolean waitFlag)
Parameter |
---|
userId | int |
waitFlag | boolean |
Melempar |
---|
DeviceNotAvailableException | |
stopEmulatorOutput
public void stopEmulatorOutput ()
stopLogcat
public void stopLogcat ()
hentikanPengguna
public boolean stopUser (int userId)
Melempar |
---|
DeviceNotAvailableException | |
hentikanPengguna
public boolean stopUser (int userId,
boolean waitFlag,
boolean forceFlag)
Parameter |
---|
userId | int |
waitFlag | boolean |
forceFlag | boolean |
Melempar |
---|
DeviceNotAvailableException | |
beralihKeAdbTcp
public String switchToAdbTcp ()
Melempar |
---|
DeviceNotAvailableException | |
beralihKeAdbUsb
public boolean switchToAdbUsb ()
Melempar |
---|
DeviceNotAvailableException | |
beralihPengguna
public boolean switchUser (int userId)
Melempar |
---|
DeviceNotAvailableException | |
beralihPengguna
public boolean switchUser (int userId,
long timeout)
Parameter |
---|
userId | int |
timeout | long |
Melempar |
---|
DeviceNotAvailableException | |
syncFiles
public boolean syncFiles (File localFileDir,
String deviceFilePath)
Parameter |
---|
localFileDir | File |
deviceFilePath | String |
Melempar |
---|
DeviceNotAvailableException | |
ambil laporan bug
public Bugreport takeBugreport ()
hapus enkripsiPerangkat
public boolean unencryptDevice ()
Melempar |
---|
DeviceNotAvailableException | |
uninstallPaket
public String uninstallPackage (String packageName)
Parameter |
---|
packageName | String |
Melempar |
---|
DeviceNotAvailableException | |
uninstallPackageForUser
public String uninstallPackageForUser (String packageName,
int userId)
Parameter |
---|
packageName | String |
userId | int |
Melempar |
---|
DeviceNotAvailableException | |
buka kunci Perangkat
public boolean unlockDevice ()
Melempar |
---|
DeviceNotAvailableException | |
tungguBootSelesai
public boolean waitForBootComplete (long timeOut)
Melempar |
---|
DeviceNotAvailableException | |
tungguUntukPerangkatTersedia
public void waitForDeviceAvailable ()
Melempar |
---|
DeviceNotAvailableException | |
tungguUntukPerangkatTersedia
public void waitForDeviceAvailable (long waitTime)
Melempar |
---|
DeviceNotAvailableException | |
waitForDeviceInRecovery
public boolean waitForDeviceInRecovery (long waitTime)
waitForDeviceInSideload
public boolean waitForDeviceInSideload (long waitTime)
waitForDeviceNotAvailable
public boolean waitForDeviceNotAvailable (long waitTime)
waitForDeviceOnline
public void waitForDeviceOnline ()
Melempar |
---|
DeviceNotAvailableException | |
waitForDeviceOnline
public void waitForDeviceOnline (long waitTime)
Melempar |
---|
DeviceNotAvailableException | |
waitForDeviceShell
public boolean waitForDeviceShell (long waitTime)
Metode yang dilindungi
cekApiLevelAgainst
protected void checkApiLevelAgainst (String feature,
int strictMinLevel)
Parameter |
---|
feature | String |
strictMinLevel | int |
lakukanAdbReboot
protected void doAdbReboot (NativeDevice.RebootMode rebootMode,
String reason)
Lakukan reboot adb.
Parameter |
---|
rebootMode | NativeDevice.RebootMode : mode reboot ini. |
reason | String : reboot ini. |
Melempar |
---|
DeviceNotAvailableException | |
pastikanRuntimePermissionDidukung
protected void ensureRuntimePermissionSupported ()
metode pembantu untuk membuang pengecualian jika izin runtime tidak didukung
Melempar |
---|
DeviceNotAvailableException | |
getBugreportInternal
protected InputStreamSource getBugreportInternal ()
Kembali |
---|
InputStreamSource | |
getBugreportzInternal
protected File getBugreportzInternal ()
Metode internal Helper untuk mendapatkan file zip bugreportz sebagai ERROR(/File)
.
getRunUtil
protected IRunUtil getRunUtil ()
Dapatkan RunUtil
misalnya untuk digunakan.
internalGetProperty
protected String internalGetProperty (String propName,
String fastbootVar,
String description)
Ambil properti perangkat, dari cache ddmlib secara default, dan kembali ke `adb shell getprop` atau `fastboot getvar` tergantung pada apakah perangkat dalam Fastboot atau tidak.
Parameter |
---|
propName | String : Nama properti perangkat yang dikembalikan oleh `adb shell getprop` |
fastbootVar | String : Nama variabel fastboot setara dengan query. jika null , query fastboot tidak akan berusaha |
description | String : Sebuah gambaran sederhana dari variabel. Huruf pertama harus menggunakan huruf kapital. |
Kembali |
---|
String | Sebuah string, mungkin null atau kosong, yang berisi nilai properti yang diberikan |
Melempar |
---|
DeviceNotAvailableException | |
lebih baru
protected boolean isNewer (File localFile,
IFileEntry entry)
Kembali true
jika file lokal lebih baru dari file jarak jauh. IFileEntry
menjadi akurat ke menit, dalam kasus kali sama, file tersebut akan dipertimbangkan lebih baru.
Parameter |
---|
localFile | File |
entry | IFileEntry |
protected boolean performDeviceAction (String actionDescription,
com.android.tradefed.device.NativeDevice.DeviceAction action,
int retryAttempts)
Melakukan tindakan pada perangkat ini. Mencoba memulihkan perangkat dan secara opsional mencoba kembali perintah jika tindakan gagal.
Parameter |
---|
actionDescription | String : penjelasan singkat tentang tindakan yang akan dilakukan. Digunakan untuk tujuan logging saja. |
action | com.android.tradefed.device.NativeDevice.DeviceAction : tindakan yang akan dilakukan |
retryAttempts | int : upaya coba lagi untuk membuat tindakan jika gagal namun pemulihan berhasil |
Kembali |
---|
boolean | true jika tindakan berhasil dilakukan |
Melempar |
---|
DeviceNotAvailableException | jika upaya pemulihan gagal atau upaya maksimal dilakukan tanpa hasil |
postAdbReboot
protected void postAdbReboot ()
Kemungkinan tindakan tambahan yang dapat diambil setelah reboot.
Melempar |
---|
DeviceNotAvailableException | |
praPostBootSetup
protected void prePostBootSetup ()
Mengizinkan setiap jenis perangkat (AndroidNativeDevice, TestDevice) mengganti metode ini untuk penyiapan booting pos tertentu.
Melempar |
---|
DeviceNotAvailableException | |
atur jam
protected void setClock (Clock clock)
Setel instance Jam untuk digunakan.
setLogStartDelay
protected void setLogStartDelay (int delay)
Menyetel waktu dalam ms untuk menunggu sebelum memulai pengambilan logcat untuk perangkat online.
Parameter |
---|
delay | int : keterlambatan ms |
waitForDeviceNotAvailable
protected void waitForDeviceNotAvailable (String operationDesc,
long time)
Parameter |
---|
operationDesc | String |
time | long |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2021-10-04 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Informasi yang saya butuhkan tidak ada"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Terlalu rumit/langkahnya terlalu banyak"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Sudah usang"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"Masalah terjemahan"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Masalah kode / contoh"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Lainnya"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Mudah dipahami"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Memecahkan masalah saya"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Lainnya"
}]