Google berkomitmen untuk mendorong terwujudnya keadilan ras bagi komunitas Kulit Hitam. Lihat caranya.
Tetap teratur dengan koleksi Simpan dan kategorikan konten berdasarkan preferensi Anda.

Perangkat Inatif

public interface INativeDevice

com.android.tradefed.device.INativeDevice


Menyediakan API tingkat yang andal dan sedikit lebih tinggi ke ddmlib IDevice .

Mencoba kembali perintah perangkat untuk jumlah yang dapat dikonfigurasi, dan menyediakan antarmuka pemulihan perangkat untuk perangkat yang tidak responsif.

Ringkasan

Konstanta

int UNKNOWN_API_LEVEL

Nilai default saat API Level tidak dapat dideteksi

Metode publik

abstract boolean checkApiLevelAgainstNextRelease (int strictMinLevel)

Periksa apakah fitur saat ini didukung atau tidak dengan tingkat dukungan minimal.

abstract void clearLogcat ()

Menghapus semua data logcat yang terakumulasi.

abstract void deleteFile (String deviceFilePath)

Metode pembantu untuk menghapus file atau direktori pada perangkat.

abstract boolean deviceSoftRestarted ( ProcessInfo prevSystemServerProcess)

Metode pembantu untuk memeriksa apakah perangkat melakukan soft-restart dengan membandingkan system_server saat ini dengan system_server ProcessInfo sebelumnya.

abstract boolean deviceSoftRestartedSince (long utcEpochTime, TimeUnit timeUnit)

Metode pembantu untuk memeriksa apakah perangkat melakukan soft-restart sejak waktu UTC sejak zaman dari perangkat dan ERROR(/TimeUnit) .

abstract boolean disableAdbRoot ()

Mematikan adb root.

abstract boolean doesFileExist (String deviceFilePath)

Metode pembantu untuk menentukan apakah file pada perangkat ada.

abstract boolean enableAdbRoot ()

Mengaktifkan akar adb.

abstract String executeAdbCommand (long timeout, String... commandArgs)

Metode pembantu yang menjalankan perintah adb sebagai perintah sistem dengan batas waktu yang ditentukan.

abstract String executeAdbCommand (String... commandArgs)

Metode pembantu yang menjalankan perintah adb sebagai perintah sistem.

abstract CommandResult executeFastbootCommand (String... commandArgs)

Metode pembantu yang menjalankan perintah fastboot sebagai perintah sistem dengan batas waktu default 2 menit.

abstract CommandResult executeFastbootCommand (long timeout, String... commandArgs)

Metode pembantu yang menjalankan perintah fastboot sebagai perintah sistem.

abstract CommandResult executeLongFastbootCommand ( envVarMap, String... commandArgs) executeLongFastbootCommand ( envVarMap, String... commandArgs)

Metode pembantu yang mengeksekusi perintah fastboot yang berjalan lama sebagai perintah sistem dengan variabel lingkungan sistem.

abstract CommandResult executeLongFastbootCommand (String... commandArgs)

Metode pembantu yang menjalankan perintah fastboot yang berjalan lama sebagai perintah sistem.

abstract String executeShellCommand (String command)

Metode pembantu yang mengeksekusi perintah shell adb dan mengembalikan output sebagai String .

abstract void executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts)

Menjalankan perintah shell adb, dengan lebih banyak parameter untuk mengontrol perilaku perintah.

abstract void executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeoutForCommand, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts)

Menjalankan perintah shell adb, dengan lebih banyak parameter untuk mengontrol perilaku perintah.

abstract void executeShellCommand (String command, IShellOutputReceiver receiver)

Jalankan perintah adb shell yang diberikan, coba lagi beberapa kali jika perintah gagal.

abstract CommandResult executeShellV2Command (String command)

Metode pembantu yang menjalankan perintah shell adb dan mengembalikan hasilnya sebagai CommandResult yang diisi dengan benar dengan output status perintah, stdout dan stderr.

abstract CommandResult executeShellV2Command (String command, OutputStream pipeToOutput)

Metode pembantu yang menjalankan perintah adb shell dan mengembalikan hasilnya sebagai CommandResult yang diisi dengan benar dengan output status perintah dan stderr.

abstract CommandResult executeShellV2Command (String command, File pipeAsInput)

Metode pembantu yang menjalankan perintah adb shell dan mengembalikan hasilnya sebagai CommandResult yang diisi dengan benar dengan output status perintah, stdout dan stderr.

abstract CommandResult executeShellV2Command (String command, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)

Menjalankan perintah shell adb, dengan lebih banyak parameter untuk mengontrol perilaku perintah.

abstract CommandResult executeShellV2Command (String command, long maxTimeoutForCommand, TimeUnit timeUnit)

Menjalankan perintah shell adb, dengan lebih banyak parameter untuk mengontrol perilaku perintah.

abstract CommandResult executeShellV2Command (String command, File pipeAsInput, OutputStream pipeToOutput, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)

Menjalankan perintah shell adb, dengan lebih banyak parameter untuk mengontrol perilaku perintah.

abstract CommandResult executeShellV2Command (String command, File pipeAsInput, OutputStream pipeToOutput, OutputStream pipeToError, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)

Menjalankan perintah shell adb, dengan lebih banyak parameter untuk mengontrol perilaku perintah.

abstract CommandResult fastbootWipePartition (String partition)

Metode pembantu yang menghapus partisi untuk perangkat.

abstract int getApiLevel ()

Dapatkan Tingkat API perangkat.

abstract String getBasebandVersion ()

Metode kemudahan untuk mendapatkan versi baseband (radio) dari perangkat ini.

abstract Integer getBattery ()

Mengembalikan level baterai perangkat saat ini atau Null jika level baterai tidak tersedia.

abstract boolean getBooleanProperty (String name, boolean defaultValue)

Mengembalikan nilai boolean dari properti yang diberikan.

abstract getBootHistory ()

Metode Helper mengumpulkan peta riwayat boot dengan waktu boot dan alasan boot.

abstract getBootHistorySince (long utcEpochTime, TimeUnit timeUnit)

Metode Helper mengumpulkan peta riwayat boot dengan waktu boot dan alasan boot sejak waktu yang diberikan sejak Epoch dari perangkat dan unit waktu yang ditentukan.

abstract String getBootloaderVersion ()

Metode kemudahan untuk mendapatkan versi bootloader perangkat ini.

abstract InputStreamSource getBugreport ()

Mengambil laporan bug dari perangkat.

abstract InputStreamSource getBugreportz ()

Mengambil laporan bug dari perangkat.

abstract String getBuildAlias ()

Ambil alias build yang sedang dijalankan perangkat.

abstract String getBuildFlavor ()

Ambil rasa build untuk perangkat.

abstract String getBuildId ()

Ambil build yang sedang dijalankan perangkat.

abstract String getBuildSigningKeys ()

Mengembalikan jenis kunci yang digunakan untuk menandatangani gambar perangkat

Biasanya perangkat Android dapat ditandatangani dengan kunci uji (seperti di AOSP) atau kunci pelepas (dikendalikan oleh masing-masing produsen perangkat)

abstract DeviceDescriptor getCachedDeviceDescriptor ()

Mengembalikan DeviceDescriptor yang di-cache jika perangkat dialokasikan, jika tidak mengembalikan DeviceDescriptor saat ini.

abstract DeviceDescriptor getCachedDeviceDescriptor (boolean shortDescriptor)

Mengembalikan DeviceDescriptor yang di-cache jika perangkat dialokasikan, jika tidak mengembalikan DeviceDescriptor saat ini.

abstract String[] getChildren (String deviceFilePath)

Alternatif untuk menggunakan IFileEntry yang terkadang tidak berfungsi karena izin.

abstract String getDeviceClass ()

Dapatkan kelas perangkat.

abstract long getDeviceDate ()

Kembalikan tanggal perangkat dalam milidetik sejak zaman.

abstract DeviceDescriptor getDeviceDescriptor ()

Kembalikan DeviceDescriptor dari informasi perangkat untuk mendapatkan info tentangnya tanpa melewati objek perangkat yang sebenarnya.

abstract DeviceDescriptor getDeviceDescriptor (boolean shortDescriptor)

Kembalikan DeviceDescriptor dari informasi perangkat untuk mendapatkan info tentangnya tanpa melewati objek perangkat yang sebenarnya.

abstract TestDeviceState getDeviceState ()

Dapatkan status perangkat.

abstract long getDeviceTimeOffset (Date date)

Pembantu untuk mendapatkan perbedaan waktu antara perangkat dan ERROR(/Date) yang diberikan.

abstract InputStreamSource getEmulatorOutput ()

Dapatkan aliran emulator stdout dan stderr

abstract long getExternalStoreFreeSpace ()

Metode pembantu untuk menentukan jumlah ruang kosong pada penyimpanan eksternal perangkat.

abstract String getFastbootProductType ()

Metode kemudahan untuk mendapatkan jenis produk perangkat ini saat dalam mode fastboot.

abstract String getFastbootProductVariant ()

Metode kemudahan untuk mendapatkan jenis produk perangkat ini saat dalam mode fastboot.

abstract String getFastbootSerialNumber ()

Mengembalikan nomor seri mode fastboot.

abstract String getFastbootVariable (String variableName)

Ambil nilai variabel fastboot yang diberikan dari perangkat.

abstract IFileEntry getFileEntry (String path)

Ambil referensi ke file jarak jauh di perangkat.

abstract IDevice getIDevice ()

Mengembalikan referensi ke ddmlib IDevice terkait.

abstract long getIntProperty (String name, long defaultValue)

Mengembalikan nilai integer dari properti yang diberikan dari perangkat.

abstract long getLastExpectedRebootTimeMillis ()

Mengembalikan waktu terakhir Tradefed API memicu reboot dalam milidetik sejak EPOCH seperti yang dikembalikan oleh System.currentTimeMillis() .

abstract int getLaunchApiLevel ()

Dapatkan API Level pertama yang diluncurkan perangkat.

abstract InputStreamSource getLogcat ()

Mengambil aliran snapshot dari data logcat.

abstract InputStreamSource getLogcat (int maxBytes)

Mengambil aliran snapshot dari maxBytes terakhir dari data logcat yang diambil.

abstract InputStreamSource getLogcatDump ()

Dapatkan dump dari logcat saat ini untuk perangkat.

