INativeDevice

public interface INativeDevice

com.android.tradefed.device.INativeDevice


یک API سطح بالا و قابل اعتماد برای IDevice مربوط به ddmlib ارائه می‌دهد.

دستورات دستگاه را برای مقدار قابل تنظیمی دوباره اجرا می‌کند و یک رابط بازیابی دستگاه برای دستگاه‌هایی که پاسخگو نیستند فراهم می‌کند.

خلاصه

ثابت‌ها

int UNKNOWN_API_LEVEL

مقدار پیش‌فرض زمانی که سطح API قابل شناسایی نباشد

روش‌های عمومی

abstract boolean checkApiLevelAgainstNextRelease (int strictMinLevel)

بررسی کنید که آیا یک ویژگی با توجه به حداقل سطح پشتیبانی، در حال حاضر پشتیبانی می‌شود یا خیر.

abstract void clearLogcat ()

هرگونه داده logcat انباشته شده را حذف می‌کند.

abstract void deleteFile (String deviceFilePath)

روش کمکی برای حذف یک فایل یا دایرکتوری روی دستگاه.

abstract void deleteFile (String deviceFilePath, int userId)

روش کمکی برای حذف یک فایل یا دایرکتوری روی دستگاه.

abstract boolean deviceSoftRestarted ( ProcessInfo prevSystemServerProcess)

متد کمکی برای بررسی اینکه آیا دستگاه با مقایسه system_server فعلی با system_server قبلی ProcessInfo ، به صورت نرم‌افزاری راه‌اندازی مجدد شده است یا خیر.

abstract boolean deviceSoftRestartedSince (long utcEpochTime, TimeUnit timeUnit)

متد کمکی برای بررسی اینکه آیا دستگاه از زمان UTC از زمان شروع به کار مجدد نرم افزاری شده است یا خیر، از زمان شروع دستگاه و ERROR(/TimeUnit) آن.

abstract boolean disableAdbRoot ()

ریشه adb را خاموش می‌کند.

abstract boolean doesFileExist (String deviceFilePath)

متد کمکی برای تشخیص وجود فایل روی دستگاه.

abstract boolean enableAdbRoot ()

ریشه adb را فعال می‌کند.

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

متد کمکی که یک دستور adb را به عنوان یک دستور سیستمی با یک زمان انقضای مشخص اجرا می‌کند.

abstract String executeAdbCommand (String... commandArgs)

متد کمکی که یک دستور adb را به عنوان یک دستور سیستمی اجرا می‌کند.

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

متد کمکی که یک دستور adb را به عنوان یک دستور سیستمی با یک زمان انقضای مشخص اجرا می‌کند.

abstract CommandResult executeAdbV2Command (long timeout, envMap, String... commandArgs)

متد کمکی که یک دستور adb را به عنوان یک دستور سیستمی با یک زمان انقضای مشخص اجرا می‌کند.

abstract CommandResult executeAdbV2Command (String... commandArgs)

متد کمکی که یک دستور adb را به عنوان یک دستور سیستمی اجرا می‌کند.

abstract CommandResult executeAdbV2Command (long timeout, 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)

متد کمکی که یک دستور fastboot طولانی مدت را به عنوان یک دستور سیستمی با متغیرهای محیطی سیستم اجرا می‌کند.

abstract String executeShellCommand (String command)

متد کمکی که یک دستور shell در adb را اجرا می‌کند و خروجی را به صورت String برمی‌گرداند.

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 را اجرا می‌کند و نتایج را به صورت یک CommandResult که به درستی با خروجی وضعیت دستور، stdout و stderr پر شده است، برمی‌گرداند.

abstract CommandResult executeShellV2Command (String command, OutputStream pipeToOutput)

متد کمکی که یک دستور adb shell را اجرا می‌کند و نتایج را به صورت یک CommandResult که به درستی با خروجی وضعیت دستور و stderr پر شده است، برمی‌گرداند.

abstract CommandResult executeShellV2Command (String command, File pipeAsInput)

متد کمکی که یک دستور پوسته adb را اجرا می‌کند و نتایج را به عنوان یک CommandResult که به درستی با خروجی وضعیت دستور، stdout و stderr پر شده است، برمی‌گرداند.

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

نوع کلید مورد استفاده برای امضای تصویر دستگاه را برمی‌گرداند.

معمولاً دستگاه‌های اندروید ممکن است با کلیدهای تست (مانند AOSP) یا کلیدهای انتشار (که توسط تولیدکنندگان دستگاه کنترل می‌شوند) امضا شوند.

abstract DeviceDescriptor getCachedDeviceDescriptor ()

اگر دستگاه تخصیص داده شده باشد، یک DeviceDescriptor ذخیره شده را برمی‌گرداند، در غیر این صورت DeviceDescriptor فعلی را برمی‌گرداند.

abstract DeviceDescriptor getCachedDeviceDescriptor (boolean shortDescriptor)

اگر دستگاه تخصیص داده شده باشد، یک DeviceDescriptor ذخیره شده را برمی‌گرداند، در غیر این صورت DeviceDescriptor فعلی را برمی‌گرداند.

abstract String[] getChildren (String deviceFilePath)

جایگزینی برای استفاده از IFileEntry که گاهی اوقات به دلیل مجوزها کار نمی‌کند.

abstract AbstractConnection getConnection ()

اتصال مرتبط با دستگاه را برمی‌گرداند.

abstract String getDeviceClass ()

کلاس دستگاه را دریافت کنید.

abstract long getDeviceDate ()

تاریخ دستگاه را از زمان شروع (epoch) بر حسب میلی ثانیه برمی‌گرداند.

abstract DeviceDescriptor getDeviceDescriptor ()

یک DeviceDescriptor از اطلاعات دستگاه برمی‌گرداند تا بدون ارسال شیء دستگاه واقعی، اطلاعات مربوط به آن را دریافت کند.

abstract DeviceDescriptor getDeviceDescriptor (boolean shortDescriptor)

یک DeviceDescriptor از اطلاعات دستگاه برمی‌گرداند تا بدون ارسال شیء دستگاه واقعی، اطلاعات مربوط به آن را دریافت کند.

abstract TestDeviceState getDeviceState ()

وضعیت دستگاه را دریافت کنید.

abstract long getDeviceTimeOffset (Date date)

تابع کمکی برای دریافت اختلاف زمانی بین دستگاه و یک ERROR(/Date) داده شده.

abstract InputStreamSource getEmulatorOutput ()

دریافت جریان خروجی استاندارد و خروجی استاندارد شبیه‌ساز

abstract long getExternalStoreFreeSpace ()

روش کمکی برای تعیین میزان فضای خالی روی حافظه خارجی دستگاه.

abstract String getFastbootProductType ()

روشی آسان برای دریافت نوع محصول این دستگاه در حالت فست‌بوت.

abstract String getFastbootProductVariant ()

روشی آسان برای دریافت نوع محصول این دستگاه در حالت فست‌بوت.

abstract String getFastbootSerialNumber ()

شماره سریال حالت فست‌بوت را برمی‌گرداند.

abstract String getFastbootVariable (String variableName)

مقدار متغیر fastboot داده شده را از دستگاه بازیابی کنید.

abstract IFileEntry getFileEntry (String path)

بازیابی ارجاع به یک فایل از راه دور روی دستگاه.

abstract IDevice getIDevice ()

یک ارجاع به ddmlib IDevice مرتبط را برمی‌گرداند.

abstract long getIntProperty (String name, long defaultValue)

