INativeDevice
public interface INativeDevice
com.android.tradefed.device.INativeDevice |
يوفر واجهة برمجة تطبيقات موثوقة وذات مستوى أعلى قليلاً لجهاز 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 السابق |
abstract boolean | deviceSoftRestartedSince (long utcEpochTime, TimeUnit timeUnit) طريقة مساعدة للتحقق مما إذا كان الجهاز قد تمت إعادة تشغيله بشكل بسيط منذ وقت UTC منذ الحقبة من الجهاز |
abstract boolean | disableAdbRoot () يوقف adb root. |
abstract boolean | doesFileExist (String deviceFilePath) طريقة مساعدة لتحديد ما إذا كان الملف على الجهاز موجودًا. |
abstract boolean | enableAdbRoot () يتحول على adb root. |
abstract String | executeAdbCommand (long timeout, String... commandArgs) طريقة المساعد التي تنفذ أمر adb كأمر نظام مع مهلة محددة. |
abstract String | executeAdbCommand (String... commandArgs) طريقة المساعد التي تنفذ أمر adb كأمر نظام. |
abstract String | executeAdbCommand (long timeout, envMap, String... commandArgs) executeAdbCommand (long timeout, envMap, String... commandArgs) طريقة المساعد التي تنفذ أمر adb كأمر نظام مع مهلة محددة. |
abstract CommandResult | executeFastbootCommand (long timeout, String... commandArgs) طريقة المساعد التي تنفذ أمر fastboot كأمر نظام. |
abstract CommandResult | executeFastbootCommand (String... commandArgs) طريقة المساعدة التي تنفذ أمر fastboot كأمر نظام مع مهلة افتراضية تبلغ دقيقتين. |
abstract CommandResult | executeLongFastbootCommand (String... commandArgs) طريقة المساعد التي تقوم بتنفيذ أمر fastboot الذي يعمل لفترة طويلة كأمر نظام. |
abstract CommandResult | executeLongFastbootCommand ( envVarMap, String... commandArgs) executeLongFastbootCommand ( envVarMap, String... commandArgs) طريقة المساعد التي تنفذ أمر fastboot الذي يعمل لفترة طويلة كأمر نظام مع متغيرات بيئة النظام. |
abstract String | executeShellCommand (String command) هو أسلوب المساعد الذي ينفذ أمر adb shell ويعيد الإخراج |
abstract void | executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts) ينفذ أمر adb shell ، مع المزيد من المعلمات للتحكم في سلوك الأمر. |
abstract void | executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeoutForCommand, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts) ينفذ أمر adb shell ، مع المزيد من المعلمات للتحكم في سلوك الأمر. |
abstract void | executeShellCommand (String command, IShellOutputReceiver receiver) ينفذ الأمر adb shell المحدد ، ويعيد المحاولة عدة مرات إذا فشل الأمر. |
abstract CommandResult | executeShellV2Command (String command) طريقة المساعد التي تنفذ أمر شل adb وتعيد النتائج كإنتاج |
abstract CommandResult | executeShellV2Command (String command, OutputStream pipeToOutput) أسلوب المساعد الذي ينفذ أمر شل adb ويعيد النتائج كإنتاج |
abstract CommandResult | executeShellV2Command (String command, File pipeAsInput) أسلوب المساعد الذي ينفذ أمر adb shell ويعيد النتائج كإنتاج |
abstract CommandResult | executeShellV2Command (String command, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts) ينفذ أمر adb shell ، مع المزيد من المعلمات للتحكم في سلوك الأمر. |
abstract CommandResult | executeShellV2Command (String command, long maxTimeoutForCommand, TimeUnit timeUnit) ينفذ أمر adb shell ، مع المزيد من المعلمات للتحكم في سلوك الأمر. |
abstract CommandResult | executeShellV2Command (String command, File pipeAsInput, OutputStream pipeToOutput, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts) ينفذ أمر adb shell ، مع المزيد من المعلمات للتحكم في سلوك الأمر. |
abstract CommandResult | executeShellV2Command (String command, File pipeAsInput, OutputStream pipeToOutput, OutputStream pipeToError, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts) ينفذ أمر adb shell ، مع المزيد من المعلمات للتحكم في سلوك الأمر. |
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 () تجمع طريقة المساعد خريطة محفوظات التمهيد مع وقت التمهيد وسبب التمهيد. |
abstract | getBootHistorySince (long utcEpochTime, TimeUnit timeUnit) يجمع أسلوب المساعد خريطة محفوظات التمهيد مع وقت التمهيد وسبب التمهيد منذ الوقت المحدد منذ الحقبة من الجهاز والوحدة الزمنية المحددة. |
abstract String | getBootloaderVersion () طريقة ملائمة للحصول على نسخة محمل الإقلاع من هذا الجهاز. |
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 AbstractConnection | getConnection () يعيد الاتصال المرتبط بالجهاز. |
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 () طريقة مساعدة لتحديد مقدار المساحة الخالية على وحدة التخزين الخارجية للجهاز. |
abstract String | getFastbootProductType () طريقة ملائمة للحصول على نوع المنتج الخاص بهذا الجهاز عندما يكون في وضع التشغيل السريع. |
abstract String | getFastbootProductVariant () طريقة ملائمة للحصول على نوع المنتج الخاص بهذا الجهاز عندما يكون في وضع التشغيل السريع. |
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 APIs عملية إعادة تشغيل بالمللي ثانية منذ EPOCH كما تم إرجاعها بواسطة |
abstract int | getLaunchApiLevel () احصل على مستوى واجهة برمجة التطبيقات الذي تم إطلاقه لأول مرة على الجهاز. |
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 على الجهاز |
abstract long | getPartitionFreeSpace (String partition) طريقة مساعدة لتحديد مقدار المساحة الخالية على قسم الجهاز. |
abstract ProcessInfo | getProcessByName (String processName) تقوم طريقة المساعد بتشغيل الأمر "pidof" و "stat" وإرجاع كائن |
abstract String | getProcessPid (String process) تُرجع pid للخدمة أو لاغية إذا حدث خطأ ما. |
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 | isBypassLowTargetSdkBlockSupported () تحقق مما إذا كان النظام الأساسي على الجهاز يدعم تجاوز كتلة sdk منخفضة الهدف عند تثبيت التطبيق |
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 void | logOnDevice (String tag, Log.LogLevel level, String format, Object... args) قم بتسجيل رسالة في سجل الجهاز. |
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 () يعيد تشغيل الجهاز في وضع أداة تحميل التشغيل. |
abstract void | rebootIntoFastbootd () يعيد تشغيل الجهاز في وضع fastbootd. |
abstract void | rebootIntoRecovery () يعيد تشغيل الجهاز في وضع استرداد adb. |
abstract void | rebootIntoSideload (boolean autoReboot) يعيد تشغيل الجهاز في وضع التحميل الجانبي adb (لاحظ أن هذا وضع خاص قيد الاسترداد) كتل حتى يدخل الجهاز في وضع التحميل الجانبي |
abstract void | rebootIntoSideload () يعيد تشغيل الجهاز في وضع التحميل الجانبي adb (لاحظ أن هذا وضع خاص قيد الاسترداد) كتل حتى يدخل الجهاز في وضع التحميل الجانبي |
abstract void | rebootUntilOnline () بديل لإعادة |
abstract void | rebootUntilOnline (String reason) بديل لإعادة |
abstract void | rebootUserspace () يعيد تشغيل جزء مساحة المستخدمين فقط من الجهاز. |
abstract void | rebootUserspaceUntilOnline () بديل لـ |
abstract void | remountSystemReadOnly () اجعل قسم النظام على الجهاز للقراءة فقط. |
abstract void | remountSystemWritable () اجعل قسم النظام على الجهاز قابلاً للكتابة. |
abstract void | remountVendorReadOnly () اجعل قسم البائع على الجهاز للقراءة فقط. |
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, listeners) runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, listeners) |
abstract boolean | runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, ITestLifeCycleReceiver... listeners) تمامًا مثل |
abstract void | setDate (Date date) يضبط التاريخ على الجهاز ملاحظة: يتطلب تحديد التاريخ على الجهاز الجذر |
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 boolean | unlockDevice () يفتح الجهاز إذا كان في حالة مشفرة. |
abstract boolean | waitForBootComplete (long timeOut) كتل حتى يتم تعيين علامة اكتمال تمهيد الجهاز. |
abstract boolean | waitForDeviceAvailable () ينتظر أن يكون الجهاز مستجيبًا ومتاحًا للاختبار. |
abstract boolean | waitForDeviceAvailable (long waitTime) ينتظر أن يكون الجهاز مستجيبًا ومتاحًا للاختبار. |
abstract boolean | waitForDeviceAvailableInRecoverPath (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 shell الأساسي. |
الثوابت
UNKNOWN_API_LEVEL
public static final int UNKNOWN_API_LEVEL
القيمة الافتراضية عندما لا يمكن الكشف عن مستوى API
قيمة ثابتة: -1 (0xffffffff)
الأساليب العامة
تحقق من مستوى ApiLevelAgainstNextRelease
public abstract boolean checkApiLevelAgainstNextRelease (int strictMinLevel)
تحقق مما إذا كانت الميزة مدعومة حاليًا أم لا نظرًا لمستوى الدعم الأدنى أم لا. تأخذ هذه الطريقة في الاعتبار الميزات التي لم يتم إصدارها حتى الآن ، قبل رفع مستوى واجهة برمجة التطبيقات.
حدود | |
---|---|
strictMinLevel | int : الحد الأدنى الصارم للمستوى الممكن الذي يدعم الميزة. |
عائدات | |
---|---|
boolean | صحيح إذا كان المستوى مدعومًا. خطأ خلاف ذلك. |
رميات | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
clearLogcat
public abstract void clearLogcat ()
يحذف أي بيانات logcat المتراكمة.
يعد هذا مفيدًا للحالات التي تريد فيها التأكد من ITestDevice#getLogcat()
يقوم فقط بإرجاع بيانات السجل التي تم إنتاجها بعد نقطة معينة (على سبيل المثال ، بعد وميض إصدار جهاز جديد ، وما إلى ذلك).
حذف ملف
public abstract void deleteFile (String deviceFilePath)
طريقة مساعدة لحذف ملف أو دليل على الجهاز.
حدود | |
---|---|
deviceFilePath | String : المسار المطلق للملف على الجهاز. |
رميات | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
الجهازSoftRestarted
public abstract boolean deviceSoftRestarted (ProcessInfo prevSystemServerProcess)
طريقة مساعدة للتحقق مما إذا كان الجهاز قد تمت إعادة تشغيله بشكل بسيط عن طريق مقارنة خادم النظام الحالي مع System_server السابق ProcessInfo
. استخدم getProcessByName(String)
للحصول على ProcessInfo
.
حدود | |
---|---|
prevSystemServerProcess | ProcessInfo : عملية خادم النظام السابقة ProcessInfo . |
عائدات | |
---|---|
boolean | true إذا تم إعادة تشغيل الجهاز |
رميات | |
---|---|
RuntimeException | إذا كان للجهاز سبب غير طبيعي للتمهيد |
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
الجهاز سوفت إعادة التشغيل منذ ذلك الحين
public abstract boolean deviceSoftRestartedSince (long utcEpochTime, TimeUnit timeUnit)
طريقة مساعدة للتحقق مما إذا كان الجهاز قد تمت إعادة تشغيله بشكل بسيط منذ وقت UTC منذ الحقبة من الجهاز ERROR(/TimeUnit)
. يشير Soft-Restart إلى إعادة تشغيل خادم النظام خارج إعادة تشغيل الجهاز (على سبيل المثال: طلب إعادة التشغيل). يمكن الحصول على الجهاز الحالي utcEpochTime بالمللي ثانية بواسطة الأسلوب getDeviceDate()
.
حدود | |
---|---|
utcEpochTime | long : وقت الجهاز في الثانية منذ العصر. |
timeUnit | TimeUnit : وحدة الوقت TimeUnit لـ utcEpochTime المحدد. |
عائدات | |
---|---|
boolean | true إذا تم إعادة تشغيل الجهاز |
رميات | |
---|---|
RuntimeException | إذا كان للجهاز سبب غير طبيعي للتمهيد |
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
تعطيلAdbRoot
public abstract boolean disableAdbRoot ()
يوقف adb root.
قد يؤدي تعطيل adb root إلى فصل الجهاز عن adb. سيتم حظر هذه الطريقة حتى يتوفر الجهاز.
عائدات | |
---|---|
boolean | true إذا نجح. |
رميات | |
---|---|
DeviceNotAvailableException | في حالة فقد الاتصال بالجهاز ولا يمكن استعادته. |
doesFileExist
public abstract boolean doesFileExist (String deviceFilePath)
طريقة مساعدة لتحديد ما إذا كان الملف على الجهاز موجودًا.
حدود | |
---|---|
deviceFilePath | String : المسار المطلق للملف المراد فحصه على الجهاز |
عائدات | |
---|---|
boolean | true إذا كان الملف موجودًا ، false بخلاف ذلك. |
رميات | |
---|---|
DeviceNotAvailableException | في حالة فقد الاتصال بالجهاز ولا يمكن استعادته. |
تمكينAdbRoot
public abstract boolean enableAdbRoot ()
يتحول على adb root. إذا كان إعداد "تمكين الجذر" هو "خطأ" ، فسيتم تسجيل الرسالة والعودة بدون تمكين الجذر.
قد يؤدي تمكين adb root إلى فصل الجهاز عن adb. سيتم حظر هذه الطريقة حتى يتوفر الجهاز.
عائدات | |
---|---|
boolean | true إذا نجح. |
رميات | |
---|---|
DeviceNotAvailableException | في حالة فقد الاتصال بالجهاز ولا يمكن استعادته. |
executeAdbCommand
public abstract String executeAdbCommand (long timeout, String... commandArgs)
طريقة المساعد التي تنفذ أمر adb كأمر نظام مع مهلة محددة.
يجب استخدام executeShellCommand(String)
بدلاً من ذلك حيثما كان ذلك ممكنًا ، لأن هذه الطريقة توفر أداءً واكتشافًا أفضل للفشل.
حدود | |
---|---|
timeout | long : الوقت بالمللي ثانية قبل اعتبار الجهاز غير مستجيب ، 0L لعدم وجود مهلة |
commandArgs | String : الأمر adb والوسيطات المراد تشغيلها |
عائدات | |
---|---|
String | stdout من القيادة. null إذا فشل الأمر في التنفيذ. |
رميات | |
---|---|
DeviceNotAvailableException | في حالة فقد الاتصال بالجهاز ولا يمكن استعادته. |
executeAdbCommand
public abstract String executeAdbCommand (String... commandArgs)
طريقة المساعد التي تنفذ أمر adb كأمر نظام.
يجب استخدام executeShellCommand(String)
بدلاً من ذلك حيثما كان ذلك ممكنًا ، لأن هذه الطريقة توفر أداءً واكتشافًا أفضل للفشل.
حدود | |
---|---|
commandArgs | String : الأمر adb والوسيطات المراد تشغيلها |
عائدات | |
---|---|
String | stdout من القيادة. null إذا فشل الأمر في التنفيذ. |
رميات | |
---|---|
DeviceNotAvailableException | في حالة فقد الاتصال بالجهاز ولا يمكن استعادته. |
executeAdbCommand
public abstract String executeAdbCommand (long timeout,envMap, String... commandArgs)
طريقة المساعد التي تنفذ أمر adb كأمر نظام مع مهلة محددة.
يجب استخدام executeShellCommand(String)
بدلاً من ذلك حيثما كان ذلك ممكنًا ، لأن هذه الطريقة توفر أداءً واكتشافًا أفضل للفشل.
حدود | |
---|---|
timeout | long : الوقت بالمللي ثانية قبل اعتبار الجهاز غير مستجيب ، 0L لعدم وجود مهلة |
envMap | |
commandArgs | String : الأمر adb والوسيطات المراد تشغيلها |
عائدات | |
---|---|
String | stdout من القيادة. null إذا فشل الأمر في التنفيذ. |
رميات | |
---|---|
DeviceNotAvailableException | في حالة فقد الاتصال بالجهاز ولا يمكن استعادته. |
executeFastbootCommand
public abstract CommandResult executeFastbootCommand (long timeout, String... commandArgs)
طريقة المساعد التي تنفذ أمر fastboot كأمر نظام.
من المتوقع استخدامه عندما يكون الجهاز في وضع Fastboot بالفعل.
حدود | |
---|---|
timeout | long : الوقت بالمللي ثانية قبل انتهاء صلاحية الأمر |
commandArgs | String : الأمر fastboot والوسيطات المراد تشغيلها |
عائدات | |
---|---|
CommandResult | تحتوي CommandResult على إخراج الأمر |
رميات | |
---|---|
DeviceNotAvailableException | في حالة فقد الاتصال بالجهاز ولا يمكن استعادته. |
executeFastbootCommand
public abstract CommandResult executeFastbootCommand (String... commandArgs)
طريقة المساعدة التي تنفذ أمر fastboot كأمر نظام مع مهلة افتراضية تبلغ دقيقتين.
من المتوقع استخدامه عندما يكون الجهاز في وضع Fastboot بالفعل.
حدود | |
---|---|
commandArgs | String : الأمر fastboot والوسيطات المراد تشغيلها |
عائدات | |
---|---|
CommandResult | تحتوي CommandResult على إخراج الأمر |
رميات | |
---|---|
DeviceNotAvailableException | في حالة فقد الاتصال بالجهاز ولا يمكن استعادته. |
executeLongFastbootCommand
public abstract CommandResult executeLongFastbootCommand (String... commandArgs)
طريقة المساعد التي تقوم بتنفيذ أمر fastboot الذي يعمل لفترة طويلة كأمر نظام.
مطابق لـ executeFastbootCommand(String)
باستثناء استخدام مهلة أطول.
حدود | |
---|---|
commandArgs | String : الأمر fastboot والوسيطات المراد تشغيلها |
عائدات | |
---|---|
CommandResult | تحتوي CommandResult على إخراج الأمر |
رميات | |
---|---|
DeviceNotAvailableException | في حالة فقد الاتصال بالجهاز ولا يمكن استعادته. |
executeLongFastbootCommand
public abstract CommandResult executeLongFastbootCommand (envVarMap, String... commandArgs)
طريقة المساعد التي تنفذ أمر fastboot الذي يعمل لفترة طويلة كأمر نظام مع متغيرات بيئة النظام.
مطابق لـ executeFastbootCommand(String)
باستثناء استخدام مهلة أطول.
حدود | |
---|---|
envVarMap | |
commandArgs | String : الأمر fastboot والوسيطات المراد تشغيلها |
عائدات | |
---|---|
CommandResult | تحتوي CommandResult على إخراج الأمر |
رميات | |
---|---|
DeviceNotAvailableException | في حالة فقد الاتصال بالجهاز ولا يمكن استعادته. |
executeShellCommand
public abstract String executeShellCommand (String command)
هو أسلوب المساعد الذي ينفذ أمر adb shell ويعيد الإخراج String
.
حدود | |
---|---|
command | String : أمر adb shell المراد تشغيله |
عائدات | |
---|---|
String | إخراج قذيفة |
رميات | |
---|---|
DeviceNotAvailableException | في حالة فقد الاتصال بالجهاز ولا يمكن استعادته. |
executeShellCommand
public abstract void executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts)
ينفذ أمر adb shell ، مع المزيد من المعلمات للتحكم في سلوك الأمر.
حدود | |
---|---|
command | String : أمر adb shell المراد تشغيله |
receiver | IShellOutputReceiver : IShellOutputReceiver لتوجيه إخراج قذيفة إلى. |
maxTimeToOutputShellResponse | long : أقصى مقدار من الوقت يُسمح خلاله للأمر بعدم إخراج أي استجابة ؛ الوحدة على النحو المحدد في timeUnit |
timeUnit | TimeUnit : وحدة maxTimeToOutputShellResponse |
retryAttempts | int : الحد الأقصى لعدد مرات إعادة محاولة الأمر إذا فشلت بسبب استثناء. سيتم طرح DeviceNotResponsiveException إذا تم تنفيذ retryAttempts دون نجاح. |
رميات | |
---|---|
DeviceNotAvailableException | في حالة فقد الاتصال بالجهاز ولا يمكن استعادته. |
executeShellCommand
public abstract void executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeoutForCommand, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts)
ينفذ أمر adb shell ، مع المزيد من المعلمات للتحكم في سلوك الأمر.
حدود | |
---|---|
command | String : أمر adb shell المراد تشغيله |
receiver | IShellOutputReceiver : IShellOutputReceiver لتوجيه إخراج قذيفة إلى. |
maxTimeoutForCommand | long : أقصى مهلة لإكمال الأمر ؛ الوحدة على النحو المحدد في timeUnit |
maxTimeToOutputShellResponse | long : أقصى مقدار من الوقت يُسمح خلاله للأمر بعدم إخراج أي استجابة ؛ الوحدة على النحو المحدد في timeUnit |
timeUnit | TimeUnit : وحدة maxTimeToOutputShellResponse |
retryAttempts | int : الحد الأقصى لعدد مرات إعادة محاولة الأمر إذا فشلت بسبب استثناء. سيتم طرح DeviceNotResponsiveException إذا تم تنفيذ retryAttempts دون نجاح. |
رميات | |
---|---|
DeviceNotAvailableException | في حالة فقد الاتصال بالجهاز ولا يمكن استعادته. |
executeShellCommand
public abstract void executeShellCommand (String command, IShellOutputReceiver receiver)
ينفذ الأمر adb shell المحدد ، ويعيد المحاولة عدة مرات إذا فشل الأمر.
شكل أبسط من executeShellCommand(String, com.android.ddmlib.IShellOutputReceiver, long, TimeUnit, int)
مع القيم الافتراضية.
حدود | |
---|---|
command | String : أمر adb shell المراد تشغيله |
receiver | IShellOutputReceiver : IShellOutputReceiver لتوجيه إخراج قذيفة إلى. |
رميات | |
---|---|
DeviceNotAvailableException | في حالة فقد الاتصال بالجهاز ولا يمكن استعادته. |
executeShellV2Command
public abstract CommandResult executeShellV2Command (String command)
طريقة المساعد التي تنفذ أمر شل adb وتعيد النتائج كإنتاج CommandResult
بشكل صحيح مع إخراج حالة الأمر ، stdout و stderr.
حدود | |
---|---|
command | String : الأمر الذي يجب تشغيله. |
عائدات | |
---|---|
CommandResult | النتيجة في CommandResult . |
رميات | |
---|---|
DeviceNotAvailableException | في حالة فقد الاتصال بالجهاز ولا يمكن استعادته. |
executeShellV2Command
public abstract CommandResult executeShellV2Command (String command, OutputStream pipeToOutput)
أسلوب المساعد الذي ينفذ أمر شل adb ويعيد النتائج كإنتاج CommandResult
بشكل صحيح مع إخراج حالة الأمر و stderr. يتم توجيه stdout إلى الدفق المحدد.
حدود | |
---|---|
command | String : الأمر الذي يجب تشغيله. |
pipeToOutput | OutputStream : ERROR(/OutputStream) حيث سيتم إعادة توجيه الإخراج القياسي ، أو فارغًا. |
عائدات | |
---|---|
CommandResult | النتيجة في CommandResult . |
رميات | |
---|---|
DeviceNotAvailableException | في حالة فقد الاتصال بالجهاز ولا يمكن استعادته. |
executeShellV2Command
public abstract CommandResult executeShellV2Command (String command, File pipeAsInput)
أسلوب المساعد الذي ينفذ أمر adb shell ويعيد النتائج كإنتاج CommandResult
بشكل صحيح مع إخراج حالة الأمر ، stdout و stderr.
حدود | |
---|---|
command | String : الأمر الذي يجب تشغيله. |
pipeAsInput | File : ERROR(/File) سيتم توجيهه كمدخل إلى الأمر ، أو فارغ. |
عائدات | |
---|---|
CommandResult | النتيجة في CommandResult . |
رميات | |
---|---|
DeviceNotAvailableException | في حالة فقد الاتصال بالجهاز ولا يمكن استعادته. |
executeShellV2Command
public abstract CommandResult executeShellV2Command (String command, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
ينفذ أمر adb shell ، مع المزيد من المعلمات للتحكم في سلوك الأمر.
حدود | |
---|---|
command | String : أمر adb shell المراد تشغيله |
maxTimeoutForCommand | long : أقصى مهلة لإكمال الأمر ؛ الوحدة على النحو المحدد في timeUnit |
timeUnit | TimeUnit : وحدة maxTimeToOutputShellResponse |
retryAttempts | int : الحد الأقصى لعدد مرات إعادة محاولة الأمر إذا فشلت بسبب استثناء. سيتم طرح DeviceNotResponsiveException إذا تم تنفيذ retryAttempts دون نجاح. |
عائدات | |
---|---|
CommandResult |
رميات | |
---|---|
DeviceNotAvailableException | في حالة فقد الاتصال بالجهاز ولا يمكن استعادته. |
أنظر أيضا:
executeShellV2Command
public abstract CommandResult executeShellV2Command (String command, long maxTimeoutForCommand, TimeUnit timeUnit)
ينفذ أمر adb shell ، مع المزيد من المعلمات للتحكم في سلوك الأمر.
حدود | |
---|---|
command | String : أمر adb shell المراد تشغيله |
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 shell ، مع المزيد من المعلمات للتحكم في سلوك الأمر.
حدود | |
---|---|
command | String : أمر adb shell المراد تشغيله |
pipeAsInput | File : ERROR(/File) سيتم توجيهه كمدخل إلى الأمر ، أو فارغ. |
pipeToOutput | OutputStream : ERROR(/OutputStream) حيث سيتم إعادة توجيه الإخراج القياسي ، أو فارغًا. |
maxTimeoutForCommand | long : أقصى مهلة لإكمال الأمر ؛ الوحدة على النحو المحدد في timeUnit |
timeUnit | TimeUnit : وحدة maxTimeToOutputShellResponse |
retryAttempts | int : الحد الأقصى لعدد مرات إعادة محاولة الأمر إذا فشلت بسبب استثناء. سيتم طرح DeviceNotResponsiveException إذا تم تنفيذ retryAttempts دون نجاح. |
عائدات | |
---|---|
CommandResult |
رميات | |
---|---|
DeviceNotAvailableException | في حالة فقد الاتصال بالجهاز ولا يمكن استعادته. |
أنظر أيضا:
executeShellV2Command
public abstract CommandResult executeShellV2Command (String command, File pipeAsInput, OutputStream pipeToOutput, OutputStream pipeToError, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
ينفذ أمر adb shell ، مع المزيد من المعلمات للتحكم في سلوك الأمر.
حدود | |
---|---|
command | String : أمر adb shell المراد تشغيله |
pipeAsInput | File : ERROR(/File) سيتم توجيهه كمدخل إلى الأمر ، أو فارغ. |
pipeToOutput | OutputStream : ERROR(/OutputStream) حيث سيتم إعادة توجيه الإخراج القياسي ، أو فارغًا. |
pipeToError | OutputStream : ERROR(/OutputStream) حيث يتم إعادة توجيه الخطأ القياسي ، أو يصبح فارغًا. |
maxTimeoutForCommand | long : أقصى مهلة لإكمال الأمر ؛ الوحدة على النحو المحدد في timeUnit |
timeUnit | TimeUnit : وحدة maxTimeToOutputShellResponse |
retryAttempts | int : الحد الأقصى لعدد مرات إعادة محاولة الأمر إذا فشلت بسبب استثناء. سيتم طرح DeviceNotResponsiveException إذا تم تنفيذ retryAttempts دون نجاح. |
عائدات | |
---|---|
CommandResult |
رميات | |
---|---|
DeviceNotAvailableException | في حالة فقد الاتصال بالجهاز ولا يمكن استعادته. |
أنظر أيضا:
fastbootWipePartition
public abstract CommandResult fastbootWipePartition (String partition)
الطريقة المساعدة التي تمسح قسمًا للجهاز.
إذا كانت getUseFastbootErase()
true
، فسيتم استخدام fastboot erase لمسح القسم. يجب على الجهاز بعد ذلك إنشاء نظام ملفات في المرة التالية التي يقوم فيها الجهاز بالتمهيد. خلاف ذلك ، يتم استخدام تنسيق fastboot الذي سينشئ نظام ملفات جديدًا على الجهاز.
من المتوقع استخدامه عندما يكون الجهاز في وضع Fastboot بالفعل.
حدود | |
---|---|
partition | String : القسم المطلوب مسحه |
عائدات | |
---|---|
CommandResult | تحتوي CommandResult على إخراج الأمر |
رميات | |
---|---|
DeviceNotAvailableException | في حالة فقد الاتصال بالجهاز ولا يمكن استعادته. |
getApiLevel
public abstract int getApiLevel ()
احصل على مستوى API الخاص بالجهاز. افتراضات على UNKNOWN_API_LEVEL
.
عائدات | |
---|---|
int | عدد صحيح يشير إلى مستوى API للجهاز |
رميات | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
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 | في حالة فقد الاتصال بالجهاز ولا يمكن استعادته. |
getBattery
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 ()
تجمع طريقة المساعد خريطة محفوظات التمهيد مع وقت التمهيد وسبب التمهيد.
عائدات | |
---|---|
خريطة وقت التمهيد (التوقيت العالمي المنسق بالثانية منذ العصر) وسبب التمهيد |
رميات | |
---|---|
DeviceNotAvailableException |
getBootHistorySince
public abstractgetBootHistorySince (long utcEpochTime, TimeUnit timeUnit)
يجمع أسلوب المساعد خريطة محفوظات التمهيد مع وقت التمهيد وسبب التمهيد منذ الوقت المحدد منذ الحقبة من الجهاز والوحدة الزمنية المحددة. يمكن الحصول على الجهاز الحالي utcEpochTime بالمللي ثانية بواسطة الأسلوب getDeviceDate()
.
حدود | |
---|---|
utcEpochTime | long : وقت الجهاز منذ البداية. |
timeUnit | TimeUnit : وحدة الوقت TimeUnit . |
عائدات | |
---|---|
خريطة وقت التمهيد (التوقيت العالمي المنسق بالثانية منذ العصر) وسبب التمهيد |
رميات | |
---|---|
DeviceNotAvailableException |
الإصدار
public abstract String getBootloaderVersion ()
طريقة ملائمة للحصول على نسخة محمل الإقلاع من هذا الجهاز.
سيحاول استرداد إصدار محمل الإقلاع من حالة الجهاز الحالية. (على سبيل المثال ، إذا كان الجهاز في وضع Fastboot ، فسيحاول استرداد الإصدار من fastboot)
عائدات | |
---|---|
String | إصدار String bootloader أو null إذا تعذر العثور عليه |
رميات | |
---|---|
DeviceNotAvailableException | في حالة فقد الاتصال بالجهاز ولا يمكن استعادته. |
getBuildAlias
public abstract String getBuildAlias ()
استرجع الاسم المستعار للبنية التي يشغلها الجهاز حاليًا.
عادةً ما يكون الاسم المستعار للبناء سلسلة أكثر قابلية للقراءة من معرّف البناء (عادةً ما يكون رقمًا لإصدارات Nexus). على سبيل المثال ، يحتوي الإصدار الأخير من Android 4.2 على اسم مستعار JDQ39 وبناء معرف 573038
عائدات | |
---|---|
String | الاسم المستعار للبناء أو الرجوع إلى معرف البناء إذا تعذر استرداده |
رميات | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
getBuildFlavor
public abstract String getBuildFlavor ()
استرجع نكهة البناء للجهاز.
عائدات | |
---|---|
String | نكهة البناء أو null إذا تعذر استرجاعها |
رميات | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
getBuildId
public abstract String getBuildId ()
استرجع البنية التي يشغلها الجهاز حاليًا.
عائدات | |
---|---|
String | معرف البناء أو IBuildInfo#UNKNOWN_BUILD_ID إذا تعذر استرجاعه |
رميات | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
getBuildSigningKeys
public abstract String getBuildSigningKeys ()
إرجاع نوع المفتاح المستخدم لتوقيع صورة الجهاز
عادةً ما يتم توقيع أجهزة Android باستخدام مفاتيح الاختبار (مثل AOSP) أو مفاتيح التحرير (التي يتحكم فيها مصنعو الأجهزة الفردية)
عائدات | |
---|---|
String | إذا تم العثور على مفتاح التوقيع ، خالي بخلاف ذلك. |
رميات | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
getCachedDeviceDescriptor
public abstract DeviceDescriptor getCachedDeviceDescriptor ()
تُرجع DeviceDescriptor
المخزنة مؤقتًا إذا تم تخصيص الجهاز ، وإلا فإنها تُرجع DeviceDescriptor
الحالي.
عائدات | |
---|---|
DeviceDescriptor |
getCachedDeviceDescriptor
public abstract DeviceDescriptor getCachedDeviceDescriptor (boolean shortDescriptor)
تُرجع DeviceDescriptor
المخزنة مؤقتًا إذا تم تخصيص الجهاز ، وإلا فإنها تُرجع DeviceDescriptor
الحالي.
حدود | |
---|---|
shortDescriptor | boolean : ما إذا كان سيتم قصر الواصف على الحد الأدنى من المعلومات أم لا |
عائدات | |
---|---|
DeviceDescriptor |
getChildren
public abstract String[] getChildren (String deviceFilePath)
بديل لاستخدام IFileEntry
الذي لن يعمل في بعض الأحيان بسبب الأذونات.
حدود | |
---|---|
deviceFilePath | String : هو المسار الموجود على الجهاز لإجراء البحث |
عائدات | |
---|---|
String[] | مصفوفة من السلسلة تحتوي على كل الملفات الموجودة في مسار على الجهاز. |
رميات | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
getConnection
public abstract AbstractConnection getConnection ()
يعيد الاتصال المرتبط بالجهاز.
عائدات | |
---|---|
AbstractConnection |
getDeviceClass
public abstract String getDeviceClass ()
احصل على فئة الجهاز.
عائدات | |
---|---|
String | فئة جهاز String . |
getDeviceDate
public abstract long getDeviceDate ()
قم بإرجاع تاريخ الجهاز بالمللي ثانية منذ البداية.
عائدات | |
---|---|
long | تاريخ الجهاز بتنسيق العصر. |
رميات | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
getDeviceDescriptor
public abstract DeviceDescriptor getDeviceDescriptor ()
قم بإرجاع DeviceDescriptor
من معلومات الجهاز للحصول على معلومات عنه دون تمرير كائن الجهاز الفعلي.
عائدات | |
---|---|
DeviceDescriptor |
getDeviceDescriptor
public abstract DeviceDescriptor getDeviceDescriptor (boolean shortDescriptor)
قم بإرجاع DeviceDescriptor
من معلومات الجهاز للحصول على معلومات عنه دون تمرير كائن الجهاز الفعلي.
حدود | |
---|---|
shortDescriptor | boolean : ما إذا كان سيتم قصر الواصف على الحد الأدنى من المعلومات أم لا |
عائدات | |
---|---|
DeviceDescriptor |
getDeviceState
public abstract TestDeviceState getDeviceState ()
احصل على حالة الجهاز.
عائدات | |
---|---|
TestDeviceState |
getDeviceTimeOffset
public abstract long getDeviceTimeOffset (Date date)
مساعد للحصول على فارق التوقيت بين الجهاز ERROR(/Date)
. استخدم وقت العصر داخليًا.
حدود | |
---|---|
date | Date |
عائدات | |
---|---|
long | الفرق بالمللي ثانية |
رميات | |
---|---|
DeviceNotAvailableException |
getEmulatorOutput
public abstract InputStreamSource getEmulatorOutput ()
احصل على دفق المحاكي stdout و stderr
عائدات | |
---|---|
InputStreamSource | إخراج المحاكي |
getExternalStoreFreeSpace
public abstract long getExternalStoreFreeSpace ()
طريقة مساعدة لتحديد مقدار المساحة الخالية على وحدة التخزين الخارجية للجهاز.
عائدات | |
---|---|
long | مقدار المساحة الخالية بالكيلو بايت |
رميات | |
---|---|
DeviceNotAvailableException | في حالة فقد الاتصال بالجهاز ولا يمكن استعادته. |
getFastbootProductType
public abstract String getFastbootProductType ()
طريقة ملائمة للحصول على نوع المنتج الخاص بهذا الجهاز عندما يكون في وضع التشغيل السريع.
يجب استخدام هذه الطريقة فقط إذا كان يجب أن يكون الجهاز في fastboot. إنه متغير أكثر أمانًا قليلاً من طريقة getProductType()
العامة في هذه الحالة ، لأن ITestDevice سيعرف استرداد الجهاز إلى fastboot إذا كان الجهاز في حالة غير صحيحة أو لا يستجيب.
عائدات | |
---|---|
String | اسم نوع منتج String أو null إذا تعذر تحديده |
رميات | |
---|---|
DeviceNotAvailableException | في حالة فقد الاتصال بالجهاز ولا يمكن استعادته. |
getFastbootProductVariant
public abstract String getFastbootProductVariant ()
طريقة ملائمة للحصول على نوع المنتج الخاص بهذا الجهاز عندما يكون في وضع التشغيل السريع.
يجب استخدام هذه الطريقة فقط إذا كان يجب أن يكون الجهاز في 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 : مسار الملف المطلوب استرداده. يمكن أن يكون مسارًا مطلقًا أو مسارًا متعلقًا بـ "/". (على سبيل المثال ، يتم دعم بناء الجملة "/ النظام" و "النظام") |
عائدات | |
---|---|
IFileEntry | IFileEntry أو null إذا تعذر العثور على الملف في path المحدد |
رميات | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
getIDevice
public abstract IDevice getIDevice ()
إرجاع مرجع إلى جهاز ddmlib IDevice
المرتبط.
قد يتم تخصيص IDevice
جديد بواسطة DDMS في كل مرة يقوم فيها الجهاز بفصل وإعادة الاتصال من 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 APIs عملية إعادة تشغيل بالمللي ثانية منذ EPOCH كما تم إرجاعها بواسطة System.currentTimeMillis()
.
عائدات | |
---|---|
long |
getLaunchApiLevel
public abstract int getLaunchApiLevel ()
Get the device's first launched API Level. Defaults to UNKNOWN_API_LEVEL
.
عائدات | |
---|---|
int | an integer indicating the first launched API Level of device |
رميات | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
getLogcat
public abstract InputStreamSource getLogcat ()
Grabs a snapshot stream of the logcat data.
Works in two modes:
TestDeviceOptions.getMaxLogcatDataSize()
bytes of the current contents of the background logcat captureعائدات | |
---|---|
InputStreamSource |
getLogcat
public abstract InputStreamSource getLogcat (int maxBytes)
Grabs a snapshot stream of the last maxBytes
of captured logcat data.
Useful for cases when you want to capture frequent snapshots of the captured logcat data without incurring the potentially big disk space penalty of getting the entire getLogcat()
snapshot.
حدود | |
---|---|
maxBytes | int : the maximum amount of data to return. 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 in IDevice
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 |
أنظر أيضا:
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 |
أنظر أيضا:
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 |
رميات | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
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 |
أنظر أيضا:
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. |
أنظر أيضا:
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 |
رميات | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
isBypassLowTargetSdkBlockSupported
public abstract boolean isBypassLowTargetSdkBlockSupported ()
Check whether platform on device supports bypassing low target sdk block on app installs
عائدات | |
---|---|
boolean | True if bypass low target sdk block is supported, false otherwise |
رميات | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
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 |
رميات | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
isEncryptionSupported
public abstract boolean isEncryptionSupported ()
Returns if encryption is supported on the device.
عائدات | |
---|---|
boolean | true if the device supports encryption. |
رميات | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
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 |
رميات | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
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. |
رميات | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
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 |
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.
رميات | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
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 ()
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.
حدود | |
---|---|
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 |
| com.android.tradefed.device.DeviceNotAvailableException |
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 |
أنظر أيضا:
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 |
remountSystemReadOnly
public abstract void remountSystemReadOnly ()
Make the system partition on the device read-only. May reboot the device.
رميات | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
remountSystemWritable
public abstract void remountSystemWritable ()
Make the system partition on the device writable. May reboot the device.
رميات | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
remountVendorReadOnly
public abstract void remountVendorReadOnly ()
Make the vendor partition on the device read-only. May reboot the device.
رميات | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
remountVendorWritable
public abstract void remountVendorWritable ()
Make the vendor partition on the device writable. May reboot the device.
رميات | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
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,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 |
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 |
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 |
رميات | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
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. |
رميات | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
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. |
أنظر أيضا:
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 |
رميات | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
switchToAdbUsb
public abstract boolean switchToAdbUsb ()
Switch device to adb over usb mode.
عائدات | |
---|---|
boolean | true if switch was successful, false otherwise. |
رميات | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
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. |
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 |
رميات | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
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. |
waitForDeviceAvailableInRecoverPath
public abstract boolean waitForDeviceAvailableInRecoverPath (long waitTime)
Waits for the device to be responsive and available without considering recovery path.
حدود | |
---|---|
waitTime | long |
عائدات | |
---|---|
boolean | True if device is available, False if unavailable. |
رميات | |
---|---|
DeviceNotAvailableException | if connection with device is lost and cannot be recovered. |
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. Use waitForDeviceAvailable()
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. Use waitForDeviceAvailable()
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. |