abstract InputStreamSource getLogcatSince (long date)

Mengambil aliran snapshot dari data logcat yang diambil mulai tanggal yang diberikan.

abstract String getMountPoint (String mountName)

Mengembalikan titik pemasangan.

abstract ITestDevice.MountPointInfo getMountPointInfo (String mountpoint)

Mengembalikan MountPointInfo yang sesuai dengan jalur mountpoint yang ditentukan, atau null jika jalur tersebut tidak memiliki apa pun yang dipasang atau tidak muncul di /proc/mounts sebagai titik mount.

abstract getMountPointInfo ()

Mengembalikan versi informasi yang diuraikan di /proc/mounts pada perangkat

abstract long getPartitionFreeSpace (String partition)

Metode pembantu untuk menentukan jumlah ruang kosong pada partisi perangkat.

abstract ProcessInfo getProcessByName (String processName)

Metode pembantu menjalankan perintah "pidof" dan "stat" dan mengembalikan objek ProcessInfo dengan PID dan waktu mulai proses dari proses yang diberikan.

abstract String getProcessPid (String process)

Mengembalikan pid layanan atau null jika terjadi kesalahan.

abstract String getProductType ()

Metode kemudahan untuk mendapatkan jenis produk perangkat ini.

abstract String getProductVariant ()

Metode kemudahan untuk mendapatkan varian produk perangkat ini.

abstract String getProperty (String name)

Ambil nilai properti yang diberikan dari perangkat.

abstract ITestDevice.RecoveryMode getRecoveryMode ()

Dapatkan mode pemulihan saat ini yang digunakan untuk perangkat.

abstract String getSerialNumber ()

Metode kemudahan untuk mendapatkan nomor seri perangkat ini.

abstract getTombstones ()

Ambil dan kembalikan daftar batu nisan dari perangkat.

abstract long getTotalMemory ()

Mengembalikan total ukuran memori fisik dalam byte atau -1 jika terjadi kesalahan internal

abstract boolean getUseFastbootErase ()

Dapatkan apakah akan menggunakan format fastboot erase atau fastboot untuk menghapus partisi pada perangkat.

abstract boolean isAdbRoot ()
abstract boolean isAdbTcp ()
abstract boolean isAppEnumerationSupported ()

Periksa apakah platform pada perangkat mendukung enumerasi aplikasi

abstract boolean isDeviceEncrypted ()

Kembali jika perangkat dienkripsi.

abstract boolean isDirectory (String deviceFilePath)

Kembalikan True jika jalur pada perangkat adalah direktori, false jika tidak.

abstract boolean isEncryptionSupported ()

Kembali jika enkripsi didukung pada perangkat.

abstract boolean isExecutable (String fullPath)

Mengembalikan True jika jalur file pada perangkat adalah file yang dapat dieksekusi, false jika tidak.

abstract boolean isHeadless ()

Kembalikan true jika perangkat tanpa kepala (tanpa layar), false jika tidak.

abstract boolean isRuntimePermissionSupported ()

Periksa apakah platform pada perangkat mendukung pemberian izin runtime

abstract boolean isStateBootloaderOrFastbootd ()

Mengembalikan nilai true jika perangkat dalam TestDeviceState#FASTBOOT atau TestDeviceState.FASTBOOTD .

abstract boolean logAnrs ( ITestLogger logger)

Mengumpulkan dan mencatat ANR dari perangkat.

abstract boolean logBugreport (String dataName, ITestLogger listener)

Metode pembantu untuk mengambil laporan bug dan mencatatnya ke reporter.

abstract void logOnDevice (String tag, Log.LogLevel level, String format, Object... args)

Catat pesan di logcat perangkat.

abstract void nonBlockingReboot ()

Mengeluarkan perintah untuk mem-boot ulang perangkat dan mengembalikan perintah selesai dan ketika perangkat tidak lagi terlihat oleh adb.

abstract void postBootSetup ()

Lakukan instruksi untuk mengonfigurasi perangkat untuk pengujian itu setelah setiap boot.

default void postInvocationTearDown ()

Metode ini tidak digunakan lagi. Gunakan postInvocationTearDown(Throwable) sebagai gantinya.

abstract void postInvocationTearDown (Throwable invocationException)

Langkah-langkah ekstra untuk pembersihan khusus perangkat yang diperlukan yang akan dijalankan setelah pemanggilan selesai.

default void preInvocationSetup ( IBuildInfo info, MultiMap <String, String> attributes)

Langkah ekstra untuk penyiapan khusus perangkat yang diperlukan yang akan dijalankan pada perangkat sebelum alur pemanggilan.

abstract boolean pullDir (String deviceFilePath, File localDir)

Tarik konten direktori secara rekursif dari perangkat.

abstract File pullFile (String remoteFilePath, int userId)

Mengambil file dari perangkat, menyimpannya di ERROR(/File) sementara lokal, dan mengembalikan File itu.

abstract File pullFile (String remoteFilePath)

Mengambil file dari perangkat, menyimpannya di ERROR(/File) sementara lokal, dan mengembalikan File itu.

abstract boolean pullFile (String remoteFilePath, File localFile)

Mengambil file dari perangkat.

abstract boolean pullFile (String remoteFilePath, File localFile, int userId)

Mengambil file dari perangkat.

abstract String pullFileContents (String remoteFilePath)

Mengambil file dari perangkat, dan mengembalikan isinya.

abstract File pullFileFromExternal (String remoteFilePath)

Metode praktis untuk mengambil file dari penyimpanan eksternal perangkat, menyimpannya di ERROR(/File) lokal sementara, dan mengembalikan referensi ke File itu.

abstract boolean pushDir (File localDir, String deviceFilePath, excludedDirectories) pushDir (File localDir, String deviceFilePath, excludedDirectories)

Dorong konten direktori secara rekursif ke perangkat sambil mengecualikan beberapa direktori yang difilter.

abstract boolean pushDir (File localDir, String deviceFilePath)

Dorong konten direktori secara rekursif ke perangkat.

abstract boolean pushFile (File localFile, String deviceFilePath, boolean evaluateContentProviderNeeded)

Varian dari pushFile(File, String) yang secara opsional dapat mempertimbangkan untuk mengevaluasi kebutuhan penyedia konten.

abstract boolean pushFile (File localFile, String deviceFilePath)

Dorong file ke perangkat.

abstract boolean pushString (String contents, String deviceFilePath)

Dorong file yang dibuat dari string ke perangkat

abstract void reboot ()

Reboot perangkat ke mode adb.

abstract void reboot (String reason)

Mem-boot ulang perangkat ke mode adb dengan reason tertentu untuk bertahan selama reboot.

abstract void rebootIntoBootloader ()

Reboot perangkat ke mode bootloader.

abstract void rebootIntoFastbootd ()

Reboot perangkat ke mode fastbootd.

abstract void rebootIntoRecovery ()

Reboot perangkat ke mode pemulihan adb.

abstract void rebootIntoSideload (boolean autoReboot)

Reboot perangkat ke mode sideload adb (perhatikan bahwa ini adalah mode khusus dalam pemulihan)

Memblokir hingga perangkat memasuki mode sideload

abstract void rebootIntoSideload ()

Reboot perangkat ke mode sideload adb (perhatikan bahwa ini adalah mode khusus dalam pemulihan)

Memblokir hingga perangkat memasuki mode sideload

abstract void rebootUntilOnline ()

Alternatif untuk reboot() yang hanya memblokir hingga perangkat online yaitu terlihat oleh adb.

abstract void rebootUntilOnline (String reason)

Alternatif untuk reboot() yang hanya memblokir hingga perangkat online yaitu terlihat oleh adb.

abstract void rebootUserspace ()

Reboot hanya bagian ruang pengguna perangkat.

abstract void rebootUserspaceUntilOnline ()

Alternatif untuk rebootUserspace() ()} yang hanya memblokir hingga perangkat online yaitu terlihat oleh adb.

abstract void remountSystemWritable ()

Jadikan partisi sistem pada perangkat dapat ditulis.

abstract void remountVendorWritable ()

Jadikan partisi vendor pada perangkat dapat ditulis.

abstract boolean runInstrumentationTests (IRemoteAndroidTestRunner runner, ITestLifeCycleReceiver... listeners)