مقدار صحیح ویژگی داده شده را از دستگاه برمی‌گرداند.

abstract long getLastExpectedRebootTimeMillis ()

آخرین باری که APIهای Tradefed از زمان EPOCH باعث راه‌اندازی مجدد سیستم شده‌اند را بر حسب میلی‌ثانیه، همانطور که توسط System.currentTimeMillis() برگردانده می‌شود، برمی‌گرداند.

abstract int getLaunchApiLevel ()

اولین سطح API راه‌اندازی شده دستگاه را دریافت کنید.

abstract InputStreamSource getLogcat ()

یک جریان snapshot از داده‌های logcat می‌گیرد.

abstract InputStreamSource getLogcat (int maxBytes)

یک جریان snapshot از آخرین maxBytes داده‌های logcat ضبط شده را می‌گیرد.

abstract InputStreamSource getLogcatDump ()

یک نسخه از لاگ‌کت فعلی دستگاه را دریافت کنید.

abstract InputStreamSource getLogcatSince (long date)

یک جریان اسنپ‌شات از داده‌های لاگ‌کت ثبت‌شده را با شروع تاریخ ارائه‌شده، دریافت می‌کند.

abstract String getMountPoint (String mountName)

یک نقطه اتصال (mount point) را برمی‌گرداند.

abstract ITestDevice.MountPointInfo getMountPointInfo (String mountpoint)

یک MountPointInfo مربوط به مسیر mountpoint مشخص شده را برمی‌گرداند، یا اگر آن مسیر چیزی mount نکرده باشد یا در فایل /proc/mounts به عنوان یک mountpoint ظاهر نشود null برمی‌گرداند.

abstract getMountPointInfo ()

یک نسخه تجزیه‌شده از اطلاعات موجود در /proc/mounts روی دستگاه را برمی‌گرداند.

abstract long getPartitionFreeSpace (String partition)

روش کمکی برای تعیین مقدار فضای خالی روی پارتیشن دستگاه.

abstract ProcessInfo getProcessByName (String processName)

متد کمکی، دستورات "pidof" و "stat" را اجرا می‌کند و شیء ProcessInfo را به همراه PID و زمان شروع فرآیند داده شده برمی‌گرداند.

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 را برمی‌گرداند.

default String getTrackingSerial ()

برای مدیریت دستگاه، سریال مورد استفاده برای ردیابی دستگاه را دریافت کنید.

abstract boolean getUseFastbootErase ()

مشخص کنید که برای پاک کردن یک پارتیشن روی دستگاه، از پاک کردن سریع بوت یا فرمت سریع بوت استفاده کنید.

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

بررسی کنید که آیا پلتفرم روی دستگاه از شمارش برنامه پشتیبانی می‌کند یا خیر

abstract boolean isBypassLowTargetSdkBlockSupported ()

بررسی کنید که آیا پلتفرم روی دستگاه از دور زدن بلوک sdk با هدف پایین در نصب برنامه‌ها پشتیبانی می‌کند یا خیر

abstract boolean isDebugfsMounted ()

بررسی کنید که آیا debugfs نصب شده است یا خیر.

abstract boolean isDeviceEncrypted ()

اگر دستگاه رمزگذاری شده باشد، برمی‌گرداند.

abstract boolean isDirectory (String deviceFilePath)

اگر مسیر روی دستگاه یک دایرکتوری باشد، مقدار True و در غیر این صورت مقدار False را برمی‌گرداند.

abstract boolean isEncryptionSupported ()

اگر رمزگذاری روی دستگاه پشتیبانی شود، برمی‌گرداند.

abstract boolean isExecutable (String fullPath)

اگر مسیر فایل روی دستگاه یک فایل اجرایی باشد، مقدار True و در غیر این صورت مقدار False را برمی‌گرداند.

abstract boolean isHeadless ()

اگر دستگاه بدون صفحه نمایش (headless) باشد، مقدار true و در غیر این صورت مقدار false را برمی‌گرداند.

abstract boolean isRuntimePermissionSupported ()

بررسی کنید که آیا پلتفرم روی دستگاه از اعطای مجوز زمان اجرا پشتیبانی می‌کند یا خیر

abstract boolean isStateBootloaderOrFastbootd ()

اگر دستگاه در TestDeviceState.FASTBOOT یا TestDeviceState.FASTBOOTD باشد، مقدار true را برمی‌گرداند.

abstract boolean logAnrs ( ITestLogger logger)

ANR ها را از دستگاه جمع آوری و ثبت می کند.

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

یک پیام را در logcat دستگاه ثبت کنید.

abstract void mountDebugfs ()

نصب debugfs.

abstract void nonBlockingReboot ()

دستوری برای راه‌اندازی مجدد دستگاه صادر می‌کند و در صورت تکمیل دستور و عدم نمایش دستگاه برای adb، آن را برمی‌گرداند.

abstract void postBootSetup ()

دستورالعمل‌های مربوط به پیکربندی دستگاه برای آزمایش آن پس از هر بار بوت را اجرا کنید.

default void postInvocationTearDown ()

این روش منسوخ شده است. به جای آن postInvocationTearDown(Throwable) استفاده کنید.

abstract void postInvocationTearDown (Throwable invocationException)

مراحل اضافی برای پاکسازی خاص دستگاه مورد نیاز است که پس از انجام فراخوانی اجرا خواهد شد.

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

مراحل اضافی برای تنظیمات مورد نیاز خاص دستگاه که قبل از جریان فراخوانی روی دستگاه اجرا خواهند شد.

abstract boolean pullDir (String deviceFilePath, File localDir)

به صورت بازگشتی محتویات دایرکتوری را از دستگاه دریافت می‌کند.

abstract boolean pullDir (String deviceFilePath, File localDir, int userId)

به صورت بازگشتی محتویات دایرکتوری را از دستگاه دریافت می‌کند.

abstract File pullFile (String remoteFilePath, int userId)

یک فایل را از دستگاه بازیابی می‌کند، آن را در یک ERROR(/File) موقت محلی ذخیره می‌کند و آن File برمی‌گرداند.

abstract File pullFile (String remoteFilePath)

یک فایل را از دستگاه بازیابی می‌کند، آن را در یک ERROR(/File) موقت محلی ذخیره می‌کند و آن File برمی‌گرداند.

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)

یک روش راحت برای بازیابی یک فایل از حافظه خارجی دستگاه، ذخیره آن در یک ERROR(/File) موقت محلی و بازگرداندن ارجاعی به آن File .

abstract boolean pushDir (File localDir, String deviceFilePath, int userId)

به صورت بازگشتی محتویات دایرکتوری را به دستگاه ارسال می‌کند.

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

به صورت بازگشتی محتویات دایرکتوری را به دستگاه ارسال می‌کند، در حالی که برخی از دایرکتوری‌های فیلتر شده را حذف می‌کند.

abstract boolean pushDir (File localDir, String deviceFilePath)

به صورت بازگشتی محتویات دایرکتوری را به دستگاه ارسال می‌کند.

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

نوعی از pushFile(File, String) که می‌تواند به صورت اختیاری ارزیابی نیاز به ارائه‌دهنده محتوا را در نظر بگیرد.

abstract boolean pushFile (File localFile, String deviceFilePath)

ارسال یک فایل به دستگاه

abstract boolean pushFile (File localFile, String deviceFilePath, int userId)

ارسال یک فایل به دستگاه

abstract boolean pushString (String contents, String deviceFilePath)

فایل ایجاد شده از یک رشته را به دستگاه ارسال کنید

abstract void reboot ()

