INativeDevice
public interface INativeDevice
com.android.tradefed.device.INativeDevice |
จัดเตรียม API ระดับที่เชื่อถือได้และสูงกว่าเล็กน้อยให้กับ ddmlib IDevice
สรุป
ค่าคงที่ | |
---|---|
int | UNKNOWN_API_LEVEL ค่าเริ่มต้นเมื่อตรวจไม่พบระดับ API |
วิธีการสาธารณะ | |
---|---|
abstract boolean | checkApiLevelAgainstNextRelease (int strictMinLevel) ตรวจสอบว่าคุณสมบัติได้รับการสนับสนุนในปัจจุบันหรือไม่โดยได้รับการสนับสนุนในระดับที่น้อยที่สุด |
abstract void | clearLogcat () ลบข้อมูล logcat ที่สะสมไว้ |
abstract void | deleteFile (String deviceFilePath) วิธีการช่วยเหลือในการลบไฟล์หรือไดเร็กทอรีบนอุปกรณ์ |
abstract boolean | deviceSoftRestarted ( ProcessInfo prevSystemServerProcess) วิธีตัวช่วยในการตรวจสอบว่าอุปกรณ์ซอฟต์รีสตาร์ทโดยเปรียบเทียบ system_server ปัจจุบันกับ system_server |
abstract boolean | deviceSoftRestartedSince (long utcEpochTime, TimeUnit timeUnit) วิธีตัวช่วยในการตรวจสอบว่าอุปกรณ์ซอฟต์รีสตาร์ทตั้งแต่เวลา UTC ตั้งแต่ยุคจากอุปกรณ์และ |
abstract boolean | disableAdbRoot () ปิดรูท adb |
abstract boolean | doesFileExist (String deviceFilePath) วิธี Helper เพื่อตรวจสอบว่าไฟล์ในอุปกรณ์มีอยู่หรือไม่ |
abstract boolean | enableAdbRoot () เปิด adb root |
abstract String | executeAdbCommand (long timeout, String... commandArgs) เมธอด Helper ซึ่งรันคำสั่ง adb เป็นคำสั่งระบบที่มีการหมดเวลาที่ระบุ |
abstract String | executeAdbCommand (String... commandArgs) เมธอด Helper ซึ่งรันคำสั่ง adb เป็นคำสั่งระบบ |
abstract CommandResult | executeFastbootCommand (String... commandArgs) เมธอด Helper ซึ่งรันคำสั่ง fastboot เป็นคำสั่งระบบโดยมีการหมดเวลาเริ่มต้น 2 นาที |
abstract CommandResult | executeFastbootCommand (long timeout, String... commandArgs) เมธอด Helper ซึ่งรันคำสั่ง fastboot เป็นคำสั่งระบบ |
abstract CommandResult | executeLongFastbootCommand ( envVarMap, String... commandArgs) executeLongFastbootCommand ( envVarMap, String... commandArgs) เมธอด Helper ซึ่งรันคำสั่ง fastboot ที่รันเป็นเวลานานเป็นคำสั่งระบบพร้อมตัวแปรสภาพแวดล้อมของระบบ |
abstract CommandResult | executeLongFastbootCommand (String... commandArgs) เมธอด Helper ซึ่งรันคำสั่ง fastboot ที่รันเป็นเวลานานเป็นคำสั่งระบบ |
abstract String | executeShellCommand (String command) เมธอด Helper ซึ่งรันคำสั่ง adb shell และส่งคืนเอาต์พุตเป็น |
abstract void | executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts) ดำเนินการคำสั่งเชลล์ adb พร้อมพารามิเตอร์เพิ่มเติมเพื่อควบคุมพฤติกรรมของคำสั่ง |
abstract void | executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeoutForCommand, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts) ดำเนินการคำสั่งเชลล์ adb พร้อมพารามิเตอร์เพิ่มเติมเพื่อควบคุมพฤติกรรมของคำสั่ง |
abstract void | executeShellCommand (String command, IShellOutputReceiver receiver) ดำเนินการคำสั่งเชลล์ adb ที่กำหนด ลองใหม่หลายครั้งหากคำสั่งล้มเหลว |
abstract CommandResult | executeShellV2Command (String command) เมธอด Helper ซึ่งรันคำสั่ง adb shell และส่งกลับผลลัพธ์เป็น |
abstract CommandResult | executeShellV2Command (String command, OutputStream pipeToOutput) เมธอด Helper ที่รันคำสั่งเชลล์ adb และส่งคืนผลลัพธ์เป็น |
abstract CommandResult | executeShellV2Command (String command, File pipeAsInput) เมธอด Helper ที่รันคำสั่งเชลล์ adb และส่งคืนผลลัพธ์เป็น |
abstract CommandResult | executeShellV2Command (String command, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts) ดำเนินการคำสั่งเชลล์ adb พร้อมพารามิเตอร์เพิ่มเติมเพื่อควบคุมพฤติกรรมของคำสั่ง |
abstract CommandResult | executeShellV2Command (String command, long maxTimeoutForCommand, TimeUnit timeUnit) ดำเนินการคำสั่งเชลล์ adb พร้อมพารามิเตอร์เพิ่มเติมเพื่อควบคุมพฤติกรรมของคำสั่ง |
abstract CommandResult | executeShellV2Command (String command, File pipeAsInput, OutputStream pipeToOutput, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts) ดำเนินการคำสั่งเชลล์ adb พร้อมพารามิเตอร์เพิ่มเติมเพื่อควบคุมพฤติกรรมของคำสั่ง |
abstract CommandResult | executeShellV2Command (String command, File pipeAsInput, OutputStream pipeToOutput, OutputStream pipeToError, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts) ดำเนินการคำสั่งเชลล์ adb พร้อมพารามิเตอร์เพิ่มเติมเพื่อควบคุมพฤติกรรมของคำสั่ง |
abstract CommandResult | fastbootWipePartition (String partition) วิธีตัวช่วยที่ล้างพาร์ทิชันสำหรับอุปกรณ์ |
abstract int | getApiLevel () รับระดับ API ของอุปกรณ์ |
abstract String | getBasebandVersion () วิธีที่สะดวกสบายในการรับเวอร์ชันเบสแบนด์ (วิทยุ) ของอุปกรณ์นี้ |
abstract Integer | getBattery () ส่งกลับระดับแบตเตอรี่ปัจจุบันของอุปกรณ์หรือ Null หากระดับแบตเตอรี่ไม่พร้อมใช้งาน |
abstract boolean | getBooleanProperty (String name, boolean defaultValue) ส่งกลับค่าบูลีนของคุณสมบัติที่กำหนด |
abstract | getBootHistory () เมธอด Helper รวบรวมแมปประวัติการบู๊ตพร้อมเวลาบู๊ตและเหตุผลในการบู๊ต |
abstract | getBootHistorySince (long utcEpochTime, TimeUnit timeUnit) เมธอด Helper รวบรวมแมปประวัติการบู๊ตพร้อมเวลาบู๊ตและเหตุผลการบู๊ตตั้งแต่เวลาที่กำหนดตั้งแต่ยุคจากอุปกรณ์และหน่วยเวลาที่ระบุ |
abstract String | getBootloaderVersion () วิธีที่สะดวกสบายในการรับรุ่น bootloader ของอุปกรณ์นี้ |
abstract InputStreamSource | getBugreport () ดึงรายงานข้อผิดพลาดจากอุปกรณ์ |
abstract InputStreamSource | getBugreportz () ดึงรายงานข้อผิดพลาดจากอุปกรณ์ |
abstract String | getBuildAlias () เรียกชื่อแทนของบิลด์ที่อุปกรณ์กำลังทำงานอยู่ |
abstract String | getBuildFlavor () เรียกสร้างรสชาติสำหรับอุปกรณ์ |
abstract String | getBuildId () ดึงข้อมูลบิลด์ที่อุปกรณ์กำลังทำงานอยู่ |
abstract String | getBuildSigningKeys () ส่งคืนประเภทคีย์ที่ใช้ในการลงนามในอิมเมจอุปกรณ์ โดยปกติอุปกรณ์ Android อาจลงนามด้วยคีย์ทดสอบ (เช่นใน AOSP) หรือคีย์การวางจำหน่าย (ควบคุมโดยผู้ผลิตอุปกรณ์แต่ละราย) |
abstract DeviceDescriptor | getCachedDeviceDescriptor () ส่งคืน |
abstract DeviceDescriptor | getCachedDeviceDescriptor (boolean shortDescriptor) ส่งคืน |
abstract String[] | getChildren (String deviceFilePath) ทางเลือกอื่นในการใช้ |
abstract String | getDeviceClass () รับคลาสอุปกรณ์ |
abstract long | getDeviceDate () ส่งคืนวันที่ของอุปกรณ์เป็นมิลลิวินาทีตั้งแต่ยุค |
abstract DeviceDescriptor | getDeviceDescriptor () ส่งคืน |
abstract DeviceDescriptor | getDeviceDescriptor (boolean shortDescriptor) ส่งคืน |
abstract TestDeviceState | getDeviceState () รับสถานะของอุปกรณ์ |
abstract long | getDeviceTimeOffset (Date date) ตัวช่วยรับความแตกต่างของเวลาระหว่างอุปกรณ์กับ |
abstract InputStreamSource | getEmulatorOutput () รับสตรีมของโปรแกรมจำลอง stdout และ stderr |
abstract long | getExternalStoreFreeSpace () วิธี Helper เพื่อกำหนดจำนวนพื้นที่ว่างบนที่จัดเก็บข้อมูลภายนอกของอุปกรณ์ |
abstract String | getFastbootProductType () วิธีที่สะดวกสบายในการรับประเภทผลิตภัณฑ์ของอุปกรณ์นี้เมื่ออยู่ในโหมด fastboot |
abstract String | getFastbootProductVariant () วิธีที่สะดวกสบายในการรับประเภทผลิตภัณฑ์ของอุปกรณ์นี้เมื่ออยู่ในโหมด fastboot |
abstract String | getFastbootSerialNumber () ส่งกลับหมายเลขซีเรียลของโหมด fastboot |
abstract String | getFastbootVariable (String variableName) ดึงค่าตัวแปร fastboot ที่กำหนดจากอุปกรณ์ |
abstract IFileEntry | getFileEntry (String path) ดึงข้อมูลอ้างอิงไปยังไฟล์ระยะไกลบนอุปกรณ์ |
abstract IDevice | getIDevice () ส่งคืนการอ้างอิงไปยัง ddmlib |
abstract long | getIntProperty (String name, long defaultValue) ส่งคืนค่าจำนวนเต็มของคุณสมบัติที่กำหนดจากอุปกรณ์ |
abstract long | getLastExpectedRebootTimeMillis () ส่งคืน Tradefed API ครั้งล่าสุดที่ทริกเกอร์การรีบูตในหน่วยมิลลิวินาทีตั้งแต่ EPOCH ตามที่ส่งคืนโดย |
abstract int | getLaunchApiLevel () รับระดับ API ที่เปิดตัวครั้งแรกของอุปกรณ์ |
abstract InputStreamSource | getLogcat () ดึงสแนปชอตสตรีมของข้อมูล logcat |
abstract InputStreamSource | getLogcat (int maxBytes) ดึงสตรีมสแนปชอตของ |
abstract InputStreamSource | getLogcatDump () รับดัมพ์ของ logcat ปัจจุบันสำหรับอุปกรณ์ |
abstract InputStreamSource | getLogcatSince (long date) ดึงสตรีมสแนปชอตของข้อมูล logcat ที่บันทึกไว้โดยเริ่มตั้งแต่วันที่ระบุ |
abstract String | getMountPoint (String mountName) ส่งกลับจุดเมานท์ |
abstract ITestDevice.MountPointInfo | getMountPointInfo (String mountpoint) ส่งกลับ |
abstract | getMountPointInfo () ส่งคืนข้อมูลเวอร์ชันที่แยกวิเคราะห์ใน /proc/mounts บน device |
abstract long | getPartitionFreeSpace (String partition) วิธี Helper เพื่อกำหนดจำนวนเนื้อที่ว่างบนพาร์ติชั่นอุปกรณ์ |
abstract ProcessInfo | getProcessByName (String processName) เมธอด Helper รันคำสั่ง "pidof" และ "stat" และส่งคืนอ็อบเจ็กต์ |
abstract String | getProcessPid (String process) ส่งคืน pid ของบริการหรือ null หากมีสิ่งผิดปกติเกิดขึ้น |
abstract String | getProductType () วิธีที่สะดวกรับสินค้าประเภทเครื่องนี้ |
abstract String | getProductVariant () วิธีที่สะดวกสบายในการรับตัวเลือกสินค้าของอุปกรณ์นี้ |
abstract String | getProperty (String name) ดึงค่าคุณสมบัติที่กำหนดจากอุปกรณ์ |
abstract ITestDevice.RecoveryMode | getRecoveryMode () รับโหมดการกู้คืนปัจจุบันที่ใช้สำหรับอุปกรณ์ |
abstract String | getSerialNumber () วิธีที่สะดวกสบายในการรับหมายเลขซีเรียลของอุปกรณ์นี้ |
abstract | getTombstones () ดึงและคืนรายการของหลุมฝังศพจากอุปกรณ์ |
abstract long | getTotalMemory () ส่งกลับขนาดหน่วยความจำกายภาพทั้งหมดเป็นไบต์หรือ -1 ในกรณีที่เกิดข้อผิดพลาดภายใน |
abstract boolean | getUseFastbootErase () ดูว่าจะใช้ fastboot ลบหรือรูปแบบ fastboot เพื่อล้างพาร์ทิชันบนอุปกรณ์ |
abstract boolean | isAdbRoot () |
abstract boolean | isAdbTcp () |
abstract boolean | isAppEnumerationSupported () ตรวจสอบว่าแพลตฟอร์มบนอุปกรณ์รองรับการแจงนับแอพหรือไม่ |
abstract boolean | isDeviceEncrypted () ส่งคืนหากอุปกรณ์ถูกเข้ารหัส |
abstract boolean | isDirectory (String deviceFilePath) คืนค่า True หากพาธบนอุปกรณ์เป็นไดเร็กทอรี มิฉะนั้น จะเป็นเท็จ |
abstract boolean | isEncryptionSupported () ส่งคืนหากอุปกรณ์รองรับการเข้ารหัส |
abstract boolean | isExecutable (String fullPath) คืนค่า True หากพาธของไฟล์บนอุปกรณ์เป็นไฟล์เรียกทำงาน มิฉะนั้นจะเป็นเท็จ |
abstract boolean | isHeadless () คืนค่า จริง หากอุปกรณ์ไม่มีหัว (ไม่มีหน้าจอ) มิฉะนั้น เท็จ |
abstract boolean | isRuntimePermissionSupported () ตรวจสอบว่าแพลตฟอร์มบนอุปกรณ์รองรับการอนุญาตรันไทม์หรือไม่ |
abstract boolean | isStateBootloaderOrFastbootd () คืนค่า จริง หากอุปกรณ์อยู่ใน |
abstract boolean | logAnrs ( ITestLogger logger) รวบรวมและบันทึก ANR จากอุปกรณ์ |
abstract boolean | logBugreport (String dataName, ITestLogger listener) วิธีใช้ตัวช่วยในการรายงานจุดบกพร่องและบันทึกไปยังนักข่าว |
abstract void | logOnDevice (String tag, Log.LogLevel level, String format, Object... args) บันทึกข้อความใน logcat ของอุปกรณ์ |
abstract void | nonBlockingReboot () ออกคำสั่งให้รีบูตอุปกรณ์และส่งคืนเมื่อคำสั่งเสร็จสิ้น และเมื่ออุปกรณ์ไม่ปรากฏแก่ adb อีกต่อไป |
abstract void | postBootSetup () ทำตามคำแนะนำเพื่อกำหนดค่าอุปกรณ์สำหรับการทดสอบว่าหลังจากการบู๊ตทุกครั้ง |
default void | postInvocationTearDown () วิธีนี้เลิกใช้แล้ว ใช้ |
abstract void | postInvocationTearDown (Throwable invocationException) ขั้นตอนเพิ่มเติมสำหรับการล้างข้อมูลเฉพาะอุปกรณ์ที่จะดำเนินการหลังจากการเรียกใช้เสร็จสิ้น |
default void | preInvocationSetup ( IBuildInfo info, MultiMap <String, String> attributes) ขั้นตอนเพิ่มเติมสำหรับการตั้งค่าเฉพาะอุปกรณ์ที่จำเป็นซึ่งจะดำเนินการบนอุปกรณ์ก่อนขั้นตอนการเรียกใช้ |
abstract boolean | pullDir (String deviceFilePath, File localDir) ดึงเนื้อหาไดเรกทอรีซ้ำๆ จากอุปกรณ์ |
abstract File | pullFile (String remoteFilePath, int userId) ดึงไฟล์จากอุปกรณ์ เก็บไว้ใน |
abstract File | pullFile (String remoteFilePath) ดึงไฟล์จากอุปกรณ์ เก็บไว้ใน |
abstract boolean | pullFile (String remoteFilePath, File localFile) ดึงไฟล์ออกจากอุปกรณ์ |
abstract boolean | pullFile (String remoteFilePath, File localFile, int userId) ดึงไฟล์ออกจากอุปกรณ์ |
abstract String | pullFileContents (String remoteFilePath) ดึงไฟล์จากอุปกรณ์และส่งคืนเนื้อหา |
abstract File | pullFileFromExternal (String remoteFilePath) วิธีอำนวยความสะดวกในการดึงไฟล์จากที่จัดเก็บข้อมูลภายนอกของอุปกรณ์ เก็บไว้ใน |
abstract boolean | pushDir (File localDir, String deviceFilePath, excludedDirectories) pushDir (File localDir, String deviceFilePath, excludedDirectories) พุชเนื้อหาไดเร็กทอรีไปยังอุปกรณ์ซ้ำๆ ในขณะที่ไม่รวมบางไดเร็กทอรีที่ถูกกรอง |
abstract boolean | pushDir (File localDir, String deviceFilePath) พุชเนื้อหาไดเร็กทอรีซ้ำๆ ไปยังอุปกรณ์ |
abstract boolean | pushFile (File localFile, String deviceFilePath, boolean evaluateContentProviderNeeded) ตัวแปรของ |
abstract boolean | pushFile (File localFile, String deviceFilePath) พุชไฟล์ไปยังอุปกรณ์ |
abstract boolean | pushString (String contents, String deviceFilePath) พุชไฟล์ที่สร้างจากสตริงไปยังอุปกรณ์ |
abstract void | reboot () รีบูตอุปกรณ์เข้าสู่โหมด adb |
abstract void | reboot (String reason) รีบูตอุปกรณ์เข้าสู่โหมด adb โดยมี |
abstract void | rebootIntoBootloader () รีบูตอุปกรณ์เข้าสู่โหมด bootloader |
abstract void | rebootIntoFastbootd () รีบูตอุปกรณ์เข้าสู่โหมด fastbootd |
abstract void | rebootIntoRecovery () รีบูตอุปกรณ์เข้าสู่โหมดการกู้คืน adb |
abstract void | rebootIntoSideload (boolean autoReboot) รีบูตอุปกรณ์เข้าสู่โหมด adb sideload (โปรดทราบว่านี่เป็นโหมดพิเศษภายใต้การกู้คืน) บล็อกจนกว่าอุปกรณ์จะเข้าสู่โหมดไซด์โหลด |
abstract void | rebootIntoSideload () รีบูตอุปกรณ์เข้าสู่โหมด adb sideload (โปรดทราบว่านี่เป็นโหมดพิเศษภายใต้การกู้คืน) บล็อกจนกว่าอุปกรณ์จะเข้าสู่โหมดไซด์โหลด |
abstract void | rebootUntilOnline () ทางเลือกอื่นในการ |
abstract void | rebootUntilOnline (String reason) ทางเลือกอื่นในการ |
abstract void | rebootUserspace () รีบูตเฉพาะส่วน userspace ของอุปกรณ์ |
abstract void | rebootUserspaceUntilOnline () ทางเลือกอื่นในการ |
abstract void | remountSystemWritable () ทำให้พาร์ติชันระบบบนอุปกรณ์สามารถเขียนได้ |
abstract void | remountVendorWritable () ทำให้พาร์ติชันผู้ขายบนอุปกรณ์สามารถเขียนได้ |
abstract boolean | runInstrumentationTests (IRemoteAndroidTestRunner runner, ITestLifeCycleReceiver... listeners) วิธีที่สะดวกสำหรับการดำเนินการ |
abstract boolean | runInstrumentationTests (IRemoteAndroidTestRunner runner, listeners) runInstrumentationTests (IRemoteAndroidTestRunner runner, listeners) เรียกใช้การทดสอบเครื่องมือวัด และให้การกู้คืนอุปกรณ์ |
abstract boolean | runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, ITestLifeCycleReceiver... listeners) เหมือนกับ |
abstract boolean | runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, listeners) runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, listeners) เหมือนกับ |
abstract void | setDate (Date date) ตั้งวันที่ในเครื่อง หมายเหตุ: การตั้งค่าวันที่บนอุปกรณ์ต้องใช้ root |
abstract void | setOptions ( TestDeviceOptions options) ตั้งค่า |
abstract boolean | setProperty (String propKey, String propValue) ตั้งค่าคุณสมบัติที่กำหนดบนอุปกรณ์ |
abstract void | setRecovery ( IDeviceRecovery recovery) ตั้งค่า |
abstract void | setRecoveryMode ( ITestDevice.RecoveryMode mode) ตั้งค่าโหมดการกู้คืนปัจจุบันเพื่อใช้กับอุปกรณ์ |
abstract void | setUseFastbootErase (boolean useFastbootErase) ตั้งค่าว่าจะใช้ fastboot ลบหรือรูปแบบ fastboot เพื่อล้างพาร์ทิชันบนอุปกรณ์ |
abstract void | startLogcat () เริ่มจับเอาต์พุต logcat จากอุปกรณ์ในพื้นหลัง |
abstract void | stopEmulatorOutput () ปิดและลบเอาต์พุตของโปรแกรมจำลอง |
abstract void | stopLogcat () หยุดจับเอาต์พุต logcat จากอุปกรณ์ และทิ้งข้อมูล logcat ที่บันทึกไว้ในปัจจุบัน |
abstract String | switchToAdbTcp () เปลี่ยนอุปกรณ์เป็นโหมด adb-over-tcp |
abstract boolean | switchToAdbUsb () สลับอุปกรณ์เป็น adb ผ่านโหมด usb |
abstract boolean | syncFiles (File localFileDir, String deviceFilePath) ซิงค์เนื้อหาของไดเร็กทอรีไฟล์ในเครื่องกับอุปกรณ์เพิ่มขึ้น |
abstract Bugreport | takeBugreport () รับรายงานข้อบกพร่องและส่งคืนภายในวัตถุ |
abstract boolean | unlockDevice () ปลดล็อกอุปกรณ์หากอุปกรณ์อยู่ในสถานะเข้ารหัส |
abstract boolean | waitForBootComplete (long timeOut) บล็อกจนกว่าจะตั้งค่าสถานะการบูตอุปกรณ์เสร็จสมบูรณ์ |
abstract boolean | waitForDeviceAvailable () รอให้อุปกรณ์ตอบสนองและพร้อมสำหรับการทดสอบ |
abstract boolean | waitForDeviceAvailable (long waitTime) รอให้อุปกรณ์ตอบสนองและพร้อมสำหรับการทดสอบ |
abstract void | waitForDeviceBootloader () บล็อกจนกว่าอุปกรณ์จะมองเห็นได้ผ่าน fastboot |
abstract boolean | waitForDeviceInRecovery (long waitTime) บล็อกสำหรับอุปกรณ์ให้อยู่ในสถานะ 'การกู้คืน adb' (โปรดทราบว่าสิ่งนี้แตกต่างจาก |
abstract boolean | waitForDeviceInSideload (long waitTime) บล็อกสำหรับอุปกรณ์ให้อยู่ในสถานะ 'adb sideload' |
abstract boolean | waitForDeviceNotAvailable (long waitTime) บล็อกสำหรับอุปกรณ์ที่จะใช้งานไม่ได้เช่นหายไปจากadb |
abstract void | waitForDeviceOnline () บล็อกจนกว่าอุปกรณ์จะมองเห็นได้ผ่าน adb |
abstract void | waitForDeviceOnline (long waitTime) บล็อกจนกว่าอุปกรณ์จะมองเห็นได้ผ่าน adb |
abstract boolean | waitForDeviceShell (long waitTime) รอให้อุปกรณ์ตอบสนองต่อคำสั่งเชลล์ adb พื้นฐาน |
ค่าคงที่
UNKNOWN_API_LEVEL
public static final int UNKNOWN_API_LEVEL
ค่าเริ่มต้นเมื่อตรวจไม่พบระดับ API
ค่าคงที่: -1 (0xffffffff)
วิธีการสาธารณะ
checkApiLevelAgainstNextRelease
public abstract boolean checkApiLevelAgainstNextRelease (int strictMinLevel)
ตรวจสอบว่าคุณสมบัติได้รับการสนับสนุนในปัจจุบันหรือไม่โดยได้รับการสนับสนุนในระดับที่น้อยที่สุด วิธีนี้คำนึงถึงคุณลักษณะที่ยังไม่เผยแพร่ก่อนที่จะยกระดับ API
พารามิเตอร์ | |
---|---|
strictMinLevel | int : ระดับต่ำสุดที่เป็นไปได้อย่างเข้มงวดซึ่งสนับสนุนคุณลักษณะนี้ |
คืนสินค้า | |
---|---|
boolean | เป็นจริงหากระดับได้รับการสนับสนุน เท็จเป็นอย่างอื่น |
ขว้าง | |
---|---|
DeviceNotAvailableException |
clearLogcat
public abstract void clearLogcat ()
ลบข้อมูล logcat ที่สะสมไว้
สิ่งนี้มีประโยชน์สำหรับกรณีที่คุณต้องการให้แน่ใจว่าITestDevice#getLogcat()
ส่งคืนเฉพาะข้อมูลบันทึกที่สร้างขึ้นหลังจากจุดหนึ่ง (เช่น หลังจากแฟลชบิลด์อุปกรณ์ใหม่ ฯลฯ) ลบไฟล์
public abstract void deleteFile (String deviceFilePath)
วิธีการช่วยเหลือในการลบไฟล์หรือไดเร็กทอรีบนอุปกรณ์
พารามิเตอร์ | |
---|---|
deviceFilePath | String : เส้นทางที่แน่นอนของไฟล์บนอุปกรณ์ |
ขว้าง | |
---|---|
DeviceNotAvailableException |
อุปกรณ์SoftRestarted
public abstract boolean deviceSoftRestarted (ProcessInfo prevSystemServerProcess)
วิธีตัวช่วยในการตรวจสอบว่าอุปกรณ์ซอฟต์รีสตาร์ทโดยเปรียบเทียบ system_server ปัจจุบันกับ system_server ProcessInfo
ก่อนหน้าหรือไม่ ใช้ getProcessByName(String)
เพื่อรับ ProcessInfo
พารามิเตอร์ | |
---|---|
prevSystemServerProcess | ProcessInfo : กระบวนการ system_server ก่อนหน้า ProcessInfo |
คืนสินค้า | |
---|---|
boolean | true หากอุปกรณ์รีสตาร์ทแบบซอฟต์ |
ขว้าง | |
---|---|
RuntimeException | หากอุปกรณ์มีสาเหตุการบู๊ตผิดปกติ |
DeviceNotAvailableException |
อุปกรณ์SoftRestartedตั้งแต่
public abstract boolean deviceSoftRestartedSince (long utcEpochTime, TimeUnit timeUnit)
วิธีตัวช่วยในการตรวจสอบว่าอุปกรณ์ซอฟต์รีสตาร์ทตั้งแต่เวลา UTC ตั้งแต่ยุคจากอุปกรณ์และ ERROR(/TimeUnit)
Soft-Restart หมายถึง system_server ที่รีสตาร์ทภายนอกฮาร์ดรีบูตของอุปกรณ์ (เช่น: ร้องขอให้รีบูต) อุปกรณ์ปัจจุบัน utcEpochTime ในหน่วยมิลลิวินาทีสามารถรับได้โดยวิธี getDeviceDate()
พารามิเตอร์ | |
---|---|
utcEpochTime | long : เวลาของอุปกรณ์เป็นวินาทีตั้งแต่ยุค |
timeUnit | TimeUnit : หน่วยเวลา TimeUnit สำหรับ utcEpochTime ที่กำหนด |
คืนสินค้า | |
---|---|
boolean | true หากอุปกรณ์รีสตาร์ทแบบซอฟต์ |
ขว้าง | |
---|---|
RuntimeException | หากอุปกรณ์มีสาเหตุการบู๊ตผิดปกติ |
DeviceNotAvailableException |
ปิดการใช้งานAdbRoot
public abstract boolean disableAdbRoot ()
ปิดรูท adb
การปิดใช้งานรูท adb อาจทำให้อุปกรณ์ยกเลิกการเชื่อมต่อจาก adb วิธีนี้จะบล็อกจนกว่าอุปกรณ์จะพร้อมใช้งานคืนสินค้า | |
---|---|
boolean | true ถ้าสำเร็จ |
ขว้าง | |
---|---|
DeviceNotAvailableException | หากขาดการเชื่อมต่อกับอุปกรณ์และไม่สามารถกู้คืนได้ |
ไม่FileExist
public abstract boolean doesFileExist (String deviceFilePath)
วิธี Helper เพื่อตรวจสอบว่าไฟล์ในอุปกรณ์มีอยู่หรือไม่
พารามิเตอร์ | |
---|---|
deviceFilePath | String : เส้นทางที่แน่นอนของไฟล์บนอุปกรณ์ที่จะตรวจสอบ |
คืนสินค้า | |
---|---|
boolean | true ถ้ามีไฟล์อยู่ false มิฉะนั้น |
ขว้าง | |
---|---|
DeviceNotAvailableException | หากขาดการเชื่อมต่อกับอุปกรณ์และไม่สามารถกู้คืนได้ |
เปิดใช้งานAdbRoot
public abstract boolean enableAdbRoot ()
เปิด adb root หากการตั้งค่า "เปิดใช้งานรูท" เป็น "เท็จ" จะบันทึกข้อความและส่งคืนโดยไม่ต้องเปิดใช้งานรูท
การเปิดใช้งาน adb root อาจทำให้อุปกรณ์ตัดการเชื่อมต่อจาก adb วิธีนี้จะบล็อกจนกว่าอุปกรณ์จะพร้อมใช้งานคืนสินค้า | |
---|---|
boolean | true ถ้าสำเร็จ |
ขว้าง | |
---|---|
DeviceNotAvailableException | หากขาดการเชื่อมต่อกับอุปกรณ์และไม่สามารถกู้คืนได้ |
รันAdbCommand
public abstract String executeAdbCommand (long timeout, String... commandArgs)
เมธอด Helper ซึ่งรันคำสั่ง adb เป็นคำสั่งระบบที่มีการหมดเวลาที่ระบุ
ควรใช้ executeShellCommand(String)
แทนทุกเมื่อที่ทำได้ เนื่องจากวิธีการดังกล่าวให้การตรวจจับความล้มเหลวและประสิทธิภาพที่ดีขึ้น
พารามิเตอร์ | |
---|---|
timeout | long : เวลาเป็นมิลลิวินาทีก่อนที่อุปกรณ์จะถือว่าไม่ตอบสนอง 0L ไม่มีการหมดเวลา |
commandArgs | String : คำสั่ง adb และอาร์กิวเมนต์ที่จะเรียกใช้ |
คืนสินค้า | |
---|---|
String | stdout จากคำสั่ง null ถ้าคำสั่งล้มเหลวในการดำเนินการ |
ขว้าง | |
---|---|
DeviceNotAvailableException | หากขาดการเชื่อมต่อกับอุปกรณ์และไม่สามารถกู้คืนได้ |
รันAdbCommand
public abstract String executeAdbCommand (String... commandArgs)
เมธอด Helper ซึ่งรันคำสั่ง adb เป็นคำสั่งระบบ
ควรใช้executeShellCommand(String)
แทนทุกเมื่อที่ทำได้ เนื่องจากวิธีการดังกล่าวให้การตรวจจับความล้มเหลวและประสิทธิภาพที่ดีขึ้นพารามิเตอร์ | |
---|---|
commandArgs | String : คำสั่ง adb และอาร์กิวเมนต์ที่จะเรียกใช้ |
คืนสินค้า | |
---|---|
String | stdout จากคำสั่ง null ถ้าคำสั่งล้มเหลวในการดำเนินการ |
ขว้าง | |
---|---|
DeviceNotAvailableException | หากขาดการเชื่อมต่อกับอุปกรณ์และไม่สามารถกู้คืนได้ |
ดำเนินการFastbootCommand
public abstract CommandResult executeFastbootCommand (String... commandArgs)
เมธอด Helper ซึ่งรันคำสั่ง fastboot เป็นคำสั่งระบบโดยมีการหมดเวลาเริ่มต้น 2 นาที
คาดว่าจะใช้เมื่ออุปกรณ์อยู่ในโหมด fastboot แล้วพารามิเตอร์ | |
---|---|
commandArgs | String : คำสั่ง fastboot และอาร์กิวเมนต์ที่จะรัน |
คืนสินค้า | |
---|---|
CommandResult | CommandResult ที่มีเอาต์พุตของ command |
ขว้าง | |
---|---|
DeviceNotAvailableException | หากขาดการเชื่อมต่อกับอุปกรณ์และไม่สามารถกู้คืนได้ |
ดำเนินการFastbootCommand
public abstract CommandResult executeFastbootCommand (long timeout, String... commandArgs)
เมธอด Helper ซึ่งรันคำสั่ง fastboot เป็นคำสั่งระบบ
คาดว่าจะใช้เมื่ออุปกรณ์อยู่ในโหมด fastboot แล้วพารามิเตอร์ | |
---|---|
timeout | long : เวลาเป็นมิลลิวินาทีก่อนที่คำสั่งจะหมดอายุ |
commandArgs | String : คำสั่ง fastboot และอาร์กิวเมนต์ที่จะรัน |
คืนสินค้า | |
---|---|
CommandResult | CommandResult ที่มีเอาต์พุตของ command |
ขว้าง | |
---|---|
DeviceNotAvailableException | หากขาดการเชื่อมต่อกับอุปกรณ์และไม่สามารถกู้คืนได้ |
รันLongFastbootCommand
public abstract CommandResult executeLongFastbootCommand (envVarMap, String... commandArgs)
เมธอด Helper ซึ่งรันคำสั่ง fastboot ที่รันเป็นเวลานานเป็นคำสั่งระบบพร้อมตัวแปรสภาพแวดล้อมของระบบ
เหมือนกันกับ executeFastbootCommand(String)
ยกเว้นว่าใช้การหมดเวลานานขึ้น
พารามิเตอร์ | |
---|---|
envVarMap | |
commandArgs | String : คำสั่ง fastboot และอาร์กิวเมนต์ที่จะรัน |
คืนสินค้า | |
---|---|
CommandResult | CommandResult ที่มีเอาต์พุตของ command |
ขว้าง | |
---|---|
DeviceNotAvailableException | หากขาดการเชื่อมต่อกับอุปกรณ์และไม่สามารถกู้คืนได้ |
รันLongFastbootCommand
public abstract CommandResult executeLongFastbootCommand (String... commandArgs)
เมธอด Helper ซึ่งรันคำสั่ง fastboot ที่รันเป็นเวลานานเป็นคำสั่งระบบ
เหมือนกันกับexecuteFastbootCommand(String)
ยกเว้นว่าใช้การหมดเวลานานขึ้นพารามิเตอร์ | |
---|---|
commandArgs | String : คำสั่ง fastboot และอาร์กิวเมนต์ที่จะรัน |
คืนสินค้า | |
---|---|
CommandResult | CommandResult ที่มีเอาต์พุตของ command |
ขว้าง | |
---|---|
DeviceNotAvailableException | หากขาดการเชื่อมต่อกับอุปกรณ์และไม่สามารถกู้คืนได้ |
executeShellCommand
public abstract String executeShellCommand (String command)
เมธอด Helper ซึ่งรันคำสั่ง adb shell และส่งคืนเอาต์พุตเป็น String
พารามิเตอร์ | |
---|---|
command | String : คำสั่งเชลล์ adb เพื่อเรียกใช้ |
คืนสินค้า | |
---|---|
String | ผลลัพธ์ของเชลล์ |
ขว้าง | |
---|---|
DeviceNotAvailableException | หากขาดการเชื่อมต่อกับอุปกรณ์และไม่สามารถกู้คืนได้ |
executeShellCommand
public abstract void executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts)
ดำเนินการคำสั่งเชลล์ adb พร้อมพารามิเตอร์เพิ่มเติมเพื่อควบคุมพฤติกรรมของคำสั่ง
พารามิเตอร์ | |
---|---|
command | String : คำสั่งเชลล์ adb เพื่อเรียกใช้ |
receiver | IShellOutputReceiver : IShellOutputReceiver เพื่อส่งเอาต์พุตของเชลล์ไปยัง |
maxTimeToOutputShellResponse | long : ระยะเวลาสูงสุดระหว่างที่คำสั่งได้รับอนุญาตให้ไม่แสดงการตอบสนองใด ๆ หน่วยตามที่ระบุใน timeUnit |
timeUnit | TimeUnit : หน่วยสำหรับ maxTimeToOutputShellResponse |
retryAttempts | int : จำนวนครั้งสูงสุดที่จะลองคำสั่งอีกครั้งหากล้มเหลวเนื่องจากข้อยกเว้น retryAttempts จะถูกส่งออกไปหากทำการลองใหม่อีกครั้งโดยไม่ประสบความสำเร็จ |
ขว้าง | |
---|---|
DeviceNotAvailableException | หากขาดการเชื่อมต่อกับอุปกรณ์และไม่สามารถกู้คืนได้ |
ดูสิ่งนี้ด้วย:
executeShellCommand
public abstract void executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeoutForCommand, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts)
ดำเนินการคำสั่งเชลล์ adb พร้อมพารามิเตอร์เพิ่มเติมเพื่อควบคุมพฤติกรรมของคำสั่ง
พารามิเตอร์ | |
---|---|
command | String : คำสั่งเชลล์ adb เพื่อเรียกใช้ |
receiver | IShellOutputReceiver : IShellOutputReceiver เพื่อส่งเอาต์พุตของเชลล์ไปยัง |
maxTimeoutForCommand | long : หมดเวลาสูงสุดสำหรับคำสั่งให้เสร็จสมบูรณ์; หน่วยตามที่ระบุใน timeUnit |
maxTimeToOutputShellResponse | long : ระยะเวลาสูงสุดระหว่างที่คำสั่งได้รับอนุญาตให้ไม่แสดงการตอบสนองใด ๆ หน่วยตามที่ระบุใน timeUnit |
timeUnit | TimeUnit : หน่วยสำหรับ maxTimeToOutputShellResponse |
retryAttempts | int : จำนวนครั้งสูงสุดที่จะลองคำสั่งอีกครั้งหากล้มเหลวเนื่องจากข้อยกเว้น retryAttempts จะถูกส่งออกไปหากทำการลองใหม่อีกครั้งโดยไม่ประสบความสำเร็จ |
ขว้าง | |
---|---|
DeviceNotAvailableException | หากขาดการเชื่อมต่อกับอุปกรณ์และไม่สามารถกู้คืนได้ |
ดูสิ่งนี้ด้วย:
executeShellCommand
public abstract void executeShellCommand (String command, IShellOutputReceiver receiver)
ดำเนินการคำสั่งเชลล์ adb ที่กำหนด ลองใหม่หลายครั้งหากคำสั่งล้มเหลว
รูปแบบที่ง่ายกว่าของexecuteShellCommand(String, com.android.ddmlib.IShellOutputReceiver, long, TimeUnit, int)
พร้อมค่าเริ่มต้นพารามิเตอร์ | |
---|---|
command | String : คำสั่งเชลล์ adb เพื่อเรียกใช้ |
receiver | IShellOutputReceiver : IShellOutputReceiver เพื่อส่งเอาต์พุตของเชลล์ไปยัง |
ขว้าง | |
---|---|
DeviceNotAvailableException | หากขาดการเชื่อมต่อกับอุปกรณ์และไม่สามารถกู้คืนได้ |
executeShellV2Command
public abstract CommandResult executeShellV2Command (String command)
เมธอด Helper ซึ่งรันคำสั่ง adb shell และส่งกลับผลลัพธ์เป็น CommandResult
ที่เติมอย่างถูกต้องด้วยเอาต์พุตสถานะคำสั่ง stdout และ stderr
พารามิเตอร์ | |
---|---|
command | String : คำสั่งที่ควรรัน |
คืนสินค้า | |
---|---|
CommandResult | ผลลัพธ์ใน CommandResult |
ขว้าง | |
---|---|
DeviceNotAvailableException | หากขาดการเชื่อมต่อกับอุปกรณ์และไม่สามารถกู้คืนได้ |
executeShellV2Command
public abstract CommandResult executeShellV2Command (String command, OutputStream pipeToOutput)
เมธอด Helper ที่รันคำสั่งเชลล์ adb และส่งคืนผลลัพธ์เป็น CommandResult
ที่เติมอย่างถูกต้องด้วยเอาต์พุตสถานะคำสั่งและ stderr stdout ถูกนำไปยังสตรีมที่ระบุ
พารามิเตอร์ | |
---|---|
command | String : คำสั่งที่ควรรัน |
pipeToOutput | OutputStream : ERROR(/OutputStream) ที่เอาต์พุต std จะถูกเปลี่ยนเส้นทาง หรือเป็น null |
คืนสินค้า | |
---|---|
CommandResult | ผลลัพธ์ใน CommandResult |
ขว้าง | |
---|---|
DeviceNotAvailableException | หากขาดการเชื่อมต่อกับอุปกรณ์และไม่สามารถกู้คืนได้ |
executeShellV2Command
public abstract CommandResult executeShellV2Command (String command, File pipeAsInput)
เมธอด Helper ที่รันคำสั่งเชลล์ adb และส่งคืนผลลัพธ์เป็น CommandResult
ที่เติมอย่างถูกต้องด้วยเอาต์พุตสถานะคำสั่ง stdout และ stderr
พารามิเตอร์ | |
---|---|
command | String : คำสั่งที่ควรรัน |
pipeAsInput | File : A ERROR(/File) ที่จะถูกไพพ์เป็นอินพุตของคำสั่ง หรือ null |
คืนสินค้า | |
---|---|
CommandResult | ผลลัพธ์ใน CommandResult |
ขว้าง | |
---|---|
DeviceNotAvailableException | หากขาดการเชื่อมต่อกับอุปกรณ์และไม่สามารถกู้คืนได้ |
executeShellV2Command
public abstract CommandResult executeShellV2Command (String command, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
ดำเนินการคำสั่งเชลล์ adb พร้อมพารามิเตอร์เพิ่มเติมเพื่อควบคุมพฤติกรรมของคำสั่ง
พารามิเตอร์ | |
---|---|
command | String : คำสั่งเชลล์ adb เพื่อเรียกใช้ |
maxTimeoutForCommand | long : หมดเวลาสูงสุดสำหรับคำสั่งให้เสร็จสมบูรณ์; หน่วยตามที่ระบุใน timeUnit |
timeUnit | TimeUnit : หน่วยสำหรับ maxTimeToOutputShellResponse |
retryAttempts | int : จำนวนครั้งสูงสุดที่จะลองคำสั่งอีกครั้งหากล้มเหลวเนื่องจากข้อยกเว้น retryAttempts จะถูกส่งออกไปหากทำการลองใหม่อีกครั้งโดยไม่ประสบความสำเร็จ |
คืนสินค้า | |
---|---|
CommandResult |
ขว้าง | |
---|---|
DeviceNotAvailableException | หากขาดการเชื่อมต่อกับอุปกรณ์และไม่สามารถกู้คืนได้ |
ดูสิ่งนี้ด้วย:
executeShellV2Command
public abstract CommandResult executeShellV2Command (String command, long maxTimeoutForCommand, TimeUnit timeUnit)
ดำเนินการคำสั่งเชลล์ adb พร้อมพารามิเตอร์เพิ่มเติมเพื่อควบคุมพฤติกรรมของคำสั่ง
พารามิเตอร์ | |
---|---|
command | String : คำสั่งเชลล์ adb เพื่อเรียกใช้ |
maxTimeoutForCommand | long : หมดเวลาสูงสุดสำหรับคำสั่งให้เสร็จสมบูรณ์; หน่วยตามที่ระบุใน timeUnit |
timeUnit | TimeUnit : หน่วยสำหรับ maxTimeToOutputShellResponse |
คืนสินค้า | |
---|---|
CommandResult |
ขว้าง | |
---|---|
DeviceNotAvailableException | หากขาดการเชื่อมต่อกับอุปกรณ์และไม่สามารถกู้คืนได้ |
ดูสิ่งนี้ด้วย:
executeShellV2Command
public abstract CommandResult executeShellV2Command (String command, File pipeAsInput, OutputStream pipeToOutput, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
ดำเนินการคำสั่งเชลล์ adb พร้อมพารามิเตอร์เพิ่มเติมเพื่อควบคุมพฤติกรรมของคำสั่ง
พารามิเตอร์ | |
---|---|
command | String : คำสั่งเชลล์ adb เพื่อเรียกใช้ |
pipeAsInput | File : A ERROR(/File) ที่จะถูกไพพ์เป็นอินพุตของคำสั่ง หรือ null |
pipeToOutput | OutputStream : ERROR(/OutputStream) ที่เอาต์พุต std จะถูกเปลี่ยนเส้นทาง หรือเป็น null |
maxTimeoutForCommand | long : หมดเวลาสูงสุดสำหรับคำสั่งให้เสร็จสมบูรณ์; หน่วยตามที่ระบุใน timeUnit |
timeUnit | TimeUnit : หน่วยสำหรับ maxTimeToOutputShellResponse |
retryAttempts | int : จำนวนครั้งสูงสุดที่จะลองคำสั่งอีกครั้งหากล้มเหลวเนื่องจากข้อยกเว้น retryAttempts จะถูกส่งออกไปหากทำการลองใหม่อีกครั้งโดยไม่ประสบความสำเร็จ |
คืนสินค้า | |
---|---|
CommandResult |
ขว้าง | |
---|---|
DeviceNotAvailableException | หากขาดการเชื่อมต่อกับอุปกรณ์และไม่สามารถกู้คืนได้ |
ดูสิ่งนี้ด้วย:
executeShellV2Command
public abstract CommandResult executeShellV2Command (String command, File pipeAsInput, OutputStream pipeToOutput, OutputStream pipeToError, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
ดำเนินการคำสั่งเชลล์ adb พร้อมพารามิเตอร์เพิ่มเติมเพื่อควบคุมพฤติกรรมของคำสั่ง
พารามิเตอร์ | |
---|---|
command | String : คำสั่งเชลล์ adb เพื่อเรียกใช้ |
pipeAsInput | File : A ERROR(/File) ที่จะถูกไพพ์เป็นอินพุตของคำสั่ง หรือ null |
pipeToOutput | OutputStream : ERROR(/OutputStream) ที่เอาต์พุต std จะถูกเปลี่ยนเส้นทาง หรือเป็น null |
pipeToError | OutputStream : ERROR(/OutputStream) ที่ข้อผิดพลาด std จะถูกเปลี่ยนเส้นทาง หรือเป็น null |
maxTimeoutForCommand | long : หมดเวลาสูงสุดสำหรับคำสั่งให้เสร็จสมบูรณ์; หน่วยตามที่ระบุใน timeUnit |
timeUnit | TimeUnit : หน่วยสำหรับ maxTimeToOutputShellResponse |
retryAttempts | int : จำนวนครั้งสูงสุดที่จะลองคำสั่งอีกครั้งหากล้มเหลวเนื่องจากข้อยกเว้น retryAttempts จะถูกส่งออกไปหากทำการลองใหม่อีกครั้งโดยไม่ประสบความสำเร็จ |
คืนสินค้า | |
---|---|
CommandResult |
ขว้าง | |
---|---|
DeviceNotAvailableException | หากขาดการเชื่อมต่อกับอุปกรณ์และไม่สามารถกู้คืนได้ |
ดูสิ่งนี้ด้วย:
fastbootWipePartition
public abstract CommandResult fastbootWipePartition (String partition)
วิธีตัวช่วยที่ล้างพาร์ทิชันสำหรับอุปกรณ์
หากgetUseFastbootErase()
เป็น true
การลบ fastboot จะถูกใช้เพื่อล้างพาร์ติชั่น จากนั้นอุปกรณ์จะต้องสร้างระบบไฟล์ในครั้งต่อไปที่อุปกรณ์บู๊ต มิฉะนั้นจะใช้รูปแบบ fastboot ซึ่งจะสร้างระบบไฟล์ใหม่บนอุปกรณ์ คาดว่าจะใช้เมื่ออุปกรณ์อยู่ในโหมด fastboot แล้วพารามิเตอร์ | |
---|---|
partition | String : พาร์ทิชันที่จะเช็ด |
คืนสินค้า | |
---|---|
CommandResult | CommandResult ที่มีเอาต์พุตของ command |
ขว้าง | |
---|---|
DeviceNotAvailableException | หากขาดการเชื่อมต่อกับอุปกรณ์และไม่สามารถกู้คืนได้ |
getApiLevel
public abstract int getApiLevel ()
รับระดับ API ของอุปกรณ์ ค่าเริ่มต้นเป็น UNKNOWN_API_LEVEL
คืนสินค้า | |
---|---|
int | จำนวนเต็มระบุระดับ API ของอุปกรณ์ |
ขว้าง | |
---|---|
DeviceNotAvailableException |
getBasebandVersion
public abstract String getBasebandVersion ()
วิธีที่สะดวกสบายในการรับเวอร์ชันเบสแบนด์ (วิทยุ) ของอุปกรณ์นี้ การรับเวอร์ชันวิทยุเป็นอุปกรณ์เฉพาะ ดังนั้นจึงอาจไม่ส่งคืนข้อมูลที่ถูกต้องสำหรับอุปกรณ์ทั้งหมด เมธอดนี้อาศัยคุณสมบัติ gsm.version.baseband เพื่อส่งคืนข้อมูลเวอร์ชันที่ถูกต้อง ซึ่งไม่ถูกต้องสำหรับอุปกรณ์ CDMA บางรุ่น และเวอร์ชันที่ส่งคืนที่นี่อาจไม่ตรงกับเวอร์ชันที่รายงานจาก fastboot และอาจไม่ส่งคืนเวอร์ชันสำหรับวิทยุ CDMA TL;DR วิธีการนี้จะรายงานเฉพาะเวอร์ชันที่ถูกต้องหากคุณสมบัติ gsm.version.baseband เหมือนกับเวอร์ชันที่ส่งคืนโดย fastboot getvar version-baseband
คืนสินค้า | |
---|---|
String | เวอร์ชันเบสแบนด์ String หรือ null หากไม่สามารถระบุได้ (อุปกรณ์ไม่มีวิทยุหรือไม่สามารถอ่านสตริงเวอร์ชันได้) |
ขว้าง | |
---|---|
DeviceNotAvailableException | หากการเชื่อมต่อกับอุปกรณ์ขาดหายและไม่สามารถกู้คืนได้ |
รับแบตเตอรี่
public abstract Integer getBattery ()
ส่งกลับระดับแบตเตอรี่ปัจจุบันของอุปกรณ์หรือ Null หากระดับแบตเตอรี่ไม่พร้อมใช้งาน
คืนสินค้า | |
---|---|
Integer |
getBooleanProperty
public abstract boolean getBooleanProperty (String name, boolean defaultValue)
ส่งกลับค่าบูลีนของคุณสมบัติที่กำหนด
พารามิเตอร์ | |
---|---|
name | String : ชื่อคุณสมบัติ |
defaultValue | boolean : ค่าเริ่มต้นที่จะส่งคืนหากคุณสมบัติว่างเปล่าหรือไม่มีอยู่ |
คืนสินค้า | |
---|---|
boolean | true หากคุณสมบัติมีค่า "1" , "y" , "yes" , "on" หรือ "true" false หากคุณสมบัติมีค่าเป็น "0" , "n" , "no" , "off" , "false" หรือ defaultValue อย่างอื่น |
ขว้าง | |
---|---|
DeviceNotAvailableException |
getBootHistory
public abstractgetBootHistory ()
เมธอด Helper รวบรวมแมปประวัติการบู๊ตพร้อมเวลาบู๊ตและเหตุผลในการบู๊ต
คืนสินค้า | |
---|---|
แผนที่ของเวลาบูต (เวลา UTC เป็นวินาทีตั้งแต่ Epoch) และเหตุผลในการบูต |
ขว้าง | |
---|---|
DeviceNotAvailableException |
getBootHistoryตั้งแต่
public abstractgetBootHistorySince (long utcEpochTime, TimeUnit timeUnit)
เมธอด Helper รวบรวมแมปประวัติการบู๊ตพร้อมเวลาบู๊ตและเหตุผลการบู๊ตตั้งแต่เวลาที่กำหนดตั้งแต่ยุคจากอุปกรณ์และหน่วยเวลาที่ระบุ อุปกรณ์ปัจจุบัน utcEpochTime ในหน่วยมิลลิวินาทีสามารถรับได้โดยวิธี getDeviceDate()
พารามิเตอร์ | |
---|---|
utcEpochTime | long : ระยะเวลาของอุปกรณ์ตั้งแต่ Epoch |
timeUnit | TimeUnit : หน่วยเวลา TimeUnit |
คืนสินค้า | |
---|---|
แผนที่ของเวลาบูต (เวลา UTC เป็นวินาทีตั้งแต่ Epoch) และเหตุผลในการบูต |
ขว้าง | |
---|---|
DeviceNotAvailableException |
getBootloaderVersion
public abstract String getBootloaderVersion ()
วิธีที่สะดวกสบายในการรับรุ่น bootloader ของอุปกรณ์นี้
จะพยายามเรียกเวอร์ชัน bootloader จากสถานะปัจจุบันของอุปกรณ์ (เช่น หากอุปกรณ์อยู่ในโหมด fastboot จะพยายามดึงข้อมูลเวอร์ชันจาก fastboot)คืนสินค้า | |
---|---|
String | เวอร์ชัน String bootloader หรือ null หากไม่พบ |
ขว้าง | |
---|---|
DeviceNotAvailableException | หากขาดการเชื่อมต่อกับอุปกรณ์และไม่สามารถกู้คืนได้ |
getBugreport
public abstract InputStreamSource getBugreport ()
ดึงรายงานข้อผิดพลาดจากอุปกรณ์
การดำเนินการนี้รับประกันว่าจะทำงานต่อบนอุปกรณ์ที่ไม่มี sdcard (หรือที่ยังไม่ได้ติดตั้ง sdcard)คืนสินค้า | |
---|---|
InputStreamSource | InputStreamSource ที่จะสร้างเนื้อหารายงานข้อบกพร่องตามความต้องการ ในกรณีที่เกิดความล้มเหลว InputStreamSource จะสร้าง ERROR(/InputStream) ที่ว่างเปล่า |
getBugreportz
public abstract InputStreamSource getBugreportz ()
ดึงรายงานข้อผิดพลาดจากอุปกรณ์ รายงานจุดบกพร่องรูปแบบ Zip ประกอบด้วยรายงานจุดบกพร่องหลักและไฟล์บันทึกอื่นๆ ที่เป็นประโยชน์สำหรับการดีบัก
รองรับเฉพาะ 'รุ่น adb' > 1.0.36คืนสินค้า | |
---|---|
InputStreamSource | InputStreamSource ของไฟล์ zip ที่มี bugreportz ส่งคืน null ในกรณีที่เกิดความล้มเหลว |
getBuildAlias
public abstract String getBuildAlias ()
เรียกชื่อแทนของบิลด์ที่อุปกรณ์กำลังทำงานอยู่
Build alias มักจะเป็นสตริงที่อ่านง่ายกว่า build id (โดยทั่วไปจะเป็นตัวเลขสำหรับ Nexus builds) ตัวอย่างเช่น การเปิดตัว Android 4.2 ขั้นสุดท้ายมีชื่อแทนการสร้าง JDQ39 และรหัสบิวด์ 573038
คืนสินค้า | |
---|---|
String | build alias หรือถอยกลับไป build id หากไม่สามารถเรียกค้นได้ |
ขว้าง | |
---|---|
DeviceNotAvailableException |
getBuildFlavor
public abstract String getBuildFlavor ()
เรียกสร้างรสชาติสำหรับอุปกรณ์
คืนสินค้า | |
---|---|
String | สร้างรสชาติหรือเป็นโมฆะหากไม่สามารถเรียกคืนได้ |
ขว้าง | |
---|---|
DeviceNotAvailableException |
getBuildId
public abstract String getBuildId ()
ดึงข้อมูลบิลด์ที่อุปกรณ์กำลังทำงานอยู่
คืนสินค้า | |
---|---|
String | build id หรือ IBuildInfo#UNKNOWN_BUILD_ID หากไม่สามารถเรียกค้นได้ |
ขว้าง | |
---|---|
DeviceNotAvailableException |
getBuildSigningKeys
public abstract String getBuildSigningKeys ()
ส่งคืนประเภทคีย์ที่ใช้ในการลงนามในอิมเมจอุปกรณ์
โดยปกติอุปกรณ์ Android อาจลงนามด้วยคีย์ทดสอบ (เช่นใน AOSP) หรือคีย์การวางจำหน่าย (ควบคุมโดยผู้ผลิตอุปกรณ์แต่ละราย)
คืนสินค้า | |
---|---|
String | คีย์การเซ็นชื่อหากพบ มิฉะนั้นจะเป็นโมฆะ |
ขว้าง | |
---|---|
DeviceNotAvailableException |
getCachedDeviceDescriptor
public abstract DeviceDescriptor getCachedDeviceDescriptor ()
ส่งคืน DeviceDescriptor
ที่แคชไว้ หากอุปกรณ์ได้รับการจัดสรร มิฉะนั้นจะส่งคืน DeviceDescriptor
ปัจจุบัน
คืนสินค้า | |
---|---|
DeviceDescriptor |
getCachedDeviceDescriptor
public abstract DeviceDescriptor getCachedDeviceDescriptor (boolean shortDescriptor)
ส่งคืน DeviceDescriptor
ที่แคชไว้ หากอุปกรณ์ได้รับการจัดสรร มิฉะนั้นจะส่งคืน DeviceDescriptor
ปัจจุบัน
พารามิเตอร์ | |
---|---|
shortDescriptor | boolean : จะจำกัด descriptor ให้เหลือแค่ข้อมูลขั้นต่ำหรือไม่ก็ตาม |
คืนสินค้า | |
---|---|
DeviceDescriptor |
รับเด็ก
public abstract String[] getChildren (String deviceFilePath)
ทางเลือกอื่นในการใช้ IFileEntry
ที่บางครั้งใช้ไม่ได้เนื่องจากการอนุญาต
พารามิเตอร์ | |
---|---|
deviceFilePath | String : เป็นเส้นทางบนอุปกรณ์ที่จะทำการค้นหา |
คืนสินค้า | |
---|---|
String[] | อาร์เรย์ของสตริงที่มีไฟล์ทั้งหมดในพาธบนอุปกรณ์ |
ขว้าง | |
---|---|
DeviceNotAvailableException |
getDeviceClass
public abstract String getDeviceClass ()
รับคลาสอุปกรณ์
คืนสินค้า | |
---|---|
String | คลาสอุปกรณ์ String |
getDeviceDate
public abstract long getDeviceDate ()
ส่งคืนวันที่ของอุปกรณ์เป็นมิลลิวินาทีตั้งแต่ยุค
คืนสินค้า | |
---|---|
long | วันที่ของอุปกรณ์ในรูปแบบยุค |
ขว้าง | |
---|---|
DeviceNotAvailableException |
getDeviceDescriptor
public abstract DeviceDescriptor getDeviceDescriptor ()
ส่งคืน DeviceDescriptor
จากข้อมูลอุปกรณ์เพื่อรับข้อมูลโดยไม่ผ่านอ็อบเจ็กต์อุปกรณ์จริง
คืนสินค้า | |
---|---|
DeviceDescriptor |
getDeviceDescriptor
public abstract DeviceDescriptor getDeviceDescriptor (boolean shortDescriptor)
ส่งคืน DeviceDescriptor
จากข้อมูลอุปกรณ์เพื่อรับข้อมูลโดยไม่ผ่านอ็อบเจ็กต์อุปกรณ์จริง
พารามิเตอร์ | |
---|---|
shortDescriptor | boolean : จะจำกัด descriptor ให้เหลือแค่ข้อมูลขั้นต่ำหรือไม่ก็ตาม |
คืนสินค้า | |
---|---|
DeviceDescriptor |
getDeviceState
public abstract TestDeviceState getDeviceState ()
รับสถานะของอุปกรณ์
คืนสินค้า | |
---|---|
TestDeviceState |
getDeviceTimeOffset
public abstract long getDeviceTimeOffset (Date date)
ตัวช่วยรับความแตกต่างของเวลาระหว่างอุปกรณ์กับ ERROR(/Date)
กำหนด ใช้เวลา Epoch ภายใน
พารามิเตอร์ | |
---|---|
date | Date |
คืนสินค้า | |
---|---|
long | ความแตกต่างในหน่วยมิลลิวินาที |
ขว้าง | |
---|---|
DeviceNotAvailableException |
getEmulatorOutput
public abstract InputStreamSource getEmulatorOutput ()
รับสตรีมของโปรแกรมจำลอง stdout และ stderr
คืนสินค้า | |
---|---|
InputStreamSource | อีมูเลเตอร์เอาท์พุต |
getExternalStoreFreeSpace
public abstract long getExternalStoreFreeSpace ()
วิธี Helper เพื่อกำหนดจำนวนพื้นที่ว่างบนที่จัดเก็บข้อมูลภายนอกของอุปกรณ์
คืนสินค้า | |
---|---|
long | จำนวนพื้นที่ว่างในหน่วย KB |
ขว้าง | |
---|---|
DeviceNotAvailableException | หากขาดการเชื่อมต่อกับอุปกรณ์และไม่สามารถกู้คืนได้ |
getFastbootProductType
public abstract String getFastbootProductType ()
วิธีที่สะดวกสบายในการรับประเภทผลิตภัณฑ์ของอุปกรณ์นี้เมื่ออยู่ในโหมด fastboot
วิธีนี้ควรใช้เฉพาะเมื่ออุปกรณ์ควรอยู่ใน fastboot เป็นตัวแปรที่ปลอดภัยกว่าวิธีgetProductType()
ทั่วไปเล็กน้อยในกรณีนี้ เนื่องจาก ITestDevice จะรู้ว่าจะกู้คืนอุปกรณ์เป็น fastboot หากอุปกรณ์อยู่ในสถานะที่ไม่ถูกต้องหรือไม่ตอบสนองคืนสินค้า | |
---|---|
String | ชื่อประเภทผลิตภัณฑ์ String หรือ null หากไม่สามารถระบุได้ |
ขว้าง | |
---|---|
DeviceNotAvailableException | หากขาดการเชื่อมต่อกับอุปกรณ์และไม่สามารถกู้คืนได้ |
getFastbootProductVariant
public abstract String getFastbootProductVariant ()
วิธีที่สะดวกสบายในการรับประเภทผลิตภัณฑ์ของอุปกรณ์นี้เมื่ออยู่ในโหมด fastboot
วิธีนี้ควรใช้เฉพาะเมื่ออุปกรณ์ควรอยู่ใน fastboot เป็นตัวแปรที่ปลอดภัยกว่าวิธีgetProductType()
ทั่วไปเล็กน้อยในกรณีนี้ เนื่องจาก ITestDevice จะรู้ว่าจะกู้คืนอุปกรณ์เป็น fastboot หากอุปกรณ์อยู่ในสถานะที่ไม่ถูกต้องหรือไม่ตอบสนองคืนสินค้า | |
---|---|
String | ชื่อประเภทผลิตภัณฑ์ String หรือ null หากไม่สามารถระบุได้ |
ขว้าง | |
---|---|
DeviceNotAvailableException | หากขาดการเชื่อมต่อกับอุปกรณ์และไม่สามารถกู้คืนได้ |
getFastbootSerialNumber
public abstract String getFastbootSerialNumber ()
ส่งกลับหมายเลขซีเรียลของโหมด fastboot
คืนสินค้า | |
---|---|
String |
getFastbootVariable
public abstract String getFastbootVariable (String variableName)
ดึงค่าตัวแปร fastboot ที่กำหนดจากอุปกรณ์
พารามิเตอร์ | |
---|---|
variableName | String : ชื่อตัวแปร |
คืนสินค้า | |
---|---|
String | ค่าคุณสมบัติหรือ null หากไม่มีอยู่ |
ขว้าง | |
---|---|
| UnsupportedOperationException |
DeviceNotAvailableException |
getFileEntry
public abstract IFileEntry getFileEntry (String path)
ดึงข้อมูลอ้างอิงไปยังไฟล์ระยะไกลบนอุปกรณ์
พารามิเตอร์ | |
---|---|
path | String : เส้นทางของไฟล์ที่จะดึงข้อมูล สามารถเป็นเส้นทางสัมบูรณ์หรือเส้นทางที่สัมพันธ์กับ '/' (เช่น รองรับทั้ง "/system" และ "system" syntax) |
คืนสินค้า | |
---|---|
IFileEntry | IFileEntry หรือ null หากไม่พบไฟล์ที่ path ที่กำหนด |
ขว้าง | |
---|---|
DeviceNotAvailableException |
getIDevice
public abstract IDevice getIDevice ()
ส่งคืนการอ้างอิงไปยัง ddmlib IDevice
ที่เกี่ยวข้อง
IDevice
ใหม่ทุกครั้งที่อุปกรณ์ยกเลิกการเชื่อมต่อและเชื่อมต่อใหม่จาก adb ดังนั้นผู้โทรจึงไม่ควรอ้างอิงถึง IDevice
เพราะการอ้างอิงนั้นอาจล้าสมัยคืนสินค้า | |
---|---|
IDevice | IDevice |
getIntProperty
public abstract long getIntProperty (String name, long defaultValue)
ส่งคืนค่าจำนวนเต็มของคุณสมบัติที่กำหนดจากอุปกรณ์
พารามิเตอร์ | |
---|---|
name | String : ชื่อคุณสมบัติ |
defaultValue | long : ค่าเริ่มต้นที่จะส่งคืนหากคุณสมบัติว่างเปล่าหรือไม่มีอยู่ |
คืนสินค้า | |
---|---|
long | ค่าคุณสมบัติหรือ defaultValue หากคุณสมบัติว่างเปล่า ไม่มีอยู่ หรือไม่มีค่าจำนวนเต็ม |
ขว้าง | |
---|---|
DeviceNotAvailableException |
getLastExpectedRebootTimeMillis
public abstract long getLastExpectedRebootTimeMillis ()
ส่งคืน Tradefed API ครั้งล่าสุดที่ทริกเกอร์การรีบูตในหน่วยมิลลิวินาทีตั้งแต่ EPOCH ตามที่ส่งคืนโดย System.currentTimeMillis()
คืนสินค้า | |
---|---|
long |
getLaunchApiLevel
public abstract int getLaunchApiLevel ()
รับระดับ API ที่เปิดตัวครั้งแรกของอุปกรณ์ ค่าเริ่มต้นเป็น UNKNOWN_API_LEVEL
คืนสินค้า | |
---|---|
int | จำนวนเต็มระบุระดับ API ที่เปิดใช้ครั้งแรกของอุปกรณ์ |
ขว้าง | |
---|---|
DeviceNotAvailableException |
getLogcat
public abstract InputStreamSource getLogcat ()
ดึงสแนปชอตสตรีมของข้อมูล logcat
ทำงานในสองโหมด:
TestDeviceOptions.getMaxLogcatDataSize()
ของเนื้อหาปัจจุบันของการดักจับพื้นหลังคืนสินค้า | |
---|---|
InputStreamSource |
getLogcat
public abstract InputStreamSource getLogcat (int maxBytes)
ดึงสตรีมสแนปชอตของ maxBytes
สุดท้ายของข้อมูล logcat ที่บันทึกไว้
มีประโยชน์สำหรับกรณีที่คุณต้องการจับภาพสแน็ปช็อตบ่อยๆ ของข้อมูล logcat ที่จับได้ โดยไม่ทำให้เกิดโทษพื้นที่ดิสก์ขนาดใหญ่ในการรับสแน็ปช็อต getLogcat()
ทั้งหมด
พารามิเตอร์ | |
---|---|
maxBytes | int : จำนวนข้อมูลสูงสุดที่จะส่งคืน Should be an amount that can comfortably fit in memory |
คืนสินค้า | |
---|---|
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.
คืนสินค้า | |
---|---|
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()
.
พารามิเตอร์ | |
---|---|
date | long : in millisecond since epoch format of when to start the snapshot until present. (can be be obtained using 'date +%s') |
คืนสินค้า | |
---|---|
InputStreamSource |
getMountPoint
public abstract String getMountPoint (String mountName)
Returns a mount point.
Queries the device directly if the cached info inIDevice
is not available. TODO: move this behavior to IDevice#getMountPoint(String)
พารามิเตอร์ | |
---|---|
mountName | String : the name of the mount point |
คืนสินค้า | |
---|---|
String | the mount point or null |
See also:
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.
พารามิเตอร์ | |
---|---|
mountpoint | String |
คืนสินค้า | |
---|---|
ITestDevice.MountPointInfo | A ERROR(/List) of MountPointInfo containing the information in "/proc/mounts" |
ขว้าง | |
---|---|
DeviceNotAvailableException |
See also:
getMountPointInfo
public abstractgetMountPointInfo ()
Returns a parsed version of the information in /proc/mounts on the device
คืนสินค้า | |
---|---|
A ERROR(/List) of MountPointInfo containing the information in "/proc/mounts" |
ขว้าง | |
---|---|
DeviceNotAvailableException |
getPartitionFreeSpace
public abstract long getPartitionFreeSpace (String partition)
Helper method to determine amount of free space on device partition.
พารามิเตอร์ | |
---|---|
partition | String |
คืนสินค้า | |
---|---|
long | the amount of free space in KB |
ขว้าง | |
---|---|
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.
พารามิเตอร์ | |
---|---|
processName | String : the proces name String. |
คืนสินค้า | |
---|---|
ProcessInfo | ProcessInfo of given processName |
ขว้าง | |
---|---|
DeviceNotAvailableException |
getProcessPid
public abstract String getProcessPid (String process)
Returns the pid of the service or null if something went wrong.
พารามิเตอร์ | |
---|---|
process | String : The proces name String. |
คืนสินค้า | |
---|---|
String |
ขว้าง | |
---|---|
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.คืนสินค้า | |
---|---|
String | the String product type name. Will not be null |
ขว้าง | |
---|---|
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.คืนสินค้า | |
---|---|
String | the String product variant name or null if it cannot be determined |
ขว้าง | |
---|---|
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.
พารามิเตอร์ | |
---|---|
name | String : the property name |
คืนสินค้า | |
---|---|
String | the property value or null if it does not exist |
ขว้าง | |
---|---|
DeviceNotAvailableException |
getRecoveryMode
public abstract ITestDevice.RecoveryMode getRecoveryMode ()
Get the current recovery mode used for the device.
คืนสินค้า | |
---|---|
ITestDevice.RecoveryMode | the current recovery mode used for the device. |
getSerialNumber
public abstract String getSerialNumber ()
Convenience method to get serial number of this device.
คืนสินค้า | |
---|---|
String | the String serial number |
getTombstones
public abstractgetTombstones ()
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.
คืนสินค้า | |
---|---|
A list of tombstone files, empty if no tombstone. |
ขว้าง | |
---|---|
DeviceNotAvailableException |
See also:
getTotalMemory
public abstract long getTotalMemory ()
Returns total physical memory size in bytes or -1 in case of internal error
คืนสินค้า | |
---|---|
long |
getUseFastbootErase
public abstract boolean getUseFastbootErase ()
Get whether to use fastboot erase or fastboot format to wipe a partition on the device.
คืนสินค้า | |
---|---|
boolean | true if fastboot erase will be used or false if fastboot format will be used. |
See also:
isAdbRoot
public abstract boolean isAdbRoot ()
คืนสินค้า | |
---|---|
boolean | true if device currently has adb root, false otherwise. |
ขว้าง | |
---|---|
DeviceNotAvailableException | if connection with device is lost and cannot be recovered. |
isAdbTcp
public abstract boolean isAdbTcp ()
คืนสินค้า | |
---|---|
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
คืนสินค้า | |
---|---|
boolean | True if app enumeration is supported, false otherwise |
ขว้าง | |
---|---|
DeviceNotAvailableException |
isDeviceEncrypted
public abstract boolean isDeviceEncrypted ()
Returns if the device is encrypted.
คืนสินค้า | |
---|---|
boolean | true if the device is encrypted. |
ขว้าง | |
---|---|
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.
พารามิเตอร์ | |
---|---|
deviceFilePath | String |
คืนสินค้า | |
---|---|
boolean |
ขว้าง | |
---|---|
DeviceNotAvailableException |
isEncryptionSupported
public abstract boolean isEncryptionSupported ()
Returns if encryption is supported on the device.
คืนสินค้า | |
---|---|
boolean | true if the device supports encryption. |
ขว้าง | |
---|---|
DeviceNotAvailableException |
isExecutable
public abstract boolean isExecutable (String fullPath)
Returns True if the file path on the device is an executable file, false otherwise.
พารามิเตอร์ | |
---|---|
fullPath | String |
คืนสินค้า | |
---|---|
boolean |
ขว้าง | |
---|---|
DeviceNotAvailableException |
isHeadless
public abstract boolean isHeadless ()
Return true if the device is headless (no screen), false otherwise.
คืนสินค้า | |
---|---|
boolean |
ขว้าง | |
---|---|
DeviceNotAvailableException |
isRuntimePermissionSupported
public abstract boolean isRuntimePermissionSupported ()
Check whether platform on device supports runtime permission granting
คืนสินค้า | |
---|---|
boolean | True if runtime permission are supported, false otherwise. |
ขว้าง | |
---|---|
DeviceNotAvailableException |
isStateBootloaderOrFastbootd
public abstract boolean isStateBootloaderOrFastbootd ()
Returns true if device is in TestDeviceState#FASTBOOT
or TestDeviceState.FASTBOOTD
.
คืนสินค้า | |
---|---|
boolean |
logAnrs
public abstract boolean logAnrs (ITestLogger logger)
Collects and log ANRs from the device.
พารามิเตอร์ | |
---|---|
logger | ITestLogger : an ITestLogger to log the ANRs. |
คืนสินค้า | |
---|---|
boolean | True if the logging was successful, false otherwise. |
ขว้าง | |
---|---|
DeviceNotAvailableException |
logBugreport
public abstract boolean logBugreport (String dataName, ITestLogger listener)
Helper method to take a bugreport and log it to the reporters.
พารามิเตอร์ | |
---|---|
dataName | String : name under which the bugreport will be reported. |
listener | ITestLogger : an ITestLogger to log the bugreport. |
คืนสินค้า | |
---|---|
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.
พารามิเตอร์ | |
---|---|
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.
ขว้าง | |
---|---|
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)ขว้าง | |
---|---|
DeviceNotAvailableException | if connection with device is lost and cannot be recovered. |
postInvocationTearDown
public void postInvocationTearDown ()
วิธีนี้เลิกใช้แล้ว
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.
พารามิเตอร์ | |
---|---|
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.
พารามิเตอร์ | |
---|---|
info | IBuildInfo : The IBuildInfo of the device. |
attributes | MultiMap : The attributes stored in the invocation context |
ขว้าง | |
---|---|
| com.android.tradefed.targetprep.TargetSetupError |
DeviceNotAvailableException | |
TargetSetupError |
pullDir
public abstract boolean pullDir (String deviceFilePath, File localDir)
Recursively pull directory contents from device.
พารามิเตอร์ | |
---|---|
deviceFilePath | String : the absolute file path of the remote source |
localDir | File : the local directory to pull files into |
คืนสินค้า | |
---|---|
boolean | true if file was pulled successfully. false otherwise. |
ขว้าง | |
---|---|
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
.
พารามิเตอร์ | |
---|---|
remoteFilePath | String : the absolute path to file on device. |
userId | int : The user id to pull from |
คืนสินค้า | |
---|---|
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) |
ขว้าง | |
---|---|
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
.
พารามิเตอร์ | |
---|---|
remoteFilePath | String : the absolute path to file on device. |
คืนสินค้า | |
---|---|
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) |
ขว้าง | |
---|---|
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.
พารามิเตอร์ | |
---|---|
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. |
คืนสินค้า | |
---|---|
boolean | true if file was retrieved successfully. false otherwise. |
ขว้าง | |
---|---|
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.
พารามิเตอร์ | |
---|---|
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 |
คืนสินค้า | |
---|---|
boolean | true if file was retrieved successfully. false otherwise. |
ขว้าง | |
---|---|
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.
พารามิเตอร์ | |
---|---|
remoteFilePath | String : the absolute path to file on device. |
คืนสินค้า | |
---|---|
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) |
ขว้าง | |
---|---|
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
.
พารามิเตอร์ | |
---|---|
remoteFilePath | String : the path to file on device, relative to the device's external storage mountpoint |
คืนสินค้า | |
---|---|
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) |
ขว้าง | |
---|---|
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.
พารามิเตอร์ | |
---|---|
localDir | File : the local directory to push |
deviceFilePath | String : the absolute file path of the remote destination |
excludedDirectories |
คืนสินค้า | |
---|---|
boolean | true if file was pushed successfully. false otherwise. |
ขว้าง | |
---|---|
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.
พารามิเตอร์ | |
---|---|
localDir | File : the local directory to push |
deviceFilePath | String : the absolute file path of the remote destination |
คืนสินค้า | |
---|---|
boolean | true if file was pushed successfully. false otherwise. |
ขว้าง | |
---|---|
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.
พารามิเตอร์ | |
---|---|
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 |
คืนสินค้า | |
---|---|
boolean | true if file was pushed successfully. false otherwise. |
ขว้าง | |
---|---|
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.
พารามิเตอร์ | |
---|---|
localFile | File : the local file to push |
deviceFilePath | String : the remote destination absolute file path |
คืนสินค้า | |
---|---|
boolean | true if file was pushed successfully. false otherwise. |
ขว้าง | |
---|---|
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
พารามิเตอร์ | |
---|---|
contents | String : the contents of the file to push |
deviceFilePath | String : the remote destination absolute file path |
คืนสินค้า | |
---|---|
boolean | true if string was pushed successfully. false otherwise. |
ขว้าง | |
---|---|
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.ขว้าง | |
---|---|
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.
พารามิเตอร์ | |
---|---|
reason | String : a reason for this reboot, or null if no reason is specified. |
ขว้าง | |
---|---|
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.ขว้าง | |
---|---|
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.
ขว้าง | |
---|---|
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ขว้าง | |
---|---|
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
พารามิเตอร์ | |
---|---|
autoReboot | boolean : whether to automatically reboot the device after sideload |
ขว้าง | |
---|---|
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
ขว้าง | |
---|---|
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.
ขว้าง | |
---|---|
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.
พารามิเตอร์ | |
---|---|
reason | String : a reason for this reboot, or null if no reason is specified. |
ขว้าง | |
---|---|
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.
ขว้าง | |
---|---|
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.
ขว้าง | |
---|---|
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.
ขว้าง | |
---|---|
DeviceNotAvailableException |
remountVendorWritable
public abstract void remountVendorWritable ()
Make the vendor partition on the device writable. May reboot the device.
ขว้าง | |
---|---|
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.
พารามิเตอร์ | |
---|---|
runner | IRemoteAndroidTestRunner : the IRemoteAndroidTestRunner which runs the tests |
listeners | ITestLifeCycleReceiver : the test result listener(s) |
คืนสินค้า | |
---|---|
boolean | true if test command completed. false if it failed to complete, but recovery succeeded |
ขว้าง | |
---|---|
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.
พารามิเตอร์ | |
---|---|
runner | IRemoteAndroidTestRunner : the IRemoteAndroidTestRunner which runs the tests |
listeners |
คืนสินค้า | |
---|---|
boolean | true if test command completed. false if it failed to complete due to device communication exception, but recovery succeeded |
ขว้าง | |
---|---|
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.
พารามิเตอร์ | |
---|---|
runner | IRemoteAndroidTestRunner |
userId | int |
listeners | ITestLifeCycleReceiver |
คืนสินค้า | |
---|---|
boolean |
ขว้าง | |
---|---|
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.
พารามิเตอร์ | |
---|---|
runner | IRemoteAndroidTestRunner |
userId | int |
listeners |
คืนสินค้า | |
---|---|
boolean |
ขว้าง | |
---|---|
DeviceNotAvailableException |
setDate
public abstract void setDate (Date date)
Sets the date on device
Note: setting date on device requires root
พารามิเตอร์ | |
---|---|
date | Date : specify a particular date; will use host date if null |
ขว้าง | |
---|---|
DeviceNotAvailableException |
setOptions
public abstract void setOptions (TestDeviceOptions options)
Set the TestDeviceOptions
for the device
พารามิเตอร์ | |
---|---|
options | TestDeviceOptions |
setProperty
public abstract boolean setProperty (String propKey, String propValue)
Sets the given property value on the device. Requires adb root is true.
พารามิเตอร์ | |
---|---|
propKey | String : The key targeted to be set. |
propValue | String : The property value to be set. |
คืนสินค้า | |
---|---|
boolean | returns True if the setprop command was successful, False otherwise. |
ขว้าง | |
---|---|
DeviceNotAvailableException |
setRecovery
public abstract void setRecovery (IDeviceRecovery recovery)
Set the IDeviceRecovery
to use for this device. Should be set when device is first allocated.
พารามิเตอร์ | |
---|---|
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พารามิเตอร์ | |
---|---|
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.
พารามิเตอร์ | |
---|---|
useFastbootErase | boolean : true if fastboot erase should be used or false if fastboot format should be used. |
See also:
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.
คืนสินค้า | |
---|---|
String | the tcp serial number or null if device could not be switched |
ขว้าง | |
---|---|
DeviceNotAvailableException |
switchToAdbUsb
public abstract boolean switchToAdbUsb ()
Switch device to adb over usb mode.
คืนสินค้า | |
---|---|
boolean | true if switch was successful, false otherwise. |
ขว้าง | |
---|---|
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.พารามิเตอร์ | |
---|---|
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 |
คืนสินค้า | |
---|---|
boolean | true if files were synced successfully. false otherwise. |
ขว้าง | |
---|---|
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.
Bugreport#close()
.คืนสินค้า | |
---|---|
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 callpostBootSetup()
. Therefore, the device might not be fully ready to be tested when this method returns.คืนสินค้า | |
---|---|
boolean | true if successful or if the device is unencrypted. |
ขว้าง | |
---|---|
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.
พารามิเตอร์ | |
---|---|
timeOut | long : time in msecs to wait for the flag to be set |
คืนสินค้า | |
---|---|
boolean | true if device's boot complete flag is set within the timeout |
ขว้าง | |
---|---|
DeviceNotAvailableException |
waitForDeviceAvailable
public abstract boolean waitForDeviceAvailable ()
Waits for the device to be responsive and available for testing. Uses default timeout.
คืนสินค้า | |
---|---|
boolean | True if device is available, False if recovery is disabled and unavailable. |
ขว้าง | |
---|---|
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.
พารามิเตอร์ | |
---|---|
waitTime | long : the time in ms to wait |
คืนสินค้า | |
---|---|
boolean | True if device is available, False if recovery is disabled and unavailable. |
ขว้าง | |
---|---|
DeviceNotAvailableException | if device is still unresponsive after waitTime expires. |
waitForDeviceBootloader
public abstract void waitForDeviceBootloader ()
Blocks until device is visible via fastboot. Use default timeout.
ขว้าง | |
---|---|
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
).
พารามิเตอร์ | |
---|---|
waitTime | long : the time in ms to wait |
คืนสินค้า | |
---|---|
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
พารามิเตอร์ | |
---|---|
waitTime | long : the time in ms to wait |
คืนสินค้า | |
---|---|
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
พารามิเตอร์ | |
---|---|
waitTime | long : the time in ms to wait |
คืนสินค้า | |
---|---|
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. UsewaitForDeviceAvailable()
instead.ขว้าง | |
---|---|
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. UsewaitForDeviceAvailable()
instead.พารามิเตอร์ | |
---|---|
waitTime | long : the time in ms to wait |
ขว้าง | |
---|---|
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.
พารามิเตอร์ | |
---|---|
waitTime | long : the time in ms to wait |
คืนสินค้า | |
---|---|
boolean | true if device becomes responsive before waitTime elapses. |