Metode praktis untuk melakukan ERROR(/#runInstrumentationTests(com.android.ddmlib.testrunner.IRemoteAndroidTestRunner,Collection)) dengan satu atau beberapa listener yang diteruskan sebagai parameter.

abstract boolean runInstrumentationTests (IRemoteAndroidTestRunner runner, listeners) runInstrumentationTests (IRemoteAndroidTestRunner runner, listeners)

Menjalankan pengujian instrumentasi, dan menyediakan pemulihan perangkat.

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

Sama seperti ITestDevice#runInstrumentationTests(IRemoteAndroidTestRunner, ITestLifeCycleReceiver...) tetapi menjalankan pengujian untuk pengguna tertentu.

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

Sama seperti ERROR(ITestDevice#runInstrumentationTests(IRemoteAndroidTestRunner, Collection)/com.android.tradefed.device.ITestDevice#runInstrumentationTests(com.android.ddmlib.testrunner.IRemoteAndroidTestRunner,Collection) ITestDevice#runInstrumentationTests(IRemoteAndroidTestRunner, Collection)) untuk pengguna yang diberikan.

abstract void setDate (Date date)

Setel tanggal di perangkat

Catatan: pengaturan tanggal pada perangkat membutuhkan root

abstract void setOptions ( TestDeviceOptions options)

Atur TestDeviceOptions untuk perangkat

abstract boolean setProperty (String propKey, String propValue)

Menetapkan nilai properti yang diberikan pada perangkat.

abstract void setRecovery ( IDeviceRecovery recovery)

Setel IDeviceRecovery yang akan digunakan untuk perangkat ini.

abstract void setRecoveryMode ( ITestDevice.RecoveryMode mode)

Atur mode pemulihan saat ini yang akan digunakan untuk perangkat.

abstract void setUseFastbootErase (boolean useFastbootErase)

Setel apakah akan menggunakan format fastboot erase atau fastboot untuk menghapus partisi pada perangkat.

abstract void startLogcat ()

Mulai merekam output logcat dari perangkat di latar belakang.

abstract void stopEmulatorOutput ()

Tutup dan hapus keluaran emulator.

abstract void stopLogcat ()

Berhenti merekam keluaran logcat dari perangkat, dan buang data logcat yang saat ini disimpan.

abstract String switchToAdbTcp ()

Alihkan perangkat ke mode adb-over-tcp.

abstract boolean switchToAdbUsb ()

Alihkan perangkat ke adb melalui mode usb.

abstract boolean syncFiles (File localFileDir, String deviceFilePath)

Secara bertahap menyinkronkan konten direktori file lokal ke perangkat.

abstract Bugreport takeBugreport ()

Ambil laporan bug dan kembalikan ke dalam objek Bugreport untuk menanganinya.

abstract boolean unlockDevice ()

Membuka kunci perangkat jika perangkat dalam keadaan terenkripsi.

abstract boolean waitForBootComplete (long timeOut)

Memblokir hingga tanda booting lengkap perangkat disetel.

abstract boolean waitForDeviceAvailable ()

Menunggu perangkat menjadi responsif dan tersedia untuk pengujian.

abstract boolean waitForDeviceAvailable (long waitTime)

Menunggu perangkat menjadi responsif dan tersedia untuk pengujian.

abstract void waitForDeviceBootloader ()

Memblokir hingga perangkat terlihat melalui fastboot.

abstract boolean waitForDeviceInRecovery (long waitTime)

Memblokir perangkat agar berada dalam status 'pemulihan adb' (perhatikan ini berbeda dari IDeviceRecovery ).

abstract boolean waitForDeviceInSideload (long waitTime)

Memblokir perangkat agar berada dalam status 'adb sideload'

abstract boolean waitForDeviceNotAvailable (long waitTime)

Blok untuk perangkat tidak tersedia yaitu hilang dari adb

abstract void waitForDeviceOnline ()

Memblokir hingga perangkat terlihat melalui adb.

abstract void waitForDeviceOnline (long waitTime)

Memblokir hingga perangkat terlihat melalui adb.

abstract boolean waitForDeviceShell (long waitTime)

Menunggu perangkat responsif terhadap perintah shell adb dasar.

Konstanta

UNKNOWN_API_LEVEL

public static final int UNKNOWN_API_LEVEL

Nilai default saat API Level tidak dapat dideteksi

Nilai Konstan: -1 (0xffffffff)

Metode publik

checkApiLevelAgainstNextRelease

public abstract boolean checkApiLevelAgainstNextRelease (int strictMinLevel)

Periksa apakah fitur saat ini didukung atau tidak dengan tingkat dukungan minimal. Metode ini memperhitungkan fitur yang belum dirilis, sebelum level API dinaikkan.

Parameter
strictMinLevel int : Tingkat minimum ketat yang mendukung fitur tersebut.

Kembali
boolean Benar jika levelnya didukung. Salah sebaliknya.

Melempar
DeviceNotAvailableException

jelasLogcat

public abstract void clearLogcat ()

Menghapus semua data logcat yang terakumulasi.

Ini berguna untuk kasus ketika Anda ingin memastikan ITestDevice#getLogcat() hanya mengembalikan data log yang dihasilkan setelah titik tertentu (seperti setelah mem-flash build perangkat baru, dll).

menghapus berkas

public abstract void deleteFile (String deviceFilePath)

Metode pembantu untuk menghapus file atau direktori pada perangkat.

Parameter
deviceFilePath String : Jalur absolut file pada perangkat.

Melempar
DeviceNotAvailableException

perangkatSoftRestart

public abstract boolean deviceSoftRestarted (ProcessInfo prevSystemServerProcess)

Metode pembantu untuk memeriksa apakah perangkat melakukan soft-restart dengan membandingkan system_server saat ini dengan system_server ProcessInfo sebelumnya. Gunakan getProcessByName(String) untuk mendapatkan ProcessInfo .

Parameter
prevSystemServerProcess ProcessInfo : proses system_server sebelumnya ProcessInfo .

Kembali
boolean true jika perangkat melakukan soft-restart

Melempar
RuntimeException jika perangkat memiliki alasan boot yang tidak normal
DeviceNotAvailableException

perangkatSoftRestartedSejak

public abstract boolean deviceSoftRestartedSince (long utcEpochTime, 
                TimeUnit timeUnit)

Metode pembantu untuk memeriksa apakah perangkat melakukan soft-restart sejak waktu UTC sejak zaman dari perangkat dan ERROR(/TimeUnit) . Soft-Restart mengacu pada system_server yang dimulai ulang di luar hard reboot perangkat (misalnya: reboot yang diminta). Perangkat saat ini utcEpochTime di Milliseccond dapat diperoleh dengan metode getDeviceDate() .

Parameter
utcEpochTime long : waktu perangkat dalam detik sejak zaman.

timeUnit TimeUnit : unit waktu TimeUnit untuk utcEpochTime yang diberikan.

Kembali
boolean true jika perangkat melakukan soft-restart

Melempar
RuntimeException jika perangkat memiliki alasan boot yang tidak normal
DeviceNotAvailableException

nonaktifkanAdbRoot

public abstract boolean disableAdbRoot ()

Mematikan adb root.

Menonaktifkan adb root dapat menyebabkan perangkat terputus dari adb. Metode ini akan memblokir hingga perangkat tersedia.

Kembali
boolean true jika berhasil.

Melempar
DeviceNotAvailableException jika koneksi dengan perangkat terputus dan tidak dapat dipulihkan.

apakahFileAda?

public abstract boolean doesFileExist (String deviceFilePath)

Metode pembantu untuk menentukan apakah file pada perangkat ada.

Parameter
deviceFilePath String : jalur absolut file pada perangkat untuk diperiksa

Kembali
boolean true jika file ada, false jika tidak.

Melempar
DeviceNotAvailableException jika koneksi dengan perangkat terputus dan tidak dapat dipulihkan.

aktifkanAdbRoot

public abstract boolean enableAdbRoot ()

Mengaktifkan akar adb. Jika pengaturan "aktifkan-root" adalah "salah", akan mencatat pesan dan kembali tanpa mengaktifkan root.

Mengaktifkan adb root dapat menyebabkan perangkat terputus dari adb. Metode ini akan memblokir hingga perangkat tersedia.

Kembali
boolean true jika berhasil.

Melempar
DeviceNotAvailableException jika koneksi dengan perangkat terputus dan tidak dapat dipulihkan.

jalankanAdbCommand

public abstract String executeAdbCommand (long timeout, 
                String... commandArgs)

Metode pembantu yang menjalankan perintah adb sebagai perintah sistem dengan batas waktu yang ditentukan.

executeShellCommand(String) harus digunakan sedapat mungkin, karena metode itu memberikan deteksi dan kinerja kegagalan yang lebih baik.

Parameter
timeout long : waktu dalam milidetik sebelum perangkat dianggap tidak responsif, 0L tanpa batas waktu

commandArgs String : perintah adb dan argumen untuk dijalankan

Kembali
String stdout dari perintah. null jika perintah gagal dijalankan.

Melempar
DeviceNotAvailableException jika koneksi dengan perangkat terputus dan tidak dapat dipulihkan.

jalankanAdbCommand

public abstract String executeAdbCommand (String... commandArgs)

Metode pembantu yang menjalankan perintah adb sebagai perintah sistem.

executeShellCommand(String) harus digunakan sedapat mungkin, karena metode itu memberikan deteksi dan kinerja kegagalan yang lebih baik.

Parameter
commandArgs String : perintah adb dan argumen untuk dijalankan

Kembali
String stdout dari perintah. null jika perintah gagal dijalankan.

Melempar
DeviceNotAvailableException jika koneksi dengan perangkat terputus dan tidak dapat dipulihkan.

mengeksekusiFastbootCommand

public abstract CommandResult executeFastbootCommand (String... commandArgs)

Metode pembantu yang menjalankan perintah fastboot sebagai perintah sistem dengan batas waktu default 2 menit.

Diharapkan dapat digunakan saat perangkat sudah dalam mode fastboot.

Parameter
commandArgs String : perintah fastboot dan argumen untuk dijalankan

Kembali
CommandResult CommandResult yang berisi output dari perintah

Melempar
DeviceNotAvailableException jika koneksi dengan perangkat terputus dan tidak dapat dipulihkan.

mengeksekusiFastbootCommand

public abstract CommandResult executeFastbootCommand (long timeout, 
                String... commandArgs)

Metode pembantu yang menjalankan perintah fastboot sebagai perintah sistem.

Diharapkan dapat digunakan saat perangkat sudah dalam mode fastboot.

Parameter
timeout long : waktu dalam milidetik sebelum perintah berakhir

commandArgs String : perintah fastboot dan argumen untuk dijalankan

Kembali
CommandResult CommandResult yang berisi output dari perintah

Melempar
DeviceNotAvailableException jika koneksi dengan perangkat terputus dan tidak dapat dipulihkan.

mengeksekusiLongFastbootCommand

public abstract CommandResult executeLongFastbootCommand ( envVarMap, 
                String... commandArgs)

Metode pembantu yang mengeksekusi perintah fastboot yang berjalan lama sebagai perintah sistem dengan variabel lingkungan sistem.

Identik dengan executeFastbootCommand(String) kecuali menggunakan batas waktu yang lebih lama.

Parameter
envVarMap : variabel lingkungan sistem yang dijalankan oleh perintah fastboot

commandArgs String : perintah fastboot dan argumen untuk dijalankan

Kembali
CommandResult CommandResult yang berisi output dari perintah

Melempar
DeviceNotAvailableException jika koneksi dengan perangkat terputus dan tidak dapat dipulihkan.

mengeksekusiLongFastbootCommand

public abstract CommandResult executeLongFastbootCommand (String... commandArgs)

Metode pembantu yang menjalankan perintah fastboot yang berjalan lama sebagai perintah sistem.

Identik dengan executeFastbootCommand(String) kecuali menggunakan batas waktu yang lebih lama.

Parameter
commandArgs String : perintah fastboot dan argumen untuk dijalankan

Kembali
CommandResult CommandResult yang berisi output dari perintah

Melempar
DeviceNotAvailableException jika koneksi dengan perangkat terputus dan tidak dapat dipulihkan.

mengeksekusiShellCommand

public abstract String executeShellCommand (String command)

Metode pembantu yang mengeksekusi perintah shell adb dan mengembalikan output sebagai String .

Parameter
command String : perintah shell adb untuk dijalankan

Kembali
String keluaran cangkang

Melempar
DeviceNotAvailableException jika koneksi dengan perangkat terputus dan tidak dapat dipulihkan.

mengeksekusiShellCommand

public abstract void executeShellCommand (String command, 
                IShellOutputReceiver receiver, 
                long maxTimeToOutputShellResponse, 
                TimeUnit timeUnit, 
                int retryAttempts)

Menjalankan perintah shell adb, dengan lebih banyak parameter untuk mengontrol perilaku perintah.

Parameter
command String : perintah shell adb untuk dijalankan

receiver IShellOutputReceiver : IShellOutputReceiver untuk mengarahkan output shell ke.

maxTimeToOutputShellResponse long : jumlah waktu maksimum di mana perintah diizinkan untuk tidak mengeluarkan respons apa pun; unit seperti yang ditentukan dalam timeUnit

timeUnit TimeUnit : unit untuk maxTimeToOutputShellResponse

retryAttempts int : jumlah maksimum kali untuk mencoba kembali perintah jika gagal karena pengecualian. DeviceNotResponsiveException akan dilempar jika retryAttempts dilakukan tanpa hasil.

Melempar
DeviceNotAvailableException jika koneksi dengan perangkat terputus dan tidak dapat dipulihkan.

mengeksekusiShellCommand

public abstract void executeShellCommand (String command, 
                IShellOutputReceiver receiver, 
                long maxTimeoutForCommand, 
                long maxTimeToOutputShellResponse, 
                TimeUnit timeUnit, 
                int retryAttempts)

Menjalankan perintah shell adb, dengan lebih banyak parameter untuk mengontrol perilaku perintah.

Parameter
command String : perintah shell adb untuk dijalankan

receiver IShellOutputReceiver : IShellOutputReceiver untuk mengarahkan output shell ke.

maxTimeoutForCommand long : batas waktu maksimum untuk menyelesaikan perintah; unit seperti yang ditentukan dalam timeUnit

maxTimeToOutputShellResponse long : jumlah waktu maksimum di mana perintah diizinkan untuk tidak mengeluarkan respons apa pun; unit seperti yang ditentukan dalam timeUnit

timeUnit TimeUnit : unit untuk maxTimeToOutputShellResponse

retryAttempts int : jumlah maksimum kali untuk mencoba kembali perintah jika gagal karena pengecualian. DeviceNotResponsiveException akan dilempar jika retryAttempts dilakukan tanpa hasil.

Melempar
DeviceNotAvailableException jika koneksi dengan perangkat terputus dan tidak dapat dipulihkan.

mengeksekusiShellCommand

public abstract void executeShellCommand (String command, 
                IShellOutputReceiver receiver)

Jalankan perintah adb shell yang diberikan, coba lagi beberapa kali jika perintah gagal.

Bentuk sederhana dari executeShellCommand(String, com.android.ddmlib.IShellOutputReceiver, long, TimeUnit, int) dengan nilai default.

Parameter
command String : perintah shell adb untuk dijalankan

receiver IShellOutputReceiver : IShellOutputReceiver untuk mengarahkan output shell ke.

Melempar
DeviceNotAvailableException jika koneksi dengan perangkat terputus dan tidak dapat dipulihkan.

jalankanShellV2Command

public abstract CommandResult executeShellV2Command (String command)

Metode pembantu yang menjalankan perintah shell adb dan mengembalikan hasilnya sebagai CommandResult yang diisi dengan benar dengan output status perintah, stdout dan stderr.

Parameter
command String : Perintah yang harus dijalankan.

Kembali
CommandResult Hasilnya di CommandResult .

Melempar
DeviceNotAvailableException jika koneksi dengan perangkat terputus dan tidak dapat dipulihkan.

jalankanShellV2Command

public abstract CommandResult executeShellV2Command (String command, 
                OutputStream pipeToOutput)

Metode pembantu yang menjalankan perintah adb shell dan mengembalikan hasilnya sebagai CommandResult yang diisi dengan benar dengan output status perintah dan stderr. stdout diarahkan ke aliran yang ditentukan.

Parameter
command String : Perintah yang harus dijalankan.

pipeToOutput OutputStream : ERROR(/OutputStream) di mana output std akan dialihkan, atau null.

Kembali
CommandResult Hasilnya di CommandResult .

Melempar
DeviceNotAvailableException jika koneksi dengan perangkat terputus dan tidak dapat dipulihkan.

jalankanShellV2Command

public abstract CommandResult executeShellV2Command (String command, 
                File pipeAsInput)

Metode pembantu yang menjalankan perintah adb shell dan mengembalikan hasilnya sebagai CommandResult yang diisi dengan benar dengan output status perintah, stdout dan stderr.

Parameter
command String : Perintah yang harus dijalankan.

pipeAsInput File : ERROR(/File) yang akan disalurkan sebagai input ke perintah, atau null.

Kembali
CommandResult Hasilnya di CommandResult .

Melempar
DeviceNotAvailableException jika koneksi dengan perangkat terputus dan tidak dapat dipulihkan.

jalankanShellV2Command

public abstract CommandResult executeShellV2Command (String command, 
                long maxTimeoutForCommand, 
                TimeUnit timeUnit, 
                int retryAttempts)

Menjalankan perintah shell adb, dengan lebih banyak parameter untuk mengontrol perilaku perintah.

Parameter
command String : perintah shell adb untuk dijalankan

maxTimeoutForCommand long : batas waktu maksimum untuk menyelesaikan perintah; unit seperti yang ditentukan dalam timeUnit

timeUnit TimeUnit : unit untuk maxTimeToOutputShellResponse

retryAttempts int : jumlah maksimum kali untuk mencoba kembali perintah jika gagal karena pengecualian. DeviceNotResponsiveException akan dilempar jika retryAttempts dilakukan tanpa hasil.

Kembali
CommandResult

Melempar
DeviceNotAvailableException jika koneksi dengan perangkat terputus dan tidak dapat dipulihkan.

jalankanShellV2Command

public abstract CommandResult executeShellV2Command (String command, 
                long maxTimeoutForCommand, 
                TimeUnit timeUnit)

Menjalankan perintah shell adb, dengan lebih banyak parameter untuk mengontrol perilaku perintah.

Parameter
command String : perintah shell adb untuk dijalankan

maxTimeoutForCommand long : batas waktu maksimum untuk menyelesaikan perintah; unit seperti yang ditentukan dalam timeUnit

timeUnit TimeUnit : unit untuk maxTimeToOutputShellResponse

Kembali
CommandResult

Melempar
DeviceNotAvailableException jika koneksi dengan perangkat terputus dan tidak dapat dipulihkan.

jalankanShellV2Command

public abstract CommandResult executeShellV2Command (String command, 
                File pipeAsInput, 
                OutputStream pipeToOutput, 
                long maxTimeoutForCommand, 
                TimeUnit timeUnit, 
                int retryAttempts)

Menjalankan perintah shell adb, dengan lebih banyak parameter untuk mengontrol perilaku perintah.

Parameter
command String : perintah shell adb untuk dijalankan

pipeAsInput File : ERROR(/File) yang akan disalurkan sebagai input ke perintah, atau null.

pipeToOutput OutputStream : ERROR(/OutputStream) di mana output std akan dialihkan, atau null.

maxTimeoutForCommand long : batas waktu maksimum untuk menyelesaikan perintah; unit seperti yang ditentukan dalam timeUnit

timeUnit TimeUnit : unit untuk maxTimeToOutputShellResponse

retryAttempts int : jumlah maksimum kali untuk mencoba kembali perintah jika gagal karena pengecualian. DeviceNotResponsiveException akan dilempar jika retryAttempts dilakukan tanpa hasil.

Kembali
CommandResult

Melempar
DeviceNotAvailableException jika koneksi dengan perangkat terputus dan tidak dapat dipulihkan.

jalankanShellV2Command

public abstract CommandResult executeShellV2Command (String command, 
                File pipeAsInput, 
                OutputStream pipeToOutput, 
                OutputStream pipeToError, 
                long maxTimeoutForCommand, 
                TimeUnit timeUnit, 
                int retryAttempts)

Menjalankan perintah shell adb, dengan lebih banyak parameter untuk mengontrol perilaku perintah.

Parameter
command String : perintah shell adb untuk dijalankan

pipeAsInput File : ERROR(/File) yang akan disalurkan sebagai input ke perintah, atau null.

pipeToOutput OutputStream : ERROR(/OutputStream) di mana output std akan dialihkan, atau null.

pipeToError OutputStream : ERROR(/OutputStream) dimana std error akan dialihkan, atau null.

maxTimeoutForCommand long : batas waktu maksimum untuk menyelesaikan perintah; unit seperti yang ditentukan dalam timeUnit

timeUnit TimeUnit : unit untuk maxTimeToOutputShellResponse

retryAttempts int : jumlah maksimum kali untuk mencoba kembali perintah jika gagal karena pengecualian. DeviceNotResponsiveException akan dilempar jika retryAttempts dilakukan tanpa hasil.

Kembali
CommandResult

Melempar
DeviceNotAvailableException jika koneksi dengan perangkat terputus dan tidak dapat dipulihkan.

fastbootWipePartition

public abstract CommandResult fastbootWipePartition (String partition)

Metode pembantu yang menghapus partisi untuk perangkat.

Jika getUseFastbootErase() adalah true , maka fastboot erase akan digunakan untuk menghapus partisi. Perangkat kemudian harus membuat sistem file saat berikutnya perangkat melakukan booting. Jika tidak, format fastboot digunakan yang akan membuat sistem file baru di perangkat.

Diharapkan dapat digunakan saat perangkat sudah dalam mode fastboot.

Parameter
partition String : partisi yang akan dihapus

Kembali
CommandResult CommandResult yang berisi output dari perintah

Melempar
DeviceNotAvailableException jika koneksi dengan perangkat terputus dan tidak dapat dipulihkan.

dapatkanApiLevel

public abstract int getApiLevel ()

Dapatkan Tingkat API perangkat. Default ke UNKNOWN_API_LEVEL .

Kembali
int bilangan bulat yang menunjukkan API Level perangkat

Melempar
DeviceNotAvailableException

getBasebandVersion

public abstract String getBasebandVersion ()

Metode kemudahan untuk mendapatkan versi baseband (radio) dari perangkat ini. Mendapatkan versi radio adalah perangkat khusus, sehingga mungkin tidak mengembalikan informasi yang benar untuk semua perangkat. Metode ini bergantung pada properti gsm.version.baseband untuk mengembalikan informasi versi yang benar. Ini tidak akurat untuk beberapa perangkat CDMA dan versi yang ditampilkan di sini mungkin tidak cocok dengan versi yang dilaporkan dari fastboot dan mungkin tidak mengembalikan versi untuk radio CDMA. TL;DR metode ini hanya melaporkan versi yang akurat jika properti gsm.version.baseband sama dengan versi yang dikembalikan oleh fastboot getvar version-baseband .

Kembali
String versi String baseband atau null jika tidak dapat ditentukan (perangkat tidak memiliki radio atau string versi tidak dapat dibaca)

Melempar
DeviceNotAvailableException jika koneksi dengan perangkat terputus dan tidak dapat dipulihkan.

dapatkanBaterai

public abstract Integer getBattery ()

Mengembalikan level baterai perangkat saat ini atau Null jika level baterai tidak tersedia.

Kembali
Integer

getBooleanProperty

public abstract boolean getBooleanProperty (String name, 
                boolean defaultValue)

Mengembalikan nilai boolean dari properti yang diberikan.

Parameter
name String : nama properti

defaultValue boolean : nilai default untuk dikembalikan jika properti kosong atau tidak ada.

Kembali
boolean true jika properti memiliki nilai "1" , "y" , "yes" , "on" , atau "true" , false jika properti memiliki nilai "0" , "n" , "no" , "off" , "false" , atau defaultValue sebaliknya.

Melempar
DeviceNotAvailableException

dapatkanSejarahBoot

public abstract  getBootHistory ()

Metode Helper mengumpulkan peta riwayat boot dengan waktu boot dan alasan boot.

Kembali
Peta waktu boot (waktu UTC dalam detik sejak Epoch) dan alasan boot

Melempar
DeviceNotAvailableException

getBootHistorySejak

public abstract  getBootHistorySince (long utcEpochTime, 
                TimeUnit timeUnit)

Metode Helper mengumpulkan peta riwayat boot dengan waktu boot dan alasan boot sejak waktu yang diberikan sejak Epoch dari perangkat dan unit waktu yang ditentukan. Perangkat saat ini utcEpochTime dalam Milidetik dapat diperoleh dengan metode getDeviceDate() .

Parameter
utcEpochTime long : waktu perangkat sejak Epoch.

timeUnit TimeUnit : satuan waktu TimeUnit .

Kembali
Peta waktu boot (waktu UTC dalam detik sejak Epoch) dan alasan boot

Melempar
DeviceNotAvailableException

getBootloaderVersion

public abstract String getBootloaderVersion ()

Metode kemudahan untuk mendapatkan versi bootloader perangkat ini.

Akan mencoba mengambil versi bootloader dari status perangkat saat ini. (yaitu jika perangkat dalam mode fastboot, ia akan mencoba untuk mengambil versi dari fastboot)

Kembali
String versi bootloader String atau null jika tidak dapat ditemukan

Melempar
DeviceNotAvailableException jika koneksi dengan perangkat terputus dan tidak dapat dipulihkan.

dapatkan laporan bug

public abstract InputStreamSource getBugreport ()

Mengambil laporan bug dari perangkat.

Implementasi ini dijamin untuk terus bekerja pada perangkat tanpa sdcard (atau di mana sdcard belum terpasang).

Kembali
InputStreamSource InputStreamSource yang akan menghasilkan konten laporan bug sesuai permintaan. Jika terjadi kegagalan, InputStreamSource akan menghasilkan ERROR(/InputStream) kosong.

dapatkan Bugreportz

public abstract InputStreamSource getBugreportz ()

Mengambil laporan bug dari perangkat. Laporan bug format zip berisi laporan bug utama dan file log lainnya yang berguna untuk debugging.

Hanya didukung untuk 'versi adb' > 1.0.36

Kembali
InputStreamSource a InputStreamSource dari file zip yang berisi bugreportz, kembalikan null jika terjadi kegagalan.

getBuildAlias

public abstract String getBuildAlias ()

Ambil alias build yang sedang dijalankan perangkat.

Alias ​​​​pembuatan biasanya berupa string yang lebih mudah dibaca daripada id bangunan (biasanya angka untuk build Nexus). Misalnya, rilis final Android 4.2 memiliki alias build JDQ39, dan build id 573038

Kembali
String alias build atau mundur ke build id jika tidak dapat diambil

Melempar
DeviceNotAvailableException

getBuildFlavor

public abstract String getBuildFlavor ()

Ambil rasa build untuk perangkat.

Kembali
String build flavor atau null jika tidak dapat diambil

Melempar
DeviceNotAvailableException

getBuildId

public abstract String getBuildId ()

Ambil build yang sedang dijalankan perangkat.

Kembali
String id build atau IBuildInfo#UNKNOWN_BUILD_ID jika tidak dapat diambil

Melempar
DeviceNotAvailableException

getBuildSigningKeys

public abstract String getBuildSigningKeys ()

Mengembalikan jenis kunci yang digunakan untuk menandatangani gambar perangkat

Biasanya perangkat Android dapat ditandatangani dengan kunci uji (seperti di AOSP) atau kunci pelepas (dikendalikan oleh masing-masing produsen perangkat)

Kembali
String Kunci penandatanganan jika ditemukan, null sebaliknya.

Melempar
DeviceNotAvailableException

getCachedDeviceDescriptor

public abstract DeviceDescriptor getCachedDeviceDescriptor ()

Mengembalikan DeviceDescriptor yang di-cache jika perangkat dialokasikan, jika tidak mengembalikan DeviceDescriptor saat ini.

Kembali
DeviceDescriptor

getCachedDeviceDescriptor

public abstract DeviceDescriptor getCachedDeviceDescriptor (boolean shortDescriptor)

Mengembalikan DeviceDescriptor yang di-cache jika perangkat dialokasikan, jika tidak mengembalikan DeviceDescriptor saat ini.

Parameter
shortDescriptor boolean : Apakah atau tidak untuk membatasi deskriptor ke info minimal

Kembali
DeviceDescriptor

dapatkanAnak-anak

public abstract String[] getChildren (String deviceFilePath)

Alternatif untuk menggunakan IFileEntry yang terkadang tidak berfungsi karena izin.

Parameter
deviceFilePath String : adalah jalur pada perangkat tempat melakukan pencarian

Kembali
String[] Array string yang berisi semua file di jalur pada perangkat.

Melempar
DeviceNotAvailableException

dapatkanKelasPerangkat

public abstract String getDeviceClass ()

Dapatkan kelas perangkat.

Kembali
String kelas perangkat String .

getDeviceDate

public abstract long getDeviceDate ()

Kembalikan tanggal perangkat dalam milidetik sejak zaman.

Kembali
long tanggal perangkat dalam format zaman.

Melempar
DeviceNotAvailableException

getDeviceDescriptor

public abstract DeviceDescriptor getDeviceDescriptor ()

Kembalikan DeviceDescriptor dari informasi perangkat untuk mendapatkan info tentangnya tanpa melewati objek perangkat yang sebenarnya.

Kembali
DeviceDescriptor

getDeviceDescriptor

public abstract DeviceDescriptor getDeviceDescriptor (boolean shortDescriptor)

Kembalikan DeviceDescriptor dari informasi perangkat untuk mendapatkan info tentangnya tanpa melewati objek perangkat yang sebenarnya.

Parameter
shortDescriptor boolean : Apakah atau tidak untuk membatasi deskriptor ke info minimal

Kembali
DeviceDescriptor

getDeviceState

public abstract TestDeviceState getDeviceState ()

Dapatkan status perangkat.

Kembali
TestDeviceState

getDeviceTimeOffset

public abstract long getDeviceTimeOffset (Date date)

Pembantu untuk mendapatkan perbedaan waktu antara perangkat dan ERROR(/Date) yang diberikan. Gunakan waktu Epoch secara internal.

Parameter
date Date

Kembali
long perbedaan dalam milidetik

Melempar
DeviceNotAvailableException

getEmulatorOutput

public abstract InputStreamSource getEmulatorOutput ()

Dapatkan aliran emulator stdout dan stderr

Kembali
InputStreamSource keluaran emulator

dapatkanExternalStoreFreeSpace

public abstract long getExternalStoreFreeSpace ()

Metode pembantu untuk menentukan jumlah ruang kosong pada penyimpanan eksternal perangkat.

Kembali
long jumlah ruang kosong dalam KB

Melempar
DeviceNotAvailableException jika koneksi dengan perangkat terputus dan tidak dapat dipulihkan.

getFastbootProductType

public abstract String getFastbootProductType ()

Metode kemudahan untuk mendapatkan jenis produk perangkat ini saat dalam mode fastboot.

Metode ini hanya boleh digunakan jika perangkat harus dalam mode fastboot. Varian ini sedikit lebih aman daripada metode getProductType() generik dalam kasus ini, karena ITestDevice akan mengetahui untuk memulihkan perangkat ke fastboot jika perangkat dalam keadaan salah atau tidak responsif.

Kembali
String nama jenis produk String atau null jika tidak dapat ditentukan

Melempar
DeviceNotAvailableException jika koneksi dengan perangkat terputus dan tidak dapat dipulihkan.

getFastbootProductVariant

public abstract String getFastbootProductVariant ()

Metode kemudahan untuk mendapatkan jenis produk perangkat ini saat dalam mode fastboot.

Metode ini hanya boleh digunakan jika perangkat harus dalam mode fastboot. Varian ini sedikit lebih aman daripada metode getProductType() generik dalam kasus ini, karena ITestDevice akan mengetahui untuk memulihkan perangkat ke fastboot jika perangkat dalam keadaan salah atau tidak responsif.

Kembali
String nama jenis produk String atau null jika tidak dapat ditentukan

Melempar
DeviceNotAvailableException jika koneksi dengan perangkat terputus dan tidak dapat dipulihkan.

getFastbootSerialNumber

public abstract String getFastbootSerialNumber ()

Mengembalikan nomor seri mode fastboot.

Kembali
String

getFastbootVariable

public abstract String getFastbootVariable (String variableName)

Ambil nilai variabel fastboot yang diberikan dari perangkat.

Parameter
variableName String : nama variabel

Kembali
String nilai properti atau null jika tidak ada

Melempar
Pengecualian Operasi yang Tidak Didukung
DeviceNotAvailableException

getFileEntry

public abstract IFileEntry getFileEntry (String path)

Ambil referensi ke file jarak jauh di perangkat.

Parameter
path String : jalur file yang akan diambil. Dapat berupa jalur absolut atau jalur relatif terhadap '/'. (yaitu sintaks "/ sistem" dan "sistem" didukung)

Kembali
IFileEntry IFileEntry atau null jika file di path diberikan tidak dapat ditemukan

Melempar
DeviceNotAvailableException

getIdevice

public abstract IDevice getIDevice ()

Mengembalikan referensi ke ddmlib IDevice terkait.

IDevice baru dapat dialokasikan oleh DDMS setiap kali perangkat terputus dan terhubung kembali dari adb. Jadi penelepon tidak boleh menyimpan referensi ke IDevice , karena referensi itu bisa menjadi basi.

Kembali
IDevice perangkat IDevice

getIntProperty

public abstract long getIntProperty (String name, 
                long defaultValue)

Mengembalikan nilai integer dari properti yang diberikan dari perangkat.

Parameter
name String : nama properti

defaultValue long : nilai default untuk dikembalikan jika properti kosong atau tidak ada.

Kembali
long nilai properti atau defaultValue jika properti kosong, tidak ada, atau tidak memiliki nilai integer.

Melempar
DeviceNotAvailableException

getLastExpectedRebootTimeMillis

public abstract long getLastExpectedRebootTimeMillis ()

Mengembalikan waktu terakhir Tradefed API memicu reboot dalam milidetik sejak EPOCH seperti yang dikembalikan oleh System.currentTimeMillis() .

Kembali
long

dapatkanLaunchApiLevel

public abstract int getLaunchApiLevel ()

Dapatkan API Level pertama yang diluncurkan perangkat. Default ke UNKNOWN_API_LEVEL .

Kembali
int bilangan bulat yang menunjukkan API Level perangkat yang diluncurkan pertama kali

Melempar
DeviceNotAvailableException

dapatkan Logcat

public abstract InputStreamSource getLogcat ()

Mengambil aliran snapshot dari data logcat.

Bekerja dalam dua mode:

  • Jika logcat saat ini sedang ditangkap di latar belakang, akan mengembalikan hingga TestDeviceOptions.getMaxLogcatDataSize() byte dari konten saat ini dari tangkapan logcat latar belakang
  • Jika tidak, akan mengembalikan dump statis dari data logcat jika perangkat saat ini merespons

    Kembali
    InputStreamSource

  • dapatkan Logcat

    public abstract InputStreamSource getLogcat (int maxBytes)

    Mengambil aliran snapshot dari maxBytes terakhir dari data logcat yang diambil.

    Berguna untuk kasus-kasus ketika Anda ingin mengambil snapshot yang sering dari data logcat yang diambil tanpa menimbulkan penalti ruang disk yang berpotensi besar untuk mendapatkan seluruh snapshot getLogcat() .

    Parameter
    maxBytes int : the maximum amount of data to return. Should be an amount that can comfortably fit in memory

    Kembali
    InputStreamSource

    getLogcatDump

    public abstract InputStreamSource getLogcatDump ()

    Get a dump of the current logcat for device. Unlike getLogcat() , this method will always return a static dump of the logcat.

    Has the disadvantage that nothing will be returned if device is not reachable.

    Kembali
    InputStreamSource a InputStreamSource of the logcat data. An empty stream is returned if fail to capture logcat data.

    getLogcatSince

    public abstract InputStreamSource getLogcatSince (long date)

    Grabs a snapshot stream of captured logcat data starting the date provided. The time on the device should be used getDeviceDate() .

    Parameter
    date long : in millisecond since epoch format of when to start the snapshot until present. (can be be obtained using 'date +%s')

    Kembali
    InputStreamSource

    getMountPoint

    public abstract String getMountPoint (String mountName)

    Returns a mount point.

    Queries the device directly if the cached info in IDevice is not available.

    TODO: move this behavior to IDevice#getMountPoint(String)

    Parameter
    mountName String : the name of the mount point

    Kembali
    String the mount point or null

    getMountPointInfo

    public abstract ITestDevice.MountPointInfo getMountPointInfo (String mountpoint)

    Returns a MountPointInfo corresponding to the specified mountpoint path, or null if that path has nothing mounted or otherwise does not appear in /proc/mounts as a mountpoint.

    Parameter
    mountpoint String

    Kembali
    ITestDevice.MountPointInfo A ERROR(/List) of MountPointInfo containing the information in "/proc/mounts"

    Melempar
    DeviceNotAvailableException

    getMountPointInfo

    public abstract  getMountPointInfo ()

    Returns a parsed version of the information in /proc/mounts on the device

    Kembali
    A ERROR(/List) of MountPointInfo containing the information in "/proc/mounts"

    Melempar
    DeviceNotAvailableException

    getPartitionFreeSpace

    public abstract long getPartitionFreeSpace (String partition)

    Helper method to determine amount of free space on device partition.

    Parameter
    partition String

    Kembali
    long the amount of free space in KB

    Melempar
    DeviceNotAvailableException if connection with device is lost and cannot be recovered.

    getProcessByName

    public abstract ProcessInfo getProcessByName (String processName)

    Helper method runs the "pidof" and "stat" command and returns ProcessInfo object with PID and process start time of the given process.

    Parameter
    processName String : the proces name String.

    Kembali
    ProcessInfo ProcessInfo of given processName

    Melempar
    DeviceNotAvailableException

    getProcessPid

    public abstract String getProcessPid (String process)

    Returns the pid of the service or null if something went wrong.

    Parameter
    process String : The proces name String.

    Kembali
    String

    Melempar
    DeviceNotAvailableException

    getProductType

    public abstract String getProductType ()

    Convenience method to get the product type of this device.

    This method will work if device is in either adb or fastboot mode.

    Kembali
    String the String product type name. Will not be null

    Melempar
    DeviceNotAvailableException if connection with device is lost and cannot be recovered, or if product type can not be determined

    getProductVariant

    public abstract String getProductVariant ()

    Convenience method to get the product variant of this device.

    This method will work if device is in either adb or fastboot mode.

    Kembali
    String the String product variant name or null if it cannot be determined

    Melempar
    DeviceNotAvailableException if connection with device is lost and cannot be recovered.

    getProperty

    public abstract String getProperty (String name)

    Retrieve the given property value from the device.

    Parameter
    name String : the property name

    Kembali
    String the property value or null if it does not exist

    Melempar
    DeviceNotAvailableException

    getRecoveryMode

    public abstract ITestDevice.RecoveryMode getRecoveryMode ()

    Get the current recovery mode used for the device.

    Kembali
    ITestDevice.RecoveryMode the current recovery mode used for the device.

    getSerialNumber

    public abstract String getSerialNumber ()

    Convenience method to get serial number of this device.

    Kembali
    String the String serial number

    getTombstones

    public abstract  getTombstones ()

    Fetch and return the list of tombstones from the devices. Requires root.

    method is best-effort so if one tombstone fails to be pulled for any reason it will be missing from the list. Only a DeviceNotAvailableException will terminate the method early.

    Kembali
    A list of tombstone files, empty if no tombstone.

    Melempar
    DeviceNotAvailableException

    getTotalMemory

    public abstract long getTotalMemory ()

    Returns total physical memory size in bytes or -1 in case of internal error

    Kembali
    long

    getUseFastbootErase

    public abstract boolean getUseFastbootErase ()

    Get whether to use fastboot erase or fastboot format to wipe a partition on the device.

    Kembali
    boolean true if fastboot erase will be used or false if fastboot format will be used.

    isAdbRoot

    public abstract boolean isAdbRoot ()

    Kembali
    boolean true if device currently has adb root, false otherwise.

    Melempar
    DeviceNotAvailableException if connection with device is lost and cannot be recovered.

    isAdbTcp

    public abstract boolean isAdbTcp ()

    Kembali
    boolean true if device is connected to adb-over-tcp, false otherwise.

    isAppEnumerationSupported

    public abstract boolean isAppEnumerationSupported ()

    Check whether platform on device supports app enumeration

    Kembali
    boolean True if app enumeration is supported, false otherwise

    Melempar
    DeviceNotAvailableException

    isDeviceEncrypted

    public abstract boolean isDeviceEncrypted ()

    Returns if the device is encrypted.

    Kembali
    boolean true if the device is encrypted.

    Melempar
    DeviceNotAvailableException if connection with device is lost and cannot be recovered.

    isDirectory

    public abstract boolean isDirectory (String deviceFilePath)

    Return True if the path on the device is a directory, false otherwise.

    Parameter
    deviceFilePath String

    Kembali
    boolean

    Melempar
    DeviceNotAvailableException

    isEncryptionSupported

    public abstract boolean isEncryptionSupported ()

    Returns if encryption is supported on the device.

    Kembali
    boolean true if the device supports encryption.

    Melempar
    DeviceNotAvailableException

    isExecutable

    public abstract boolean isExecutable (String fullPath)

    Returns True if the file path on the device is an executable file, false otherwise.

    Parameter
    fullPath String

    Kembali
    boolean

    Melempar
    DeviceNotAvailableException

    isHeadless

    public abstract boolean isHeadless ()

    Return true if the device is headless (no screen), false otherwise.

    Kembali
    boolean

    Melempar
    DeviceNotAvailableException

    isRuntimePermissionSupported

    public abstract boolean isRuntimePermissionSupported ()

    Check whether platform on device supports runtime permission granting

    Kembali
    boolean True if runtime permission are supported, false otherwise.

    Melempar
    DeviceNotAvailableException

    isStateBootloaderOrFastbootd

    public abstract boolean isStateBootloaderOrFastbootd ()

    Returns true if device is in TestDeviceState#FASTBOOT or TestDeviceState.FASTBOOTD .

    Kembali
    boolean

    logAnrs

    public abstract boolean logAnrs (ITestLogger logger)

    Collects and log ANRs from the device.

    Parameter
    logger ITestLogger : an ITestLogger to log the ANRs.

    Kembali
    boolean True if the logging was successful, false otherwise.

    Melempar
    DeviceNotAvailableException

    logBugreport

    public abstract boolean logBugreport (String dataName, 
                    ITestLogger listener)

    Helper method to take a bugreport and log it to the reporters.

    Parameter
    dataName String : name under which the bugreport will be reported.

    listener ITestLogger : an ITestLogger to log the bugreport.

    Kembali
    boolean True if the logging was successful, false otherwise.

    logOnDevice

    public abstract void logOnDevice (String tag, 
                    Log.LogLevel level, 
                    String format, 
                    Object... args)

    Log a message in the logcat of the device. This is a safe call that will not throw even if the logging fails.

    Parameter
    tag String : The tag under which we log our message in the logcat.

    level Log.LogLevel : The debug level of the message in the logcat.

    format String : The message format.

    args Object : the args to be replaced via String.format().

    nonBlockingReboot

    public abstract void nonBlockingReboot ()

    Issues a command to reboot device and returns on command complete and when device is no longer visible to adb.

    Melempar
    DeviceNotAvailableException

    postBootSetup

    public abstract void postBootSetup ()

    Perform instructions to configure device for testing that after every boot.

    Should be called after device is fully booted/available

    In normal circumstances this method doesn't need to be called explicitly, as implementations should perform these steps automatically when performing a reboot.

    Where it may need to be called is when device reboots due to other events (eg when a fastboot update command has completed)

    Melempar
    DeviceNotAvailableException if connection with device is lost and cannot be recovered.

    postInvocationTearDown

    public void postInvocationTearDown ()

    This method is deprecated.
    Use postInvocationTearDown(Throwable) instead.

    Extra steps for device specific required clean up that will be executed after the invocation is done.

    postInvocationTearDown

    public abstract void postInvocationTearDown (Throwable invocationException)

    Extra steps for device specific required clean up that will be executed after the invocation is done.

    Parameter
    invocationException Throwable : if any, the final exception raised by the invocation failure.

    preInvocationSetup

    public void preInvocationSetup (IBuildInfo info, 
                    MultiMap<String, String> attributes)

    Extra steps for device specific required setup that will be executed on the device prior to the invocation flow.

    Parameter
    info IBuildInfo : The IBuildInfo of the device.

    attributes MultiMap : The attributes stored in the invocation context

    Melempar
    com.android.tradefed.targetprep.TargetSetupError
    DeviceNotAvailableException
    TargetSetupError

    pullDir

    public abstract boolean pullDir (String deviceFilePath, 
                    File localDir)

    Recursively pull directory contents from device.

    Parameter
    deviceFilePath String : the absolute file path of the remote source

    localDir File : the local directory to pull files into

    Kembali
    boolean true if file was pulled successfully. false otherwise.

    Melempar
    DeviceNotAvailableException if connection with device is lost and cannot be recovered.

    pullFile

    public abstract File pullFile (String remoteFilePath, 
                    int userId)

    Retrieves a file off device, stores it in a local temporary ERROR(/File) , and returns that File .

    Parameter
    remoteFilePath String : the absolute path to file on device.

    userId int : The user id to pull from

    Kembali
    File A ERROR(/File) containing the contents of the device file, or null if the copy failed for any reason (including problems with the host filesystem)

    Melempar
    DeviceNotAvailableException if connection with device is lost and cannot be recovered.

    pullFile

    public abstract File pullFile (String remoteFilePath)

    Retrieves a file off device, stores it in a local temporary ERROR(/File) , and returns that File .

    Parameter
    remoteFilePath String : the absolute path to file on device.

    Kembali
    File A ERROR(/File) containing the contents of the device file, or null if the copy failed for any reason (including problems with the host filesystem)

    Melempar
    DeviceNotAvailableException if connection with device is lost and cannot be recovered.

    pullFile

    public abstract boolean pullFile (String remoteFilePath, 
                    File localFile)

    Retrieves a file off device.

    Parameter
    remoteFilePath String : the absolute path to file on device.

    localFile File : the local file to store contents in. If non-empty, contents will be replaced.

    Kembali
    boolean true if file was retrieved successfully. false otherwise.

    Melempar
    DeviceNotAvailableException if connection with device is lost and cannot be recovered.

    pullFile

    public abstract boolean pullFile (String remoteFilePath, 
                    File localFile, 
                    int userId)

    Retrieves a file off device.

    Parameter
    remoteFilePath String : the absolute path to file on device.

    localFile File : the local file to store contents in. If non-empty, contents will be replaced.

    userId int : The user id to pull from

    Kembali
    boolean true if file was retrieved successfully. false otherwise.

    Melempar
    DeviceNotAvailableException if connection with device is lost and cannot be recovered.

    pullFileContents

    public abstract String pullFileContents (String remoteFilePath)

    Retrieves a file off device, and returns the contents.

    Parameter
    remoteFilePath String : the absolute path to file on device.

    Kembali
    String A String containing the contents of the device file, or null if the copy failed for any reason (including problems with the host filesystem)

    Melempar
    DeviceNotAvailableException

    pullFileFromExternal

    public abstract File pullFileFromExternal (String remoteFilePath)

    A convenience method to retrieve a file from the device's external storage, stores it in a local temporary ERROR(/File) , and return a reference to that File .

    Parameter
    remoteFilePath String : the path to file on device, relative to the device's external storage mountpoint

    Kembali
    File A ERROR(/File) containing the contents of the device file, or null if the copy failed for any reason (including problems with the host filesystem)

    Melempar
    DeviceNotAvailableException if connection with device is lost and cannot be recovered.

    pushDir

    public abstract boolean pushDir (File localDir, 
                    String deviceFilePath, 
                     excludedDirectories)

    Recursively push directory contents to device while excluding some directories that are filtered.

    Parameter
    localDir File : the local directory to push

    deviceFilePath String : the absolute file path of the remote destination

    excludedDirectories : Set of excluded directories names that shouldn't be pushed.

    Kembali
    boolean true if file was pushed successfully. false otherwise.

    Melempar
    DeviceNotAvailableException if connection with device is lost and cannot be recovered.

    pushDir

    public abstract boolean pushDir (File localDir, 
                    String deviceFilePath)

    Recursively push directory contents to device.

    Parameter
    localDir File : the local directory to push

    deviceFilePath String : the absolute file path of the remote destination

    Kembali
    boolean true if file was pushed successfully. false otherwise.

    Melempar
    DeviceNotAvailableException if connection with device is lost and cannot be recovered.

    pushFile

    public abstract boolean pushFile (File localFile, 
                    String deviceFilePath, 
                    boolean evaluateContentProviderNeeded)

    Variant of pushFile(File, String) which can optionally consider evaluating the need for the content provider.

    Parameter
    localFile File : the local file to push

    deviceFilePath String : the remote destination absolute file path

    evaluateContentProviderNeeded boolean : whether to check if we need the content provider

    Kembali
    boolean true if file was pushed successfully. false otherwise.

    Melempar
    DeviceNotAvailableException if connection with device is lost and cannot be recovered.

    pushFile

    public abstract boolean pushFile (File localFile, 
                    String deviceFilePath)

    Push a file to device. By default using a content provider.

    Parameter
    localFile File : the local file to push

    deviceFilePath String : the remote destination absolute file path

    Kembali
    boolean true if file was pushed successfully. false otherwise.

    Melempar
    DeviceNotAvailableException if connection with device is lost and cannot be recovered.

    pushString

    public abstract boolean pushString (String contents, 
                    String deviceFilePath)

    Push file created from a string to device

    Parameter
    contents String : the contents of the file to push

    deviceFilePath String : the remote destination absolute file path

    Kembali
    boolean true if string was pushed successfully. false otherwise.

    Melempar
    DeviceNotAvailableException if connection with device is lost and cannot be recovered.

    reboot

    public abstract void reboot ()

    Reboots the device into adb mode.

    Blocks until device becomes available.

    Melempar
    DeviceNotAvailableException if device is not available after reboot

    reboot

    public abstract void reboot (String reason)

    Reboots the device into adb mode with given reason to be persisted across reboot.

    Blocks until device becomes available.

    Last reboot reason can be obtained by querying sys.boot.reason propety.

    Parameter
    reason String : a reason for this reboot, or null if no reason is specified.

    Melempar
    DeviceNotAvailableException if device is not available after reboot

    rebootIntoBootloader

    public abstract void rebootIntoBootloader ()

    Reboots the device into bootloader mode.

    Blocks until device is in bootloader mode.

    Melempar
    DeviceNotAvailableException if connection with device is lost and cannot be recovered.

    rebootIntoFastbootd

    public abstract void rebootIntoFastbootd ()

    Reboots the device into fastbootd mode.

    Blocks until device is in fastbootd mode.

    Melempar
    DeviceNotAvailableException if connection with device is lost and cannot be recovered.

    rebootIntoRecovery

    public abstract void rebootIntoRecovery ()

    Reboots the device into adb recovery mode.

    Blocks until device enters recovery

    Melempar
    DeviceNotAvailableException if device is not available after reboot

    rebootIntoSideload

    public abstract void rebootIntoSideload (boolean autoReboot)

    Reboots the device into adb sideload mode (note that this is a special mode under recovery)

    Blocks until device enters sideload mode

    Parameter
    autoReboot boolean : whether to automatically reboot the device after sideload

    Melempar
    DeviceNotAvailableException if device is not in sideload after reboot

    rebootIntoSideload

    public abstract void rebootIntoSideload ()

    Reboots the device into adb sideload mode (note that this is a special mode under recovery)

    Blocks until device enters sideload mode

    Melempar
    DeviceNotAvailableException if device is not in sideload after reboot

    rebootUntilOnline

    public abstract void rebootUntilOnline ()

    An alternate to reboot() that only blocks until device is online ie visible to adb.

    Melempar
    DeviceNotAvailableException if device is not available after reboot

    rebootUntilOnline

    public abstract void rebootUntilOnline (String reason)

    An alternate to reboot() that only blocks until device is online ie visible to adb.

    Parameter
    reason String : a reason for this reboot, or null if no reason is specified.

    Melempar
    DeviceNotAvailableException if device is not available after reboot

    See also:

    rebootUserspace

    public abstract void rebootUserspace ()

    Reboots only userspace part of device.

    Blocks until device becomes available.

    WARNING. Userspace reboot is currently under active development, use it on your own risk.

    Melempar
    DeviceNotAvailableException if device is not available after reboot

    rebootUserspaceUntilOnline

    public abstract void rebootUserspaceUntilOnline ()

    An alternate to rebootUserspace() ()} that only blocks until device is online ie visible to adb.

    Melempar
    DeviceNotAvailableException if device is not available after reboot

    remountSystemWritable

    public abstract void remountSystemWritable ()

    Make the system partition on the device writable. May reboot the device.

    Melempar
    DeviceNotAvailableException

    remountVendorWritable

    public abstract void remountVendorWritable ()

    Make the vendor partition on the device writable. May reboot the device.

    Melempar
    DeviceNotAvailableException

    runInstrumentationTests

    public abstract boolean runInstrumentationTests (IRemoteAndroidTestRunner runner, 
                    ITestLifeCycleReceiver... listeners)

    Convenience method for performing ERROR(/#runInstrumentationTests(com.android.ddmlib.testrunner.IRemoteAndroidTestRunner,Collection)) with one or more listeners passed as parameters.

    Parameter
    runner IRemoteAndroidTestRunner : the IRemoteAndroidTestRunner which runs the tests

    listeners ITestLifeCycleReceiver : the test result listener(s)

    Kembali
    boolean true if test command completed. false if it failed to complete, but recovery succeeded

    Melempar
    DeviceNotAvailableException if connection with device is lost and cannot be recovered. ie test command failed to complete and recovery failed.

    runInstrumentationTests

    public abstract boolean runInstrumentationTests (IRemoteAndroidTestRunner runner, 
                     listeners)

    Runs instrumentation tests, and provides device recovery.

    If connection with device is lost before test run completes, and recovery succeeds, all listeners will be informed of testRunFailed and "false" will be returned. The test command will not be rerun. It is left to callers to retry if necessary.

    If connection with device is lost before test run completes, and recovery fails, all listeners will be informed of testRunFailed and DeviceNotAvailableException will be thrown.

    Parameter
    runner IRemoteAndroidTestRunner : the IRemoteAndroidTestRunner which runs the tests

    listeners : the test result listeners

    Kembali
    boolean true if test command completed. false if it failed to complete due to device communication exception, but recovery succeeded

    Melempar
    DeviceNotAvailableException if connection with device is lost and cannot be recovered. ie test command failed to complete and recovery failed.

    runInstrumentationTestsAsUser

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

    Same as ITestDevice#runInstrumentationTests(IRemoteAndroidTestRunner, ITestLifeCycleReceiver...) but runs the test for a given user.

    Parameter
    runner IRemoteAndroidTestRunner

    userId int

    listeners ITestLifeCycleReceiver

    Kembali
    boolean

    Melempar
    DeviceNotAvailableException

    runInstrumentationTestsAsUser

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

    Same as ERROR(ITestDevice#runInstrumentationTests(IRemoteAndroidTestRunner, Collection)/com.android.tradefed.device.ITestDevice#runInstrumentationTests(com.android.ddmlib.testrunner.IRemoteAndroidTestRunner,Collection) ITestDevice#runInstrumentationTests(IRemoteAndroidTestRunner, Collection)) but runs the test for the given user.

    Parameter
    runner IRemoteAndroidTestRunner

    userId int

    listeners

    Kembali
    boolean

    Melempar
    DeviceNotAvailableException

    setDate

    public abstract void setDate (Date date)

    Sets the date on device

    Note: setting date on device requires root

    Parameter
    date Date : specify a particular date; will use host date if null

    Melempar
    DeviceNotAvailableException

    setOptions

    public abstract void setOptions (TestDeviceOptions options)

    Set the TestDeviceOptions for the device

    Parameter
    options TestDeviceOptions

    setProperty

    public abstract boolean setProperty (String propKey, 
                    String propValue)

    Sets the given property value on the device. Requires adb root is true.

    Parameter
    propKey String : The key targeted to be set.

    propValue String : The property value to be set.

    Kembali
    boolean returns True if the setprop command was successful, False otherwise.

    Melempar
    DeviceNotAvailableException

    setRecovery

    public abstract void setRecovery (IDeviceRecovery recovery)

    Set the IDeviceRecovery to use for this device. Should be set when device is first allocated.

    Parameter
    recovery IDeviceRecovery : the IDeviceRecovery

    setRecoveryMode

    public abstract void setRecoveryMode (ITestDevice.RecoveryMode mode)

    Set the current recovery mode to use for the device.

    Used to control what recovery method to use when a device communication problem is encountered. Its recommended to only use this method sparingly when needed (for example, when framework is down, etc

    Parameter
    mode ITestDevice.RecoveryMode : whether 'recover till online only' mode should be on or not.

    setUseFastbootErase

    public abstract void setUseFastbootErase (boolean useFastbootErase)

    Set whether to use fastboot erase or fastboot format to wipe a partition on the device.

    Parameter
    useFastbootErase boolean : true if fastboot erase should be used or false if fastboot format should be used.

    startLogcat

    public abstract void startLogcat ()

    Start capturing logcat output from device in the background.

    Will have no effect if logcat output is already being captured. Data can be later retrieved via getLogcat.

    When the device is no longer in use, stopLogcat() must be called.

    startLogcat() and stopLogcat() do not normally need to be called when within a TF invocation context, as the TF framework will start and stop logcat.

    stopEmulatorOutput

    public abstract void stopEmulatorOutput ()

    Close and delete the emulator output.

    stopLogcat

    public abstract void stopLogcat ()

    Stop capturing logcat output from device, and discard currently saved logcat data.

    Will have no effect if logcat output is not being captured.

    switchToAdbTcp

    public abstract String switchToAdbTcp ()

    Switch device to adb-over-tcp mode.

    Kembali
    String the tcp serial number or null if device could not be switched

    Melempar
    DeviceNotAvailableException

    switchToAdbUsb

    public abstract boolean switchToAdbUsb ()

    Switch device to adb over usb mode.

    Kembali
    boolean true if switch was successful, false otherwise.

    Melempar
    DeviceNotAvailableException

    syncFiles

    public abstract boolean syncFiles (File localFileDir, 
                    String deviceFilePath)

    Incrementally syncs the contents of a local file directory to device.

    Decides which files to push by comparing timestamps of local files with their remote equivalents. Only 'newer' or non-existent files will be pushed to device. Thus overhead should be relatively small if file set on device is already up to date.

    Hidden files (with names starting with ".") will be ignored.

    Example usage: syncFiles("/tmp/files", "/sdcard") will created a /sdcard/files directory if it doesn't already exist, and recursively push the /tmp/files contents to /sdcard/files.

    Parameter
    localFileDir File : the local file directory containing files to recursively push.

    deviceFilePath String : the remote destination absolute file path root. All directories in thos file path must be readable. ie pushing to /data/local/tmp when adb is not root will fail

    Kembali
    boolean true if files were synced successfully. false otherwise.

    Melempar
    DeviceNotAvailableException if connection with device is lost and cannot be recovered.

    takeBugreport

    public abstract Bugreport takeBugreport ()

    Take a bugreport and returns it inside a Bugreport object to handle it. Return null in case of issue.

    File referenced in the Bugreport object need to be cleaned via Bugreport#close() .

    Kembali
    Bugreport

    unlockDevice

    public abstract boolean unlockDevice ()

    Unlocks the device if the device is in an encrypted state.

    This method may restart the framework but will not call postBootSetup() . Therefore, the device might not be fully ready to be tested when this method returns.

    Kembali
    boolean true if successful or if the device is unencrypted.

    Melempar
    DeviceNotAvailableException if connection with device is lost and cannot be recovered.
    UnsupportedOperationException if encryption is not supported on the device.

    waitForBootComplete

    public abstract boolean waitForBootComplete (long timeOut)

    Blocks until the device's boot complete flag is set.

    Parameter
    timeOut long : time in msecs to wait for the flag to be set

    Kembali
    boolean true if device's boot complete flag is set within the timeout

    Melempar
    DeviceNotAvailableException

    waitForDeviceAvailable

    public abstract boolean waitForDeviceAvailable ()

    Waits for the device to be responsive and available for testing. Uses default timeout.

    Kembali
    boolean True if device is available, False if recovery is disabled and unavailable.

    Melempar
    DeviceNotAvailableException if connection with device is lost and cannot be recovered.

    waitForDeviceAvailable

    public abstract boolean waitForDeviceAvailable (long waitTime)

    Waits for the device to be responsive and available for testing.

    Parameter
    waitTime long : the time in ms to wait

    Kembali
    boolean True if device is available, False if recovery is disabled and unavailable.

    Melempar
    DeviceNotAvailableException if device is still unresponsive after waitTime expires.

    waitForDeviceBootloader

    public abstract void waitForDeviceBootloader ()

    Blocks until device is visible via fastboot. Use default timeout.

    Melempar
    DeviceNotAvailableException if connection with device is lost and cannot be recovered.

    waitForDeviceInRecovery

    public abstract boolean waitForDeviceInRecovery (long waitTime)

    Blocks for the device to be in the 'adb recovery' state (note this is distinct from IDeviceRecovery ).

    Parameter
    waitTime long : the time in ms to wait

    Kembali
    boolean true if device boots into recovery before time expires. false otherwise

    waitForDeviceInSideload

    public abstract boolean waitForDeviceInSideload (long waitTime)

    Blocks for the device to be in the 'adb sideload' state

    Parameter
    waitTime long : the time in ms to wait

    Kembali
    boolean true if device boots into sideload before time expires. false otherwise

    waitForDeviceNotAvailable

    public abstract boolean waitForDeviceNotAvailable (long waitTime)

    Blocks for the device to be not available ie missing from adb

    Parameter
    waitTime long : the time in ms to wait

    Kembali
    boolean true if device becomes not available before time expires. false otherwise

    waitForDeviceOnline

    public abstract void waitForDeviceOnline ()

    Blocks until device is visible via adb. Uses default timeout

    Note the device may not necessarily be responsive to commands on completion. Use waitForDeviceAvailable() instead.

    Melempar
    DeviceNotAvailableException if connection with device is lost and cannot be recovered.

    waitForDeviceOnline

    public abstract void waitForDeviceOnline (long waitTime)

    Blocks until device is visible via adb.

    Note the device may not necessarily be responsive to commands on completion. Use waitForDeviceAvailable() instead.

    Parameter
    waitTime long : the time in ms to wait

    Melempar
    DeviceNotAvailableException if connection with device is lost and cannot be recovered.

    waitForDeviceShell

    public abstract boolean waitForDeviceShell (long waitTime)

    Waits for device to be responsive to a basic adb shell command.

    Parameter
    waitTime long : the time in ms to wait

    Kembali
    boolean true if device becomes responsive before waitTime elapses.