دستگاه را در حالت adb ریبوت می‌کند.

abstract void reboot (String reason)

دستگاه را به حالت adb ریبوت می‌کند و reason داده شده برای ادامه‌ی این حالت در طول ریبوت را ارائه می‌دهد.

abstract void rebootIntoBootloader ()

دستگاه را در حالت بوت لودر ریبوت می‌کند.

abstract void rebootIntoFastbootd ()

دستگاه را در حالت fastbootd ریبوت می‌کند.

abstract void rebootIntoRecovery ()

دستگاه را در حالت بازیابی adb ریبوت می‌کند.

abstract void rebootIntoSideload (boolean autoReboot)

دستگاه را در حالت adb sideload ریبوت می‌کند (توجه داشته باشید که این یک حالت ویژه در حالت ریکاوری است)

تا زمانی که دستگاه وارد حالت سایدلود شود، مسدود می‌شود

abstract void rebootIntoSideload ()

دستگاه را در حالت adb sideload ریبوت می‌کند (توجه داشته باشید که این یک حالت ویژه در حالت ریکاوری است)

تا زمانی که دستگاه وارد حالت سایدلود شود، مسدود می‌شود

abstract void rebootUntilOnline ()

جایگزینی برای reboot() که فقط تا زمانی که دستگاه آنلاین شود، یعنی برای adb قابل مشاهده باشد، مسدود می‌شود.

abstract void rebootUntilOnline (String reason)

جایگزینی برای reboot() که فقط تا زمانی که دستگاه آنلاین شود، یعنی برای adb قابل مشاهده باشد، مسدود می‌شود.

abstract void rebootUserspace ()

فقط بخش فضای کاربری دستگاه را مجدداً راه‌اندازی می‌کند.

abstract void rebootUserspaceUntilOnline ()

جایگزینی برای rebootUserspace() ()} که فقط تا زمانی که دستگاه آنلاین شود، یعنی برای adb قابل مشاهده باشد، مسدود می‌شود.

abstract void remountSystemReadOnly ()

پارتیشن سیستم را روی دستگاه فقط خواندنی کنید.

abstract void remountSystemWritable ()

پارتیشن سیستم روی دستگاه را قابل نوشتن کنید.

abstract void remountVendorReadOnly ()

پارتیشن vendor را روی دستگاه فقط خواندنی کنید.

abstract void remountVendorWritable ()

پارتیشن vendor روی دستگاه را قابل نوشتن کنید.

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

روشی آسان برای انجام ERROR(/#runInstrumentationTests(com.android.ddmlib.testrunner.IRemoteAndroidTestRunner,Collection)) با یک یا چند شنونده که به عنوان پارامتر ارسال می‌شوند.

abstract boolean runInstrumentationTests ( IRemoteAndroidTestRunner runner, listeners)

تست‌های ابزار دقیق را اجرا می‌کند و بازیابی دستگاه را فراهم می‌کند.

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

مانند ERROR(ITestDevice.runInstrumentationTests(IRemoteAndroidTestRunner, Collection)/com.android.tradefed.device.ITestDevice#runInstrumentationTests(com.android.ddmlib.testrunner.IRemoteAndroidTestRunner,Collection) ITestDevice.runInstrumentationTests(IRemoteAndroidTestRunner, Collection)) اما تست را برای کاربر مورد نظر اجرا می کند.

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

همانند ITestDevice.runInstrumentationTests(IRemoteAndroidTestRunner, ITestLifeCycleReceiver...) است، اما تست را برای یک کاربر مشخص اجرا می‌کند.

abstract void setDate (Date date)

تاریخ را روی دستگاه تنظیم می‌کند

توجه: تنظیم تاریخ روی دستگاه نیاز به روت دارد

abstract void setOptions ( TestDeviceOptions options)

TestDeviceOptions را برای دستگاه تنظیم کنید

abstract boolean setProperty (String propKey, String propValue)

مقدار ویژگی داده شده را روی دستگاه تنظیم می‌کند.

abstract void setRecovery ( IDeviceRecovery recovery)

IDeviceRecovery را برای استفاده در این دستگاه تنظیم کنید.

abstract void setRecoveryMode ( ITestDevice.RecoveryMode mode)

حالت بازیابی فعلی را برای استفاده روی دستگاه تنظیم کنید.

abstract void setTrackingSerial (String trackingSerial)

برای مدیریت دستگاه، سریالی را که برای ارجاع به دستگاه استفاده می‌کنیم، ردیابی کنید.

abstract void setUseFastbootErase (boolean useFastbootErase)

تنظیم کنید که برای پاک کردن یک پارتیشن روی دستگاه، از پاک کردن سریع بوت یا فرمت سریع بوت استفاده شود.

abstract void startLogcat ()

شروع به ضبط خروجی logcat از دستگاه در پس‌زمینه کنید.

abstract boolean startTradeInModeTesting (int timeoutMs)

حالت آزمایشی معاوضه را فعال کنید.

abstract void stopEmulatorOutput ()

خروجی شبیه‌ساز را ببندید و حذف کنید.

abstract void stopLogcat ()

ضبط خروجی logcat از دستگاه را متوقف کنید و داده‌های logcat ذخیره‌شده‌ی فعلی را حذف کنید.

abstract void stopTradeInModeTesting ()

آزمایش حالت معاوضه را متوقف کنید.

abstract String switchToAdbTcp ()

دستگاه را به حالت adb-over-tcp تغییر دهید.

abstract boolean switchToAdbUsb ()

دستگاه را به حالت adb over usb تغییر دهید.

abstract boolean syncFiles (File localFileDir, String deviceFilePath)

به صورت تدریجی محتویات یک دایرکتوری فایل محلی را با دستگاه همگام‌سازی می‌کند.

abstract boolean unlockDevice ()

اگر دستگاه در حالت رمزگذاری شده باشد، قفل دستگاه را باز می‌کند.

abstract void unmountDebugfs ()

اشکال‌زدایی‌ها را از حالت مانت خارج کنید.

abstract boolean waitForBootComplete (long timeOut)

تا زمانی که پرچم تکمیل بوت دستگاه تنظیم نشود، مسدود می‌شود.

abstract boolean waitForDeviceAvailable ()

منتظر می‌ماند تا دستگاه پاسخگو باشد و برای آزمایش در دسترس باشد.

abstract boolean waitForDeviceAvailable (long waitTime)

منتظر می‌ماند تا دستگاه پاسخگو باشد و برای آزمایش در دسترس باشد.

abstract boolean waitForDeviceAvailableInRecoverPath (long waitTime)

بدون در نظر گرفتن مسیر بازیابی، منتظر می‌ماند تا دستگاه پاسخگو و در دسترس باشد.

abstract void waitForDeviceBootloader ()

تا زمانی که دستگاه از طریق فست‌بوت قابل مشاهده نباشد، مسدود می‌شود.

abstract boolean waitForDeviceInRecovery (long waitTime)

مسدود کردن دستگاه برای قرار گرفتن در حالت «بازیابی adb» (توجه داشته باشید که این با IDeviceRecovery متفاوت است).

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 پاسخ دهد.

ثابت‌ها

سطح API ناشناخته

public static final int UNKNOWN_API_LEVEL

مقدار پیش‌فرض زمانی که سطح API قابل شناسایی نباشد

مقدار ثابت: -1 (0xffffffff)

روش‌های عمومی

checkApiLevelAgainstNextRelease

public abstract boolean checkApiLevelAgainstNextRelease (int strictMinLevel)

بررسی می‌کند که آیا یک ویژگی با توجه به حداقل سطح پشتیبانی، در حال حاضر پشتیبانی می‌شود یا خیر. این روش، ویژگی‌های منتشر نشده را قبل از افزایش سطح API در نظر می‌گیرد.

پارامترها
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

حذف فایل

public abstract void deleteFile (String deviceFilePath, 
                int userId)

روش کمکی برای حذف یک فایل یا دایرکتوری روی دستگاه.

پارامترها
deviceFilePath String : مسیر مطلق فایل روی دستگاه.

userId int : شناسه کاربری که قرار است از آن حذف شود

پرتاب‌ها
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

deviceSoftRestarted

public abstract boolean deviceSoftRestarted (ProcessInfo prevSystemServerProcess)

متد کمکی برای بررسی اینکه آیا دستگاه با مقایسه system_server فعلی با system_server قبلی ProcessInfo ، به صورت نرم‌افزاری راه‌اندازی مجدد شده است یا خیر. برای دریافت ProcessInfo getProcessByName(String) استفاده کنید.

پارامترها
prevSystemServerProcess ProcessInfo : فرآیند قبلی system_server به نام ProcessInfo .

بازگشت‌ها
boolean اگر دستگاه به صورت نرم افزاری ریستارت شود، true

پرتاب‌ها
RuntimeException اگر دستگاه دلیل بوت غیرطبیعی داشته باشد
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

deviceSoftRestartشدهاز

public abstract boolean deviceSoftRestartedSince (long utcEpochTime, 
                TimeUnit timeUnit)

متد کمکی برای بررسی اینکه آیا دستگاه از زمان UTC از زمان epoch از دستگاه و ERROR(/TimeUnit) آن، به صورت نرم‌افزاری راه‌اندازی مجدد شده است یا خیر. Soft-Restart به راه‌اندازی مجدد system_server خارج از راه‌اندازی مجدد سخت دستگاه (به عنوان مثال: درخواست راه‌اندازی مجدد) اشاره دارد. utcEpochTime فعلی دستگاه بر حسب میلی‌ثانیه را می‌توان با متد getDeviceDate() بدست آورد.

پارامترها
utcEpochTime long : زمان دستگاه از زمان شروع به کار (epoch) به ثانیه.

timeUnit TimeUnit : واحد زمان TimeUnit برای utcEpochTime داده شده.

بازگشت‌ها
boolean اگر دستگاه به صورت نرم افزاری ریستارت شود، true

پرتاب‌ها
RuntimeException اگر دستگاه دلیل بوت غیرطبیعی داشته باشد
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

غیرفعال کردنAdbRoot

public abstract boolean disableAdbRoot ()

ریشه adb را خاموش می‌کند.

غیرفعال کردن adb root ممکن است باعث شود دستگاه از adb جدا شود. این روش تا زمانی که دستگاه در دسترس قرار گیرد، مسدود خواهد شد.

بازگشت‌ها
boolean در صورت موفقیت، true .

پرتاب‌ها
DeviceNotAvailableException اگر ارتباط با دستگاه قطع شده و قابل بازیابی نباشد.

آیافایل‌موجود است؟

public abstract boolean doesFileExist (String deviceFilePath)

متد کمکی برای تشخیص وجود فایل روی دستگاه.

پارامترها
deviceFilePath String : مسیر مطلق فایل روی دستگاه برای بررسی

بازگشت‌ها
boolean اگر فایل وجود داشته باشد، true و در غیر این صورت false .

پرتاب‌ها
DeviceNotAvailableException اگر ارتباط با دستگاه قطع شده و قابل بازیابی نباشد.

فعال کردنAdbRoot

public abstract boolean enableAdbRoot ()

adb root را فعال می‌کند. اگر تنظیم "enable-root" روی "false" باشد، پیامی را ثبت می‌کند و بدون فعال کردن root برمی‌گرداند.

فعال کردن adb root ممکن است باعث قطع ارتباط دستگاه با adb شود. این روش تا زمانی که دستگاه در دسترس قرار گیرد، مسدود خواهد شد.

بازگشت‌ها
boolean در صورت موفقیت، true .

پرتاب‌ها
DeviceNotAvailableException اگر ارتباط با دستگاه قطع شده و قابل بازیابی نباشد.

اجرای دستور Adb

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

متد کمکی که یک دستور adb را به عنوان یک دستور سیستمی با یک زمان انقضای مشخص اجرا می‌کند.

در صورت امکان، باید از executeShellCommand(String) استفاده شود، زیرا این روش تشخیص خطا و عملکرد بهتری را فراهم می‌کند.

پارامترها
timeout long : زمان بر حسب میلی‌ثانیه قبل از اینکه دستگاه غیرفعال در نظر گرفته شود، 0L برای عدم تایم‌اوت

commandArgs String : دستور adb و آرگومان‌هایی که باید اجرا شوند

بازگشت‌ها
String خروجی استاندارد از دستور. null اگر دستور اجرا نشد.

پرتاب‌ها
DeviceNotAvailableException اگر ارتباط با دستگاه قطع شده و قابل بازیابی نباشد.

اجرای دستور Adb

public abstract String executeAdbCommand (String... commandArgs)

متد کمکی که یک دستور adb را به عنوان یک دستور سیستمی اجرا می‌کند.

در صورت امکان، باید از executeShellCommand(String) استفاده شود، زیرا این روش تشخیص خطا و عملکرد بهتری را فراهم می‌کند.

پارامترها
commandArgs String : دستور adb و آرگومان‌هایی که باید اجرا شوند

بازگشت‌ها
String خروجی استاندارد از دستور. null اگر دستور اجرا نشد.

پرتاب‌ها
DeviceNotAvailableException اگر ارتباط با دستگاه قطع شده و قابل بازیابی نباشد.

اجرای دستور Adb

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

متد کمکی که یک دستور adb را به عنوان یک دستور سیستمی با یک زمان انقضای مشخص اجرا می‌کند.

در صورت امکان، باید از executeShellCommand(String) استفاده شود، زیرا این روش تشخیص خطا و عملکرد بهتری را فراهم می‌کند.

پارامترها
timeout long : زمان بر حسب میلی‌ثانیه قبل از اینکه دستگاه غیرفعال در نظر گرفته شود، 0L برای عدم تایم‌اوت

envMap : محیطی که باید برای دستور تنظیم شود

commandArgs String : دستور adb و آرگومان‌هایی که باید اجرا شوند

بازگشت‌ها
String خروجی استاندارد از دستور. null اگر دستور اجرا نشد.

پرتاب‌ها
DeviceNotAvailableException اگر ارتباط با دستگاه قطع شده و قابل بازیابی نباشد.

اجرای دستور AdbV2

public abstract CommandResult executeAdbV2Command (long timeout, 
                 envMap, 
                String... commandArgs)

متد کمکی که یک دستور adb را به عنوان یک دستور سیستمی با یک زمان انقضای مشخص اجرا می‌کند.

در صورت امکان، باید از executeShellCommand(String) استفاده شود، زیرا این روش تشخیص خطا و عملکرد بهتری را فراهم می‌کند.

پارامترها
timeout long : زمان بر حسب میلی‌ثانیه قبل از اینکه دستگاه غیرفعال در نظر گرفته شود، 0L برای عدم تایم‌اوت

envMap : محیطی که باید برای دستور تنظیم شود

commandArgs String : دستور adb و آرگومان‌هایی که باید اجرا شوند

بازگشت‌ها
CommandResult CommandResult حاوی خروجی دستور.

پرتاب‌ها
DeviceNotAvailableException اگر ارتباط با دستگاه قطع شده و قابل بازیابی نباشد.

اجرای دستور AdbV2

public abstract CommandResult executeAdbV2Command (String... commandArgs)

متد کمکی که یک دستور adb را به عنوان یک دستور سیستمی اجرا می‌کند.

در صورت امکان، باید از executeShellCommand(String) استفاده شود، زیرا این روش تشخیص خطا و عملکرد بهتری را فراهم می‌کند.

پارامترها
commandArgs String : دستور adb و آرگومان‌هایی که باید اجرا شوند

بازگشت‌ها
CommandResult CommandResult حاوی خروجی دستور.

پرتاب‌ها
DeviceNotAvailableException اگر ارتباط با دستگاه قطع شده و قابل بازیابی نباشد.

اجرای دستور AdbV2

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

متد کمکی که یک دستور adb را به عنوان یک دستور سیستمی با یک زمان انقضای مشخص اجرا می‌کند.

در صورت امکان، باید از executeShellCommand(String) استفاده شود، زیرا این روش تشخیص خطا و عملکرد بهتری را فراهم می‌کند.

پارامترها
timeout long : زمان بر حسب میلی‌ثانیه قبل از اینکه دستگاه غیرفعال در نظر گرفته شود، 0L برای عدم تایم‌اوت

commandArgs String : دستور adb و آرگومان‌هایی که باید اجرا شوند

بازگشت‌ها
CommandResult CommandResult حاوی خروجی دستور.

پرتاب‌ها
DeviceNotAvailableException اگر ارتباط با دستگاه قطع شده و قابل بازیابی نباشد.

اجرای دستور Fastboot

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

متد کمکی که یک دستور fastboot را به عنوان یک دستور سیستمی اجرا می‌کند.

انتظار می‌رود زمانی استفاده شود که دستگاه از قبل در حالت فست‌بوت باشد.

پارامترها
timeout long : زمان بر حسب میلی‌ثانیه قبل از انقضای دستور

commandArgs String : دستور fastboot و آرگومان‌هایی که باید اجرا شوند

بازگشت‌ها
CommandResult CommandResult حاوی خروجی دستور

پرتاب‌ها
DeviceNotAvailableException اگر ارتباط با دستگاه قطع شده و قابل بازیابی نباشد.

اجرای دستور Fastboot

public abstract CommandResult executeFastbootCommand (String... commandArgs)

متد کمکی که یک دستور fastboot را به عنوان یک دستور سیستمی با زمان انقضای پیش‌فرض ۲ دقیقه اجرا می‌کند.

انتظار می‌رود زمانی استفاده شود که دستگاه از قبل در حالت فست‌بوت باشد.

پارامترها
commandArgs String : دستور fastboot و آرگومان‌هایی که باید اجرا شوند

بازگشت‌ها
CommandResult CommandResult حاوی خروجی دستور

پرتاب‌ها
DeviceNotAvailableException اگر ارتباط با دستگاه قطع شده و قابل بازیابی نباشد.

اجرای دستور LongFastboot

public abstract CommandResult executeLongFastbootCommand (String... commandArgs)

متد کمکی که یک دستور fastboot طولانی مدت را به عنوان یک دستور سیستمی اجرا می‌کند.

مشابه executeFastbootCommand(String) است، با این تفاوت که از زمان انتظار طولانی‌تری استفاده می‌کند.

پارامترها
commandArgs String : دستور fastboot و آرگومان‌هایی که باید اجرا شوند

بازگشت‌ها
CommandResult CommandResult حاوی خروجی دستور

پرتاب‌ها
DeviceNotAvailableException اگر ارتباط با دستگاه قطع شده و قابل بازیابی نباشد.

اجرای دستور LongFastboot

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

متد کمکی که یک دستور fastboot طولانی مدت را به عنوان یک دستور سیستمی با متغیرهای محیطی سیستم اجرا می‌کند.

مشابه executeFastbootCommand(String) است، با این تفاوت که از زمان انتظار طولانی‌تری استفاده می‌کند.

پارامترها
envVarMap متغیرهای محیطی سیستم که دستور fastboot با آنها اجرا می‌شود

commandArgs String : دستور fastboot و آرگومان‌هایی که باید اجرا شوند

بازگشت‌ها
CommandResult CommandResult حاوی خروجی دستور

پرتاب‌ها
DeviceNotAvailableException اگر ارتباط با دستگاه قطع شده و قابل بازیابی نباشد.

اجرای فرمان Shell

public abstract String executeShellCommand (String command)

متد کمکی که یک دستور shell در adb را اجرا می‌کند و خروجی را به صورت String برمی‌گرداند.

پارامترها
command String : دستور پوسته adb برای اجرا

بازگشت‌ها
String خروجی پوسته

پرتاب‌ها
DeviceNotAvailableException اگر ارتباط با دستگاه قطع شده و قابل بازیابی نباشد.

اجرای فرمان Shell

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

یک دستور adb shell را با پارامترهای بیشتری برای کنترل رفتار دستور اجرا می‌کند.

پارامترها
command String : دستور پوسته adb برای اجرا

receiver IShellOutputReceiver : گیرنده‌ی IShellOutputReceiver برای هدایت خروجی پوسته به آن.

maxTimeToOutputShellResponse long : حداکثر زمانی که دستور مجاز است هیچ پاسخی ارائه ندهد؛ واحد آن در timeUnit مشخص شده است.

timeUnit TimeUnit : واحد برای maxTimeToOutputShellResponse

retryAttempts int : حداکثر تعداد دفعاتی که دستور باید دوباره امتحان شود اگر به دلیل یک استثنا شکست بخورد. اگر retryAttempts موفقیت‌آمیز نباشد، خطای DeviceNotResponsiveException رخ می‌دهد.

پرتاب‌ها
DeviceNotAvailableException اگر ارتباط با دستگاه قطع شده و قابل بازیابی نباشد.

اجرای فرمان Shell

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

یک دستور adb shell را با پارامترهای بیشتری برای کنترل رفتار دستور اجرا می‌کند.

پارامترها
command String : دستور پوسته adb برای اجرا

receiver IShellOutputReceiver : گیرنده‌ی IShellOutputReceiver برای هدایت خروجی پوسته به آن.

maxTimeoutForCommand long : حداکثر زمان لازم برای تکمیل دستور؛ واحدی که در timeUnit مشخص شده است.

maxTimeToOutputShellResponse long : حداکثر زمانی که دستور مجاز است هیچ پاسخی ارائه ندهد؛ واحد آن در timeUnit مشخص شده است.

timeUnit TimeUnit : واحد برای maxTimeToOutputShellResponse

retryAttempts int : حداکثر تعداد دفعاتی که دستور باید دوباره امتحان شود اگر به دلیل یک استثنا شکست بخورد. اگر retryAttempts موفقیت‌آمیز نباشد، خطای DeviceNotResponsiveException رخ می‌دهد.

پرتاب‌ها
DeviceNotAvailableException اگر ارتباط با دستگاه قطع شده و قابل بازیابی نباشد.

اجرای فرمان Shell

public abstract void executeShellCommand (String command, 
                IShellOutputReceiver receiver)

دستور adb shell داده شده را اجرا می‌کند و در صورت عدم موفقیت، چندین بار دیگر تلاش می‌کند.

یک شکل ساده‌تر از executeShellCommand(String, com.android.ddmlib.IShellOutputReceiver, long, TimeUnit, int) با مقادیر پیش‌فرض.

پارامترها
command String : دستور پوسته adb برای اجرا

receiver IShellOutputReceiver : گیرنده‌ی IShellOutputReceiver برای هدایت خروجی پوسته به آن.

پرتاب‌ها
DeviceNotAvailableException اگر ارتباط با دستگاه قطع شده و قابل بازیابی نباشد.

اجرای دستور ShellV2

public abstract CommandResult executeShellV2Command (String command)

متد کمکی که یک دستور پوسته adb را اجرا می‌کند و نتایج را به صورت یک CommandResult که به درستی با خروجی وضعیت دستور، stdout و stderr پر شده است، برمی‌گرداند.

پارامترها
command String : دستوری که باید اجرا شود.

بازگشت‌ها
CommandResult نتیجه در CommandResult .

پرتاب‌ها
DeviceNotAvailableException اگر ارتباط با دستگاه قطع شده و قابل بازیابی نباشد.

اجرای دستور ShellV2

public abstract CommandResult executeShellV2Command (String command, 
                OutputStream pipeToOutput)

متد کمکی که یک دستور پوسته adb را اجرا می‌کند و نتایج را به عنوان یک CommandResult که به درستی با خروجی وضعیت دستور و stderr پر شده است، برمی‌گرداند. stdout به جریان مشخص شده هدایت می‌شود.

پارامترها
command String : دستوری که باید اجرا شود.

pipeToOutput OutputStream : ERROR(/OutputStream) که در آن خروجی استاندارد هدایت می‌شود، یا null است.

بازگشت‌ها
CommandResult نتیجه در CommandResult .

پرتاب‌ها
DeviceNotAvailableException اگر ارتباط با دستگاه قطع شده و قابل بازیابی نباشد.

اجرای دستور ShellV2

public abstract CommandResult executeShellV2Command (String command, 
                File pipeAsInput)

متد کمکی که یک دستور پوسته adb را اجرا می‌کند و نتایج را به عنوان یک CommandResult که به درستی با خروجی وضعیت دستور، stdout و stderr پر شده است، برمی‌گرداند.

پارامترها
command String : دستوری که باید اجرا شود.

pipeAsInput File : یک ERROR(/File) که به عنوان ورودی به دستور ارسال می‌شود، یا null.

بازگشت‌ها
CommandResult نتیجه در CommandResult .

پرتاب‌ها
DeviceNotAvailableException اگر ارتباط با دستگاه قطع شده و قابل بازیابی نباشد.

اجرای دستور ShellV2

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

یک دستور adb shell را با پارامترهای بیشتری برای کنترل رفتار دستور اجرا می‌کند.

پارامترها
command String : دستور پوسته adb برای اجرا

maxTimeoutForCommand long : حداکثر زمان لازم برای تکمیل دستور؛ واحدی که در timeUnit مشخص شده است.

timeUnit TimeUnit : واحد برای maxTimeToOutputShellResponse

retryAttempts int : حداکثر تعداد دفعاتی که دستور باید دوباره امتحان شود اگر به دلیل یک استثنا شکست بخورد. اگر retryAttempts موفقیت‌آمیز نباشد، خطای DeviceNotResponsiveException رخ می‌دهد.

بازگشت‌ها
CommandResult

پرتاب‌ها
DeviceNotAvailableException اگر ارتباط با دستگاه قطع شده و قابل بازیابی نباشد.

همچنین ببینید:

اجرای دستور ShellV2

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

یک دستور adb shell را با پارامترهای بیشتری برای کنترل رفتار دستور اجرا می‌کند.

پارامترها
command String : دستور پوسته adb برای اجرا

maxTimeoutForCommand long : حداکثر زمان لازم برای تکمیل دستور؛ واحدی که در timeUnit مشخص شده است.

timeUnit TimeUnit : واحد برای maxTimeToOutputShellResponse

بازگشت‌ها
CommandResult

پرتاب‌ها
DeviceNotAvailableException اگر ارتباط با دستگاه قطع شده و قابل بازیابی نباشد.

همچنین ببینید:

اجرای دستور ShellV2

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

یک دستور adb shell را با پارامترهای بیشتری برای کنترل رفتار دستور اجرا می‌کند.

پارامترها
command String : دستور پوسته adb برای اجرا

pipeAsInput File : یک ERROR(/File) که به عنوان ورودی به دستور ارسال می‌شود، یا null.

pipeToOutput OutputStream : ERROR(/OutputStream) که در آن خروجی استاندارد هدایت می‌شود، یا null است.

maxTimeoutForCommand long : حداکثر زمان لازم برای تکمیل دستور؛ واحدی که در timeUnit مشخص شده است.

timeUnit TimeUnit : واحد برای maxTimeToOutputShellResponse

retryAttempts int : حداکثر تعداد دفعاتی که دستور باید دوباره امتحان شود اگر به دلیل یک استثنا شکست بخورد. اگر retryAttempts موفقیت‌آمیز نباشد، خطای DeviceNotResponsiveException رخ می‌دهد.

بازگشت‌ها
CommandResult

پرتاب‌ها
DeviceNotAvailableException اگر ارتباط با دستگاه قطع شده و قابل بازیابی نباشد.

همچنین ببینید:

اجرای دستور ShellV2

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

یک دستور adb shell را با پارامترهای بیشتری برای کنترل رفتار دستور اجرا می‌کند.

پارامترها
command String : دستور پوسته adb برای اجرا

pipeAsInput File : یک ERROR(/File) که به عنوان ورودی به دستور ارسال می‌شود، یا null.

pipeToOutput OutputStream : ERROR(/OutputStream) که در آن خروجی استاندارد هدایت می‌شود، یا null است.

pipeToError OutputStream : ERROR(/OutputStream) که در آن خطای std به مسیر دیگری هدایت می‌شود، یا null.

maxTimeoutForCommand long : حداکثر زمان لازم برای تکمیل دستور؛ واحدی که در timeUnit مشخص شده است.

timeUnit TimeUnit : واحد برای maxTimeToOutputShellResponse

retryAttempts int : حداکثر تعداد دفعاتی که دستور باید دوباره امتحان شود اگر به دلیل یک استثنا شکست بخورد. اگر retryAttempts موفقیت‌آمیز نباشد، خطای DeviceNotResponsiveException رخ می‌دهد.

بازگشت‌ها
CommandResult

پرتاب‌ها
DeviceNotAvailableException اگر ارتباط با دستگاه قطع شده و قابل بازیابی نباشد.

همچنین ببینید:

پارتیشن بندی پاک شده fastboot

public abstract CommandResult fastbootWipePartition (String partition)

روش کمکی که یک پارتیشن را برای دستگاه پاک می‌کند.

اگر getUseFastbootErase() برابر با true باشد، از fastboot erase برای پاک کردن پارتیشن استفاده می‌شود. سپس دستگاه باید دفعه بعد که بوت می‌شود، یک فایل سیستم ایجاد کند. در غیر این صورت، از فرمت fastboot استفاده می‌شود که یک فایل سیستم جدید روی دستگاه ایجاد می‌کند.

انتظار می‌رود زمانی استفاده شود که دستگاه از قبل در حالت فست‌بوت باشد.

پارامترها
partition String : پارتیشنی که باید پاک شود

بازگشت‌ها
CommandResult CommandResult حاوی خروجی دستور

پرتاب‌ها
DeviceNotAvailableException اگر ارتباط با دستگاه قطع شده و قابل بازیابی نباشد.

دریافت سطح API

public abstract int getApiLevel ()

سطح API دستگاه را دریافت کنید. مقدار پیش‌فرض UNKNOWN_API_LEVEL است.

بازگشت‌ها
int یک عدد صحیح که سطح API دستگاه را نشان می‌دهد

پرتاب‌ها
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

دریافت نسخه باند پایه

public abstract String getBasebandVersion ()

روش راحتی برای دریافت نسخه بیس‌باند (رادیویی) این دستگاه. دریافت نسخه رادیویی مختص دستگاه است، بنابراین ممکن است اطلاعات صحیح را برای همه دستگاه‌ها برنگرداند. این روش برای بازگرداندن اطلاعات نسخه صحیح به gsm.version.baseband خاص متکی است. این برای برخی از دستگاه‌های CDMA دقیق نیست و نسخه برگردانده شده در اینجا ممکن است با نسخه گزارش شده از fastboot مطابقت نداشته باشد و ممکن است نسخه مربوط به رادیو CDMA را برنگرداند. به طور خلاصه، این روش فقط در صورتی نسخه دقیق را گزارش می‌دهد که ویژگی 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 اگر ویژگی دارای مقادیر "1" ، "y" ، "yes" ، "on" یا "true" باشد، true اگر ویژگی دارای مقادیر "0" ، "n" ، "no" ، "off" ، "false" باشد، false و در غیر این صورت defaultValue برمی‌گرداند.

پرتاب‌ها
DeviceNotAvailableException

دریافت تاریخچه بوت

public abstract  getBootHistory ()

متد کمکی، نقشه تاریخچه بوت را به همراه زمان بوت و دلیل بوت جمع‌آوری می‌کند.

بازگشت‌ها
نقشه زمان بوت (زمان UTC به ثانیه از زمان شروع) و دلیل بوت

پرتاب‌ها
DeviceNotAvailableException

دریافت تاریخچه بوت از

public abstract  getBootHistorySince (long utcEpochTime, 
                TimeUnit timeUnit)

متد کمکی، نقشه تاریخچه بوت را به همراه زمان بوت و دلیل بوت از زمان داده شده از epoch از دستگاه و واحد زمانی مشخص شده جمع‌آوری می‌کند. utcEpochTime دستگاه فعلی بر حسب میلی‌ثانیه را می‌توان با متد getDeviceDate() بدست آورد.

پارامترها
utcEpochTime long : زمان دستگاه از زمان شروع.

timeUnit TimeUnit : واحد زمان TimeUnit .

بازگشت‌ها
نقشه زمان بوت (زمان UTC به ثانیه از زمان شروع) و دلیل بوت

پرتاب‌ها
DeviceNotAvailableException

دریافت نسخه بوت لودر

public abstract String getBootloaderVersion ()

روش راحتی برای دریافت نسخه بوت لودر این دستگاه.

سعی می‌کند نسخه بوت‌لودر را از وضعیت فعلی دستگاه بازیابی کند. (یعنی اگر دستگاه در حالت فست‌بوت باشد، سعی می‌کند نسخه را از فست‌بوت بازیابی کند)

بازگشت‌ها
String نسخه بوت لودر String یا در صورت عدم یافتن null

پرتاب‌ها
DeviceNotAvailableException اگر ارتباط با دستگاه قطع شده و قابل بازیابی نباشد.

دریافت نام مستعار ساخت

public abstract String getBuildAlias ()

نام مستعار ساختاری را که دستگاه در حال حاضر در حال اجرا است، بازیابی کنید.

نام مستعار ساخت معمولاً رشته‌ای خواناتر از شناسه ساخت است (که معمولاً برای ساخت‌های Nexus یک عدد است). برای مثال، نسخه نهایی اندروید ۴.۲ دارای نام مستعار ساخت JDQ39 و شناسه ساخت ۵۷۳۰۳۸ است.

بازگشت‌ها
String نام مستعار ساخت یا اگر قابل بازیابی نبود، به شناسه ساخت برگردید

پرتاب‌ها
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

دریافت‌کننده

public abstract String getBuildFlavor ()

طعم ساخت دستگاه را بازیابی کنید.

بازگشت‌ها
String اگر نتوان آن را بازیابی کرد، مقدار build flavor یا null را برمی‌گرداند.

پرتاب‌ها
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

دریافت شناسه ساخت

public abstract String getBuildId ()

نسخه‌ای از دستگاه که در حال حاضر در حال اجرا است را بازیابی کنید.

بازگشت‌ها
String شناسه ساخت یا IBuildInfo.UNKNOWN_BUILD_ID در صورت عدم امکان بازیابی

پرتاب‌ها
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

کلیدهای امضای ساخت

public abstract String getBuildSigningKeys ()

نوع کلید مورد استفاده برای امضای تصویر دستگاه را برمی‌گرداند.

معمولاً دستگاه‌های اندروید ممکن است با کلیدهای تست (مانند AOSP) یا کلیدهای انتشار (که توسط تولیدکنندگان دستگاه کنترل می‌شوند) امضا شوند.

بازگشت‌ها
String کلید امضا در صورت وجود، و در غیر این صورت تهی (null).

پرتاب‌ها
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

کودکان را دریافت کنید

public abstract String[] getChildren (String deviceFilePath)

جایگزینی برای استفاده از IFileEntry که گاهی اوقات به دلیل مجوزها کار نمی‌کند.

پارامترها
deviceFilePath String : مسیری در دستگاه است که جستجو در آن انجام می‌شود.

بازگشت‌ها
String[] آرایه‌ای از رشته که شامل تمام فایل‌های موجود در یک مسیر روی دستگاه است.

پرتاب‌ها
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

دریافت اتصال

public abstract AbstractConnection getConnection ()

اتصال مرتبط با دستگاه را برمی‌گرداند.

بازگشت‌ها
AbstractConnection

کلاس دستگاه را دریافت کنید

public abstract String getDeviceClass ()

کلاس دستگاه را دریافت کنید.

بازگشت‌ها
String کلاس دستگاه String .

دریافت تاریخ دستگاه

public abstract long getDeviceDate ()

تاریخ دستگاه را از زمان شروع (epoch) بر حسب میلی ثانیه برمی‌گرداند.

بازگشت‌ها
long تاریخ دستگاه در قالب عصر.

پرتاب‌ها
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

دریافت توصیفگر دستگاه

public abstract DeviceDescriptor getDeviceDescriptor ()

یک DeviceDescriptor از اطلاعات دستگاه برمی‌گرداند تا بدون ارسال شیء دستگاه واقعی، اطلاعات مربوط به آن را دریافت کند.

بازگشت‌ها
DeviceDescriptor

دریافت توصیفگر دستگاه

public abstract DeviceDescriptor getDeviceDescriptor (boolean shortDescriptor)

یک DeviceDescriptor از اطلاعات دستگاه برمی‌گرداند تا بدون ارسال شیء دستگاه واقعی، اطلاعات مربوط به آن را دریافت کند.

پارامترها
shortDescriptor boolean : آیا توصیفگر به حداقل اطلاعات محدود شود یا خیر

بازگشت‌ها
DeviceDescriptor

دریافت وضعیت دستگاه

public abstract TestDeviceState getDeviceState ()

وضعیت دستگاه را دریافت کنید.

بازگشت‌ها
TestDeviceState

دریافت زمان دستگاه (getDeviceTimeOffset)

public abstract long getDeviceTimeOffset (Date date)

تابع کمکی برای دریافت اختلاف زمانی بین دستگاه و یک ERROR(/Date) داده شده. از زمان Epoch به صورت داخلی استفاده کنید.

پارامترها
date Date

بازگشت‌ها
long اختلاف بر حسب میلی ثانیه

پرتاب‌ها
DeviceNotAvailableException

خروجی شبیه‌ساز

public abstract InputStreamSource getEmulatorOutput ()

دریافت جریان خروجی استاندارد و خروجی استاندارد شبیه‌ساز

بازگشت‌ها
InputStreamSource خروجی شبیه ساز

فضای رایگان فروشگاه خارجی را دریافت کنید

public abstract long getExternalStoreFreeSpace ()

روش کمکی برای تعیین میزان فضای خالی روی حافظه خارجی دستگاه.

بازگشت‌ها
long مقدار فضای خالی بر حسب کیلوبایت

پرتاب‌ها
DeviceNotAvailableException اگر ارتباط با دستگاه قطع شده و قابل بازیابی نباشد.

دریافت FastbootProductType

public abstract String getFastbootProductType ()

روشی آسان برای دریافت نوع محصول این دستگاه در حالت فست‌بوت.

این متد فقط در صورتی باید استفاده شود که دستگاه در حالت فست‌بوت باشد. در این مورد، این متد کمی امن‌تر از متد عمومی getProductType() است، زیرا ITestDevice می‌داند که اگر دستگاه در وضعیت نادرستی باشد یا پاسخ ندهد، باید آن را به حالت فست‌بوت بازیابی کند.

بازگشت‌ها
String نام نوع محصول String یا در صورت عدم امکان تعیین، null

پرتاب‌ها
DeviceNotAvailableException اگر ارتباط با دستگاه قطع شده و قابل بازیابی نباشد.

دریافت FastbootProductVariant

public abstract String getFastbootProductVariant ()

روشی آسان برای دریافت نوع محصول این دستگاه در حالت فست‌بوت.

This method should only be used if device should be in fastboot. Its a bit safer variant than the generic getProductType() method in this case, because ITestDevice will know to recover device into fastboot if device is in incorrect state or is unresponsive.

بازگشت‌ها
String the String product type name or null if it cannot be determined

پرتاب‌ها
DeviceNotAvailableException if connection with device is lost and cannot be recovered.

getFastbootSerialNumber

public abstract String getFastbootSerialNumber ()

Returns the fastboot mode serial number.

بازگشت‌ها
String

getFastbootVariable

public abstract String getFastbootVariable (String variableName)

Retrieve the given fastboot variable value from the device.

پارامترها
variableName String : the variable name

بازگشت‌ها
String the property value or null if it does not exist

پرتاب‌ها
UnsupportedOperationException
DeviceNotAvailableException

دریافت فایل ورودی

public abstract IFileEntry getFileEntry (String path)

Retrieve a reference to a remote file on device.

پارامترها
path String : the file path to retrieve. Can be an absolute path or path relative to '/'. (ie both "/system" and "system" syntax is supported)

بازگشت‌ها
IFileEntry the IFileEntry or null if file at given path cannot be found

پرتاب‌ها
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getIDevice

public abstract IDevice getIDevice ()

Returns a reference to the associated ddmlib IDevice .

A new IDevice may be allocated by DDMS each time the device disconnects and reconnects from adb. Thus callers should not keep a reference to the IDevice , because that reference may become stale.

بازگشت‌ها
IDevice the IDevice

getIntProperty

public abstract long getIntProperty (String name, 
                long defaultValue)

Returns integer value of the given property from the device.

پارامترها
name String : the property name

defaultValue long : default value to return if property is empty or doesn't exist.

بازگشت‌ها
long the property value or defaultValue if the property is empty, doesn't exist, or doesn't have an integer value.

پرتاب‌ها
DeviceNotAvailableException

getLastExpectedRebootTimeMillis

public abstract long getLastExpectedRebootTimeMillis ()

Returns the last time Tradefed APIs triggered a reboot in milliseconds since EPOCH as returned by 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:

  • If the logcat is currently being captured in the background, will return up to TestDeviceOptions.getMaxLogcatDataSize() bytes of the current contents of the background logcat capture
  • Otherwise, will return a static dump of the logcat data if device is currently responding

    بازگشت‌ها
    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

    دریافت نقطه اتصال

    public abstract String getMountPoint (String mountName)

    یک نقطه اتصال (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 abstract  getMountPointInfo ()

    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.

    دریافت ویژگی

    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.

    دریافت شماره سریال

    public abstract String getSerialNumber ()

    Convenience method to get serial number of this device.

    بازگشت‌ها
    String the String serial number

    getTombstones

    public abstract  getTombstones ()

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

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

    بازگشت‌ها
    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

    getTrackingSerial

    public String getTrackingSerial ()

    For device management purpose get the serial used to track the device.

    بازگشت‌ها
    String

    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

    isDebugfsMounted

    public abstract boolean isDebugfsMounted ()

    Check if debugfs is mounted.

    بازگشت‌ها
    boolean true if debugfs is mounted

    پرتاب‌ها
    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.

    ایس دایرکتور

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

    mountDebugfs

    public abstract void mountDebugfs ()

    Mount debugfs.

    پرتاب‌ها
    com.android.tradefed.device.DeviceNotAvailableException
    DeviceNotAvailableException

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

    این روش منسوخ شده است.
    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.

    pullDir

    public abstract boolean pullDir (String deviceFilePath, 
                    File localDir, 
                    int userId)

    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

    userId int : the user id to pull from

    بازگشت‌ها
    boolean true if file was pulled successfully. false otherwise.

    پرتاب‌ها
    DeviceNotAvailableException if connection with device is lost and cannot be recovered.

    فایل pull

    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.

    فایل pull

    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.

    فایل pull

    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.

    فایل pull

    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, 
                    int userId)

    Recursively push directory contents to device.

    پارامترها
    localDir File : the local directory to push

    deviceFilePath String : the absolute file path of the remote destination

    userId int : the user id to push to

    بازگشت‌ها
    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, 
                     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 : Set of excluded directories names that shouldn't be pushed.

    بازگشت‌ها
    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.

    pushFile

    public abstract boolean pushFile (File localFile, 
                    String deviceFilePath, 
                    int userId)

    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

    userId int : the userId to push to

    بازگشت‌ها
    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.

    راه اندازی مجدد

    public abstract void reboot ()

    Reboots the device into adb mode.

    Blocks until device becomes available.

    پرتاب‌ها
    DeviceNotAvailableException if device is not available after 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 : the test result 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.

    setTrackingSerial

    public abstract void setTrackingSerial (String trackingSerial)

    For device management purpose track the serial we use for referencing the device.

    پارامترها
    trackingSerial String

    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.

    startTradeInModeTesting

    public abstract boolean startTradeInModeTesting (int timeoutMs)

    Enable testing trade-in mode. The device will be wiped and will reboot.

    پارامترها
    timeoutMs int

    بازگشت‌ها
    boolean True if we were successful, false otherwise

    پرتاب‌ها
    com.android.tradefed.device.DeviceNotAvailableException
    DeviceNotAvailableException

    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.

    stopTradeInModeTesting

    public abstract void stopTradeInModeTesting ()

    Stop testing trade-in mode. The device will reboot.

    پرتاب‌ها
    com.android.tradefed.device.DeviceNotAvailableException
    DeviceNotAvailableException

    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 call postBootSetup() . 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.

    unmountDebugfs

    public abstract void unmountDebugfs ()

    Unmount debugfs.

    پرتاب‌ها
    com.android.tradefed.device.DeviceNotAvailableException
    DeviceNotAvailableException

    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.