नेटिवडिवाइस
public class NativeDevice
extends Object
implements IManagedTestDevice , IConfigurationReceiver , ITestLoggerReceiver
java.lang.ऑब्जेक्ट | |
↳ | com.android.tradefed.device.NativeDevice |
ITestDevice
गैर-पूर्ण स्टैक एंड्रॉइड डिवाइस का डिफ़ॉल्ट कार्यान्वयन।
सारांश
नेस्टेड कक्षाएं | |
---|---|
class | NativeDevice.AdbAction OS 'adb ....' कमांड चलाने के लिए एक |
class | NativeDevice.AdbShellAction |
class | NativeDevice.RebootDeviceAction किसी डिवाइस को रीबूट करने के लिए |
स्थिरांक | |
---|---|
int | INVALID_USER_ID किसी भी अमान्य/नहीं मिली उपयोगकर्ता आईडी के लिए लौटाया गया मान: UserHandle ने -10000 मान परिभाषित किया |
long | MAX_HOST_DEVICE_TIME_OFFSET |
int | MAX_RETRY_ATTEMPTS कमांड पुनः प्रयास करने के प्रयासों की डिफ़ॉल्ट संख्या |
खेत | |
---|---|
protected static final String | SD_CARD |
protected static final String | STORAGE_EMULATED |
protected TestDeviceOptions | mOptions |
protected final IDeviceStateMonitor | mStateMonitor
|
सार्वजनिक निर्माणकर्ता | |
---|---|
NativeDevice (IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor) एक |
सार्वजनिक तरीके | |
---|---|
void | batchPrefetchStartupBuildProps () सूक्ष्म अनुकूलन (लगभग 400 मिली) प्रत्येक प्रॉप्स के लिए 'एडीबी गेटप्रॉप' को कॉल करने के बजाय हमें आवश्यक सभी प्रॉप्स को प्रीफ़ेच करके। |
boolean | canSwitchToHeadlessSystemUser () यह बताता है कि क्या इसे हेडलेस सिस्टम उपयोगकर्ता पर स्विच करने की अनुमति है। |
boolean | checkApiLevelAgainstNextRelease (int strictMinLevel) न्यूनतम समर्थित स्तर पर जांचें कि कोई सुविधा वर्तमान में समर्थित है या नहीं। |
boolean | checkConnectivity () जांचें कि डिवाइस में नेटवर्क कनेक्टिविटी है या नहीं। |
boolean | clearErrorDialogs () डिवाइस यूआई पर वर्तमान में प्रदर्शित किसी भी त्रुटि संवाद को खारिज करने का प्रयास करें। |
void | clearLastConnectedWifiNetwork () अंतिम कनेक्टेड वाईफाई नेटवर्क को साफ़ करता है। |
void | clearLogcat () किसी भी संचित लॉगकैट डेटा को हटा देता है। |
boolean | connectToWifiNetwork ( wifiSsidToPsk, boolean scanSsid) connectToWifiNetwork ( wifiSsidToPsk, boolean scanSsid) वाईफ़ाई नेटवर्क से कनेक्ट होता है. |
boolean | connectToWifiNetwork (String wifiSsid, String wifiPsk) वाईफ़ाई नेटवर्क से कनेक्ट होता है. |
boolean | connectToWifiNetwork ( wifiSsidToPsk) connectToWifiNetwork ( wifiSsidToPsk) वाईफ़ाई नेटवर्क से कनेक्ट होता है.f |
boolean | connectToWifiNetwork (String wifiSsid, String wifiPsk, boolean scanSsid) वाईफ़ाई नेटवर्क से कनेक्ट होता है. |
boolean | connectToWifiNetworkIfNeeded (String wifiSsid, String wifiPsk, boolean scanSsid) |
boolean | connectToWifiNetworkIfNeeded (String wifiSsid, String wifiPsk) |
int | createUser (String name, boolean guest, boolean ephemeral) दिए गए नाम और दिए गए फ़्लैग के साथ एक उपयोगकर्ता बनाएं |
int | createUser (String name, boolean guest, boolean ephemeral, boolean forTesting) दिए गए नाम और दिए गए फ़्लैग के साथ एक उपयोगकर्ता बनाएं |
int | createUser (String name) दिए गए नाम और डिफ़ॉल्ट फ़्लैग 0 के साथ एक उपयोगकर्ता बनाएं। |
int | createUserNoThrow (String name) दिए गए नाम और डिफ़ॉल्ट फ़्लैग 0 के साथ एक उपयोगकर्ता बनाएं। |
void | deleteFile (String deviceFilePath) डिवाइस पर किसी फ़ाइल या निर्देशिका को हटाने के लिए सहायक विधि। |
void | deregisterDeviceActionReceiver ( IDeviceActionReceiver deviceActionReceiver) पंजीकृत |
boolean | deviceSoftRestarted ( ProcessInfo prevSystemServerProcess) वर्तमान system_server की पिछले system_server |
boolean | deviceSoftRestartedSince (long utcEpochTime, TimeUnit timeUnit) यह जांचने के लिए सहायक विधि कि डिवाइस और उसके |
boolean | disableAdbRoot () एडीबी रूट को बंद कर देता है। |
void | disableKeyguard () कीगार्ड को निष्क्रिय करने का प्रयास. |
boolean | disableNetworkMonitor () डिवाइस पर नेटवर्क मॉनिटरिंग अक्षम करता है। |
boolean | disconnectFromWifi () वाईफ़ाई नेटवर्क से डिस्कनेक्ट हो जाता है। |
boolean | doesFileExist (String deviceFilePath, int userId) यह निर्धारित करने के लिए सहायक विधि कि डिवाइस पर फ़ाइल किसी दिए गए उपयोगकर्ता के लिए मौजूद है या नहीं। |
boolean | doesFileExist (String deviceFilePath) डिवाइस पर फ़ाइल मौजूद है या नहीं यह निर्धारित करने के लिए सहायक विधि। |
File | dumpHeap (String process, String devicePath) System_server से ढेर को डंप करने का प्रयास करें। |
boolean | enableAdbRoot () एडीबी रूट चालू करता है। |
boolean | enableNetworkMonitor () डिवाइस पर नेटवर्क मॉनिटरिंग सक्षम करता है। |
String | executeAdbCommand (long timeout, String... cmdArgs) हेल्पर विधि जो एक एडीबी कमांड को एक निर्दिष्ट टाइमआउट के साथ सिस्टम कमांड के रूप में निष्पादित करती है। |
String | executeAdbCommand (long timeout, envMap, String... cmdArgs) executeAdbCommand (long timeout, envMap, String... cmdArgs) हेल्पर विधि जो एक एडीबी कमांड को एक निर्दिष्ट टाइमआउट के साथ सिस्टम कमांड के रूप में निष्पादित करती है। |
String | executeAdbCommand (String... cmdArgs) हेल्पर विधि जो एडीबी कमांड को सिस्टम कमांड के रूप में निष्पादित करती है। |
CommandResult | executeFastbootCommand (String... cmdArgs) हेल्पर विधि जो फास्टबूट कमांड को 2 मिनट के डिफ़ॉल्ट टाइमआउट के साथ सिस्टम कमांड के रूप में निष्पादित करती है। |
CommandResult | executeFastbootCommand (long timeout, String... cmdArgs) हेल्पर विधि जो फास्टबूट कमांड को सिस्टम कमांड के रूप में निष्पादित करती है। |
CommandResult | executeLongFastbootCommand (String... cmdArgs) हेल्पर विधि जो लंबे समय तक चलने वाले फास्टबूट कमांड को सिस्टम कमांड के रूप में निष्पादित करती है। |
CommandResult | executeLongFastbootCommand ( envVarMap, String... cmdArgs) executeLongFastbootCommand ( envVarMap, String... cmdArgs) हेल्पर विधि जो सिस्टम वातावरण चर के साथ सिस्टम कमांड के रूप में लंबे समय तक चलने वाले फास्टबूट कमांड को निष्पादित करती है। |
String | executeShellCommand (String command) हेल्पर विधि जो एडीबी शेल कमांड निष्पादित करती है और |
void | executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts) कमांड व्यवहार को नियंत्रित करने के लिए अधिक मापदंडों के साथ एक एडीबी शेल कमांड निष्पादित करता है। |
void | executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeoutForCommand, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts) कमांड व्यवहार को नियंत्रित करने के लिए अधिक मापदंडों के साथ एक एडीबी शेल कमांड निष्पादित करता है। |
void | executeShellCommand (String command, IShellOutputReceiver receiver) दिए गए एडीबी शेल कमांड को निष्पादित करता है, यदि कमांड विफल हो जाता है तो कई बार पुन: प्रयास करता है। |
CommandResult | executeShellV2Command (String cmd) हेल्पर विधि जो एडीबी शेल कमांड को निष्पादित करती है और कमांड स्टेटस आउटपुट, स्टडआउट और स्टडर के साथ उचित रूप से पॉप्युलेट किए गए |
CommandResult | executeShellV2Command (String cmd, OutputStream pipeToOutput) हेल्पर विधि जो एडीबी शेल कमांड को निष्पादित करती है और कमांड स्थिति आउटपुट और stderr के साथ उचित रूप से पॉप्युलेट किए गए |
CommandResult | executeShellV2Command (String cmd, File pipeAsInput) हेल्पर विधि जो एडीबी शेल कमांड को निष्पादित करती है और कमांड स्टेटस आउटपुट, स्टडआउट और स्टडर के साथ उचित रूप से पॉप्युलेट किए गए |
CommandResult | executeShellV2Command (String cmd, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts) कमांड व्यवहार को नियंत्रित करने के लिए अधिक मापदंडों के साथ एक एडीबी शेल कमांड निष्पादित करता है। |
CommandResult | executeShellV2Command (String cmd, long maxTimeoutForCommand, TimeUnit timeUnit) कमांड व्यवहार को नियंत्रित करने के लिए अधिक मापदंडों के साथ एक एडीबी शेल कमांड निष्पादित करता है। |
CommandResult | executeShellV2Command (String cmd, File pipeAsInput, OutputStream pipeToOutput, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts) कमांड व्यवहार को नियंत्रित करने के लिए अधिक मापदंडों के साथ एक एडीबी शेल कमांड निष्पादित करता है। |
CommandResult | executeShellV2Command (String cmd, File pipeAsInput, OutputStream pipeToOutput, OutputStream pipeToError, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts) कमांड व्यवहार को नियंत्रित करने के लिए अधिक मापदंडों के साथ एक एडीबी शेल कमांड निष्पादित करता है। |
CommandResult | fastbootWipePartition (String partition) सहायक विधि जो डिवाइस के लिए एक विभाजन को मिटा देती है। |
getActiveApexes () डिवाइस पर सक्रिय APEXes के बारे में जानकारी प्राप्त करें। | |
getAllSettings (String namespace) अनुरोधित नामस्थान के मुख्य मान जोड़े लौटाएँ। | |
DeviceAllocationState | getAllocationState () डिवाइस की वर्तमान आवंटन स्थिति लौटाएँ |
String | getAndroidId (int userId) उपयोगकर्ता आईडी से संबद्ध एंड्रॉइड-आईडी ढूंढें और लौटाएं, यदि नहीं मिला तो शून्य कर दें। |
getAndroidIds () उपयोगकर्ता आईडी से मेल खाने वाली एंड्रॉइड आईडी का एक मानचित्र बनाएं। | |
int | getApiLevel () डिवाइस एपीआई स्तर प्राप्त करें। |
PackageInfo | getAppPackageInfo (String packageName) डिवाइस पर स्थापित पैकेज के बारे में जानकारी प्राप्त करें। |
getAppPackageInfos () डिवाइस पर स्थापित पैकेजों की जानकारी प्राप्त करें। | |
String | getBasebandVersion () इस उपकरण का बेसबैंड (रेडियो) संस्करण प्राप्त करने की सुविधा विधि। |
Integer | getBattery () डिवाइस का वर्तमान बैटरी स्तर लौटाता है या बैटरी स्तर अनुपलब्ध होने पर शून्य लौटाता है। |
boolean | getBooleanProperty (String name, boolean defaultValue) दी गई संपत्ति का बूलियन मान लौटाता है। |
getBootHistory () हेल्पर विधि बूट समय और बूट कारण के साथ बूट इतिहास मानचित्र एकत्र करती है। | |
getBootHistorySince (long utcEpochTime, TimeUnit timeUnit) हेल्पर विधि डिवाइस से युग के बाद से दिए गए समय और निर्दिष्ट समय इकाई के बाद से बूट इतिहास मानचित्र को बूट समय और बूट कारण के साथ एकत्र करती है। | |
String | getBootloaderVersion () इस डिवाइस का बूटलोडर संस्करण प्राप्त करने की सुविधा विधि। |
InputStreamSource | getBugreport () डिवाइस से बगरिपोर्ट पुनर्प्राप्त करता है। |
InputStreamSource | getBugreportz () डिवाइस से एक bugreportz पुनर्प्राप्त करता है। |
String | getBuildAlias () उस बिल्ड का उपनाम पुनः प्राप्त करें जो डिवाइस वर्तमान में चल रहा है। |
String | getBuildFlavor () डिवाइस के लिए बिल्ड फ्लेवर पुनः प्राप्त करें। |
String | getBuildId () डिवाइस द्वारा वर्तमान में चल रहे बिल्ड को पुनः प्राप्त करें। |
String | getBuildSigningKeys () डिवाइस छवि पर हस्ताक्षर करने के लिए उपयोग की जाने वाली कुंजी प्रकार लौटाता है आमतौर पर एंड्रॉइड डिवाइस पर परीक्षण-कुंजी (जैसे एओएसपी में) या रिलीज़-कुंजी (व्यक्तिगत डिवाइस निर्माताओं द्वारा नियंत्रित) के साथ हस्ताक्षर किए जा सकते हैं। |
DeviceDescriptor | getCachedDeviceDescriptor () यदि डिवाइस आवंटित किया गया है तो कैश्ड |
DeviceDescriptor | getCachedDeviceDescriptor (boolean shortDescriptor) यदि डिवाइस आवंटित किया गया है तो कैश्ड |
String[] | getChildren (String path) |
AbstractConnection | getConnection () डिवाइस से संबद्ध वर्तमान कनेक्शन. |
DeviceFoldableState | getCurrentFoldableState () डिवाइस की वर्तमान फ़ोल्ड करने योग्य स्थिति लौटाता है या कुछ समस्याएँ होने पर शून्य लौटाता है। |
int | getCurrentUser () वर्तमान चल रहे उपयोगकर्ता की आईडी लौटाएँ। |
String | getDeviceClass () डिवाइस क्लास प्राप्त करें. |
long | getDeviceDate () युग के बाद से डिवाइस की तारीख मिलीसेकंड में लौटाएं। |
DeviceDescriptor | getDeviceDescriptor () वास्तविक डिवाइस ऑब्जेक्ट को पास किए बिना इसके बारे में जानकारी प्राप्त करने के लिए डिवाइस जानकारी से |
DeviceDescriptor | getDeviceDescriptor (boolean shortDescriptor) वास्तविक डिवाइस ऑब्जेक्ट को पास किए बिना इसके बारे में जानकारी प्राप्त करने के लिए डिवाइस जानकारी से |
TestDeviceState | getDeviceState () डिवाइस की स्थिति प्राप्त करें. |
long | getDeviceTimeOffset (Date date) डिवाइस और किसी दिए गए |
InputStreamSource | getEmulatorOutput () एम्यूलेटर stdout और stderr की स्ट्रीम प्राप्त करें |
Process | getEmulatorProcess () इस एमुलेटर से संबंधित |
final File | getExecuteShellCommandLog () वह लॉग जिसमें सभी |
long | getExternalStoreFreeSpace () डिवाइस के बाह्य भंडारण पर खाली स्थान की मात्रा निर्धारित करने के लिए सहायक विधि। |
String | getFastbootPath () उपयोग किए जा रहे फास्टबूट बाइनरी का पथ लौटाता है। |
String | getFastbootProductType () फास्टबूट मोड में इस डिवाइस का उत्पाद प्रकार प्राप्त करने की सुविधा विधि। |
String | getFastbootProductVariant () फास्टबूट मोड में इस डिवाइस का उत्पाद प्रकार प्राप्त करने की सुविधा विधि। |
String | getFastbootSerialNumber () फास्टबूट मोड सीरियल नंबर लौटाता है। |
String | getFastbootVariable (String variableName) डिवाइस से दिए गए फास्टबूट वैरिएबल मान को पुनः प्राप्त करें। |
String | getFastbootVersion () उपयोग किए जा रहे फास्टबूट बाइनरी का संस्करण स्ट्रिंग लौटाता है। |
IFileEntry | getFileEntry (String path) डिवाइस पर किसी दूरस्थ फ़ाइल का संदर्भ पुनः प्राप्त करें। |
IFileEntry | getFileEntry (FileListingService.FileEntry entry) गैर-रूट पथ से |
getFoldableStates () डिवाइस पर फोल्डेबल स्थितियों की सूची लौटाता है। | |
IDevice | getIDevice () संबंधित ddmlib |
getInstalledPackageNames () डिवाइस पर मौजूद एप्लिकेशन पैकेज नाम प्राप्त करें। | |
long | getIntProperty (String name, long defaultValue) डिवाइस से दी गई संपत्ति का पूर्णांक मान लौटाता है। |
String | getIpAddress () डिवाइस का आईपी पता प्राप्त करता है। |
KeyguardControllerState | getKeyguardState () कीगार्ड की वर्तमान स्थिति प्राप्त करने के लिए ऑब्जेक्ट लौटाएँ या समर्थित न होने पर शून्य कर दें। |
long | getLastExpectedRebootTimeMillis () पिछली बार जब ट्रेडफेड एपीआई ने ईपीओसीएच के बाद से |
int | getLaunchApiLevel () डिवाइस का पहला लॉन्च किया गया एपीआई स्तर प्राप्त करें। |
InputStreamSource | getLogcat () लॉगकैट डेटा का स्नैपशॉट स्ट्रीम पकड़ता है। |
InputStreamSource | getLogcat (int maxBytes) कैप्चर किए गए लॉगकैट डेटा के अंतिम |
InputStreamSource | getLogcatDump () डिवाइस के लिए वर्तमान लॉगकैट का डंप प्राप्त करें। |
InputStreamSource | getLogcatSince (long date) प्रदान की गई तारीख से प्रारंभ करते हुए कैप्चर किए गए लॉगकैट डेटा का एक स्नैपशॉट स्ट्रीम प्राप्त करता है। |
String | getMacAddress () यदि यह डिवाइस से क्वेरी करने में विफल रहता है तो डिवाइस का मैक पता लौटाता है, शून्य। |
Integer | getMainUserId () मुख्य उपयोगकर्ता आईडी लौटाता है. |
getMainlineModuleInfo () डिवाइस पर स्थापित मेनलाइन मॉड्यूल के बारे में जानकारी प्राप्त करें। | |
int | getMaxNumberOfRunningUsersSupported () एक साथ चल रहे समर्थित उपयोगकर्ताओं की अधिकतम संख्या प्राप्त करें। |
int | getMaxNumberOfUsersSupported () समर्थित उपयोगकर्ताओं की अधिकतम संख्या प्राप्त करें. |
Process | getMicrodroidProcess () |
IDeviceStateMonitor | getMonitor () डिवाइस से संबद्ध |
String | getMountPoint (String mountName) एक आरोह बिंदु लौटाता है. |
ITestDevice.MountPointInfo | getMountPointInfo (String mountpoint) निर्दिष्ट माउंटपॉइंट पथ के अनुरूप एक |
getMountPointInfo () डिवाइस पर /proc/mounts में जानकारी का एक पार्स किया गया संस्करण लौटाता है | |
TestDeviceOptions | getOptions () डिवाइस के लिए परीक्षण विकल्प प्राप्त करें। |
long | getPartitionFreeSpace (String partition) डिवाइस विभाजन पर खाली स्थान की मात्रा निर्धारित करने के लिए सहायक विधि। |
Integer | getPrimaryUserId () प्राथमिक उपयोगकर्ता आईडी लौटाता है. |
ProcessInfo | getProcessByName (String processName) हेल्पर विधि "पिडोफ़" और "स्टेट" कमांड चलाती है और पीआईडी के साथ |
String | getProcessPid (String process) यदि कुछ गलत हुआ तो सेवा का पीआईडी लौटाता है या शून्य कर देता है। |
String | getProductType () इस उपकरण का उत्पाद प्रकार प्राप्त करने की सुविधा विधि। |
String | getProductVariant () इस उपकरण का उत्पाद संस्करण प्राप्त करने की सुविधाजनक विधि। |
String | getProperty (String name) डिवाइस से दिए गए संपत्ति मूल्य को पुनः प्राप्त करें। |
ITestDevice.RecoveryMode | getRecoveryMode () डिवाइस के लिए उपयोग किया जाने वाला वर्तमान पुनर्प्राप्ति मोड प्राप्त करें। |
InputStreamSource | getScreenshot (String format) डिवाइस से एक स्क्रीनशॉट लेता है। |
InputStreamSource | getScreenshot (long displayId) डिवाइस द्वारा दी गई डिस्प्ले आईडी से एक स्क्रीनशॉट लेता है। |
InputStreamSource | getScreenshot (String format, boolean rescale) डिवाइस से एक स्क्रीनशॉट लेता है। |
InputStreamSource | getScreenshot () डिवाइस से एक स्क्रीनशॉट लेता है। |
String | getSerialNumber () इस उपकरण का क्रमांक प्राप्त करने की सुविधाजनक विधि। |
String | getSetting (int userId, String namespace, String key) अनुरोधित सेटिंग का मान लौटाएँ। |
String | getSetting (String namespace, String key) |
String | getSimOperator () यदि उपलब्ध नहीं है या डिवाइस उपलब्ध नहीं है तो सिम कार्ड ऑपरेटर को लौटा दें या शून्य कर दें। |
String | getSimState () यदि उपलब्ध नहीं है या डिवाइस उपलब्ध नहीं है तो सिम कार्ड की स्थिति लौटाएँ या शून्य कर दें। |
getTombstones () उपकरणों से समाधि के पत्थरों की सूची प्राप्त करें और लौटाएँ। | |
long | getTotalMemory () आंतरिक त्रुटि के मामले में कुल भौतिक मेमोरी आकार बाइट्स या -1 में लौटाता है |
getUninstallablePackageNames () उन एप्लिकेशन पैकेज नामों को प्राप्त करें जिन्हें अनइंस्टॉल किया जा सकता है। | |
boolean | getUseFastbootErase () जानें कि डिवाइस पर विभाजन को मिटाने के लिए फास्टबूट इरेज़ या फास्टबूट प्रारूप का उपयोग करना है या नहीं। |
int | getUserFlags (int userId) किसी दिए गए उपयोगकर्ता के झंडे ढूंढें और लौटाएं। |
getUserInfos () डिवाइस पर | |
int | getUserSerialNumber (int userId) यदि उपयोगकर्ता आईडी मिलती है तो उससे संबद्ध क्रमांक लौटाएं, अन्य मामलों में -10000। |
IManagedTestDevice.DeviceEventResponse | handleAllocationEvent (DeviceEvent event) दिए गए डिवाइसइवेंट को प्रोसेस करें। डिवाइसइवेंट को संसाधित करें, जो इस डिवाइस को नई आवंटन स्थिति में परिवर्तित कर भी सकता है और नहीं भी। |
boolean | hasFeature (String feature) जांचें कि क्या कोई सुविधा किसी डिवाइस पर उपलब्ध है। |
String | installPackage (File packageFile, boolean reinstall, String... extraArgs) डिवाइस पर एंड्रॉइड पैकेज इंस्टॉल करें। |
String | installPackage (File packageFile, boolean reinstall, boolean grantPermissions, String... extraArgs) डिवाइस पर एंड्रॉइड पैकेज इंस्टॉल करें। |
String | installPackageForUser (File packageFile, boolean reinstall, int userId, String... extraArgs) किसी दिए गए उपयोगकर्ता के लिए डिवाइस पर Android पैकेज इंस्टॉल करें। |
String | installPackageForUser (File packageFile, boolean reinstall, boolean grantPermissions, int userId, String... extraArgs) किसी दिए गए उपयोगकर्ता के लिए डिवाइस पर Android पैकेज इंस्टॉल करें। |
void | invalidatePropertyCache () |
boolean | isAdbRoot () |
boolean | isAdbTcp () |
boolean | isAppEnumerationSupported () जांचें कि डिवाइस पर प्लेटफ़ॉर्म ऐप गणना का समर्थन करता है या नहीं |
boolean | isBypassLowTargetSdkBlockSupported () जांचें कि क्या डिवाइस पर प्लेटफ़ॉर्म ऐप इंस्टॉल पर कम लक्ष्य एसडीके ब्लॉक को बायपास करने का समर्थन करता है |
boolean | isDeviceEncrypted () यदि डिवाइस एन्क्रिप्टेड है तो वापस आ जाता है। |
boolean | isDirectory (String path) यदि डिवाइस पर पथ एक निर्देशिका है तो सही लौटें, अन्यथा गलत लौटें। |
boolean | isEnableAdbRoot () |
boolean | isEncryptionSupported () यदि डिवाइस पर एन्क्रिप्शन समर्थित है तो वापस आ जाता है। |
boolean | isExecutable (String fullPath) यदि डिवाइस पर फ़ाइल पथ एक निष्पादन योग्य फ़ाइल है, तो सत्य लौटाता है, अन्यथा गलत लौटाता है। |
boolean | isFastbootEnabled () यदि डिवाइस के लिए फास्टबूट उपलब्ध है तो वापस लौटें। |
boolean | isHeadless () यदि डिवाइस हेडलेस (कोई स्क्रीन नहीं) है तो सही लौटाएं, अन्यथा गलत लौटाएं। |
boolean | isHeadlessSystemUserMode () यह बताता है कि डिवाइस हेडलेस सिस्टम उपयोगकर्ता मोड का उपयोग करता है या नहीं। |
boolean | isMainUserPermanentAdmin () यह बताता है कि क्या मुख्य उपयोगकर्ता एक स्थायी व्यवस्थापक है और उसे हटाया नहीं जा सकता या उसे गैर-व्यवस्थापक स्थिति में डाउनग्रेड नहीं किया जा सकता। |
boolean | isMultiUserSupported () निर्धारित करता है कि बहु उपयोगकर्ता समर्थित है या नहीं। |
boolean | isPackageInstalled (String packageName, String userId) किसी दिए गए पैकेज नाम और दिए गए उपयोगकर्ता आईडी के लिए डिवाइस को क्वेरी करें ताकि यह जांचा जा सके कि यह वर्तमान में उस उपयोगकर्ता के लिए इंस्टॉल है या नहीं। |
boolean | isPackageInstalled (String packageName) यह जांचने के लिए कि यह वर्तमान में स्थापित है या नहीं, किसी दिए गए पैकेज नाम के लिए डिवाइस को क्वेरी करें। |
boolean | isRuntimePermissionSupported () जांचें कि डिवाइस पर प्लेटफ़ॉर्म रनटाइम अनुमति देने का समर्थन करता है या नहीं |
boolean | isStateBootloaderOrFastbootd () यदि डिवाइस |
boolean | isUserRunning (int userId) जांचें कि क्या कोई दिया गया उपयोगकर्ता चल रहा है। |
boolean | isUserSecondary (int userId) इसके फ़्लैग के अनुसार निर्दिष्ट उपयोगकर्ता द्वितीयक उपयोगकर्ता है या नहीं, यह लौटाएँ। |
boolean | isUserVisible (int userId) जाँचता है कि दिया गया उपयोगकर्ता दृश्यमान है या नहीं। |
boolean | isUserVisibleOnDisplay (int userId, int displayId) जाँचता है कि दिया गया उपयोगकर्ता दिए गए डिस्प्ले में दिखाई दे रहा है या नहीं। |
boolean | isVisibleBackgroundUsersOnDefaultDisplaySupported () यह बताता है कि डिवाइस उपयोगकर्ताओं को |
boolean | isVisibleBackgroundUsersSupported () यह लौटाता है कि डिवाइस उपयोगकर्ताओं को पृष्ठभूमि में दृश्यमान प्रारंभ करने की अनुमति देता है या नहीं। |
boolean | isWifiEnabled () यदि वाईफ़ाई सक्षम है तो परीक्षण करें। |
listDisplayIds () "डंपसिस सर्फेसफ्लिंगर" द्वारा रिपोर्ट की गई डिवाइस पर उपलब्ध डिस्प्ले आईडी की सूची एकत्र करें। | |
listDisplayIdsForStartingVisibleBackgroundUsers () उन डिस्प्ले की सूची प्राप्त करता है जिनका उपयोग | |
listUsers () डिवाइस पर उपयोगकर्ताओं की सूची प्राप्त करता है। | |
boolean | logAnrs ( ITestLogger logger) डिवाइस से ANR एकत्रित और लॉग करें। |
boolean | logBugreport (String dataName, ITestLogger listener) बगरिपोर्ट लेने और उसे पत्रकारों को लॉग करने के लिए सहायक विधि। |
void | logOnDevice (String tag, Log.LogLevel level, String format, Object... args) डिवाइस के लॉगकैट में एक संदेश लॉग करें। |
void | nonBlockingReboot () डिवाइस को रीबूट करने के लिए एक कमांड जारी करता है और कमांड पूरा होने पर और जब डिवाइस एडीबी को दिखाई नहीं देता है तो वापस लौटता है। |
void | postAdbRootAction () यदि डिवाइस को एडीबी रूट के बाद और डिवाइस के वापस ऑनलाइन होने से पहले कुछ विशिष्ट कार्रवाइयां करने की आवश्यकता है तो ओवरराइड करें। |
void | postAdbUnrootAction () यदि एडीबी अनरूट के बाद और डिवाइस के वापस ऑनलाइन होने से पहले डिवाइस को कुछ विशिष्ट कार्रवाई करने की आवश्यकता है तो ओवरराइड करें। |
void | postBootSetup () प्रत्येक बूट के बाद परीक्षण के लिए डिवाइस को कॉन्फ़िगर करने के निर्देशों का पालन करें। |
void | postInvocationTearDown (Throwable exception) डिवाइस विशिष्ट आवश्यक सफ़ाई के लिए अतिरिक्त कदम जिन्हें आह्वान पूरा होने के बाद निष्पादित किया जाएगा। |
void | preInvocationSetup ( IBuildInfo info, MultiMap <String, String> attributes) डिवाइस विशिष्ट आवश्यक सेटअप के लिए अतिरिक्त चरण जिन्हें आमंत्रण प्रवाह से पहले डिवाइस पर निष्पादित किया जाएगा। |
boolean | pullDir (String deviceFilePath, File localDir) डिवाइस से निर्देशिका सामग्री को पुनरावर्ती रूप से खींचें। |
boolean | pullFile (String remoteFilePath, File localFile) डिवाइस से फ़ाइल पुनर्प्राप्त करता है। |
File | pullFile (String remoteFilePath, int userId) डिवाइस से फ़ाइल पुनर्प्राप्त करता है, इसे स्थानीय अस्थायी |
File | pullFile (String remoteFilePath) डिवाइस से फ़ाइल पुनर्प्राप्त करता है, इसे स्थानीय अस्थायी |
boolean | pullFile (String remoteFilePath, File localFile, int userId) डिवाइस से फ़ाइल पुनर्प्राप्त करता है। |
String | pullFileContents (String remoteFilePath) डिवाइस से फ़ाइल पुनर्प्राप्त करता है, और सामग्री लौटाता है। |
File | pullFileFromExternal (String remoteFilePath) डिवाइस के बाहरी स्टोरेज से किसी फ़ाइल को पुनर्प्राप्त करने की एक सुविधाजनक विधि, इसे स्थानीय अस्थायी |
boolean | pushDir (File localFileDir, String deviceFilePath, excludedDirectories) pushDir (File localFileDir, String deviceFilePath, excludedDirectories) फ़िल्टर की गई कुछ निर्देशिकाओं को बाहर करते हुए निर्देशिका सामग्री को डिवाइस पर पुनरावर्ती रूप से पुश करें। |
boolean | pushDir (File localFileDir, String deviceFilePath) डिवाइस पर निर्देशिका सामग्री को पुनरावर्ती रूप से पुश करें। |
boolean | pushFile (File localFile, String remoteFilePath, boolean evaluateContentProviderNeeded) |
boolean | pushFile (File localFile, String remoteFilePath) किसी फ़ाइल को डिवाइस पर पुश करें. |
boolean | pushString (String contents, String remoteFilePath) एक स्ट्रिंग से डिवाइस पर बनाई गई पुश फ़ाइल |
void | reboot (String reason) रिबूट के दौरान दिए गए |
void | reboot () डिवाइस को एडीबी मोड में रीबूट करता है। |
void | rebootIntoBootloader () डिवाइस को बूटलोडर मोड में रीबूट करता है। |
void | rebootIntoFastbootd () डिवाइस को फास्टबूट मोड में रीबूट करता है। |
void | rebootIntoRecovery () डिवाइस को एडीबी रिकवरी मोड में रीबूट करता है। |
void | rebootIntoSideload () डिवाइस को एडीबी साइडलोड मोड में रीबूट करता है (ध्यान दें कि यह रिकवरी के तहत एक विशेष मोड है) डिवाइस साइडलोड मोड में प्रवेश करने तक ब्लॉक रहता है |
void | rebootIntoSideload (boolean autoReboot) डिवाइस को एडीबी साइडलोड मोड में रीबूट करता है (ध्यान दें कि यह रिकवरी के तहत एक विशेष मोड है) डिवाइस साइडलोड मोड में प्रवेश करने तक ब्लॉक रहता है |
void | rebootUntilOnline () |
void | rebootUntilOnline (String reason) |
void | rebootUserspace () डिवाइस के केवल यूजरस्पेस भाग को रीबूट करता है। |
void | rebootUserspaceUntilOnline () |
boolean | recoverDevice () डिवाइस संचार पुनर्प्राप्त करने का प्रयास। |
void | registerDeviceActionReceiver ( IDeviceActionReceiver deviceActionReceiver) इस डिवाइस के लिए एक |
void | remountSystemReadOnly () डिवाइस पर सिस्टम विभाजन को केवल पढ़ने योग्य बनाएं। |
void | remountSystemWritable () डिवाइस पर सिस्टम विभाजन को लिखने योग्य बनाएं। |
void | remountVendorReadOnly () डिवाइस पर विक्रेता विभाजन को केवल पढ़ने के लिए बनाएं। |
void | remountVendorWritable () डिवाइस पर विक्रेता विभाजन को लिखने योग्य बनाएं। |
boolean | removeAdmin (String componentName, int userId) दिए गए उपयोगकर्ता में दिए गए डिवाइस एडमिन को हटाएं और सफल होने पर |
void | removeOwners () सर्वोत्तम प्रयास से सभी मौजूदा डिवाइस प्रोफ़ाइल स्वामियों को हटा दें। |
boolean | removeUser (int userId) किसी दिए गए उपयोगकर्ता को डिवाइस से निकालें. |
void | resetContentProviderSetup () सामग्री प्रदाता सेटअप को फिर से ट्रिगर करने के लिए ध्वज को रीसेट करें। |
boolean | runInstrumentationTests (IRemoteAndroidTestRunner runner, ITestLifeCycleReceiver... listeners) पैरामीटर के रूप में पारित एक या अधिक श्रोताओं के साथ |
boolean | runInstrumentationTests (IRemoteAndroidTestRunner runner, listeners) runInstrumentationTests (IRemoteAndroidTestRunner runner, listeners) इंस्ट्रुमेंटेशन परीक्षण चलाता है, और डिवाइस पुनर्प्राप्ति प्रदान करता है। |
boolean | runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, listeners) runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, listeners) |
boolean | runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, ITestLifeCycleReceiver... listeners) |
void | setConfiguration ( IConfiguration configuration) उपयोग में आने वाले |
final void | setConnectionAvdInfo ( GceAvdInfo avdInfo) |
void | setDate (Date date) डिवाइस पर दिनांक सेट करता है नोट: डिवाइस पर दिनांक सेट करने के लिए रूट की आवश्यकता होती है |
boolean | setDeviceOwner (String componentName, int userId) दिए गए उपयोगकर्ता में डिवाइस व्यवस्थापक घटक को डिवाइस स्वामी के रूप में सेट करें। |
void | setDeviceState ( TestDeviceState deviceState) डिवाइस की स्थिति अपडेट करें. |
void | setEmulatorOutputStream ( SizeLimitedOutputStream output) एमुलेटर के लिए आउटपुट लॉग करने के लिए |
void | setEmulatorProcess (Process p) |
void | setFastbootEnabled (boolean fastbootEnabled) डिवाइस के लिए फास्टबूट विकल्प सेट करें। |
void | setFastbootPath (String fastbootPath) फास्टबूट बाइनरी के लिए पथ सेट करता है जिसका उपयोग किया जाना चाहिए। |
void | setIDevice (IDevice newDevice) इस ITestDevice से संबद्ध IDevice को अपडेट करें। |
void | setLogStartDelay (int delay) ऑनलाइन डिवाइस के लिए लॉगकैट कैप्चर शुरू करने से पहले प्रतीक्षा करने के लिए एमएस में समय निर्धारित करता है। |
void | setOptions ( TestDeviceOptions options) डिवाइस के लिए |
boolean | setProperty (String propKey, String propValue) डिवाइस पर दिए गए प्रॉपर्टी मान को सेट करता है। |
void | setRecovery ( IDeviceRecovery recovery) इस डिवाइस के लिए उपयोग करने के लिए |
void | setRecoveryMode ( ITestDevice.RecoveryMode mode) डिवाइस के लिए उपयोग करने के लिए वर्तमान पुनर्प्राप्ति मोड सेट करें। |
void | setSetting (String namespace, String key, String value) |
void | setSetting (int userId, String namespace, String key, String value) किसी दिए गए उपयोगकर्ता के नामस्थान में एक सेटिंग मान जोड़ें। |
void | setTestLogger ( ITestLogger testLogger) |
void | setUseFastbootErase (boolean useFastbootErase) सेट करें कि डिवाइस पर किसी पार्टीशन को वाइप करने के लिए फास्टबूट इरेज़ या फास्टबूट फॉर्मेट का उपयोग करना है या नहीं। |
void | startLogcat () पृष्ठभूमि में डिवाइस से लॉगकैट आउटपुट कैप्चर करना प्रारंभ करें। |
boolean | startUser (int userId) किसी दिए गए उपयोगकर्ता को पृष्ठभूमि में प्रारंभ करता है यदि वह वर्तमान में बंद है। |
boolean | startUser (int userId, boolean waitFlag) किसी दिए गए उपयोगकर्ता को पृष्ठभूमि में प्रारंभ करता है यदि वह वर्तमान में बंद है। |
boolean | startVisibleBackgroundUser (int userId, int displayId, boolean waitFlag) किसी दिए गए उपयोगकर्ता को पृष्ठभूमि में प्रारंभ करता है, जो दिए गए डिस्प्ले में दिखाई देता है (यानी, उपयोगकर्ता को उस डिस्प्ले में गतिविधियों को लॉन्च करने की अनुमति देता है)। |
void | stopEmulatorOutput () एम्यूलेटर आउटपुट को बंद करें और हटाएं। |
void | stopLogcat () डिवाइस से लॉगकैट आउटपुट कैप्चर करना बंद करें, और वर्तमान में सहेजे गए लॉगकैट डेटा को हटा दें। |
boolean | stopUser (int userId) किसी दिए गए उपयोगकर्ता को रोकता है. |
boolean | stopUser (int userId, boolean waitFlag, boolean forceFlag) किसी दिए गए उपयोगकर्ता को रोकें. |
String | switchToAdbTcp () डिवाइस को एडीबी-ओवर-टीसीपी मोड पर स्विच करें। |
boolean | switchToAdbUsb () डिवाइस को यूएसबी मोड के बजाय एडीबी पर स्विच करें। |
boolean | switchUser (int userId) डिफ़ॉल्ट टाइमआउट के साथ किसी अन्य उपयोगकर्ता आईडी पर स्विच करें। |
boolean | switchUser (int userId, long timeout) समय सीमा के रूप में दिए गए टाइमआउट के साथ किसी अन्य उपयोगकर्ता आईडी पर स्विच करें। |
boolean | syncFiles (File localFileDir, String deviceFilePath) स्थानीय फ़ाइल निर्देशिका की सामग्री को डिवाइस के साथ क्रमिक रूप से समन्वयित करता है। |
Bugreport | takeBugreport () एक बग्रेपोर्ट लें और इसे संभालने के लिए इसे |
String | uninstallPackage (String packageName) डिवाइस से एंड्रॉइड पैकेज अनइंस्टॉल करें। |
String | uninstallPackageForUser (String packageName, int userId) किसी दिए गए उपयोगकर्ता के लिए डिवाइस से Android पैकेज अनइंस्टॉल करें। |
boolean | unlockDevice () यदि डिवाइस एन्क्रिप्टेड स्थिति में है तो डिवाइस को अनलॉक कर देता है। |
boolean | waitForBootComplete (long timeOut) डिवाइस का बूट पूर्ण फ़्लैग सेट होने तक ब्लॉक रहता है। |
boolean | waitForDeviceAvailable () डिवाइस के प्रतिक्रियाशील होने और परीक्षण के लिए उपलब्ध होने की प्रतीक्षा करता है। |
boolean | waitForDeviceAvailable (long waitTime) डिवाइस के प्रतिक्रियाशील होने और परीक्षण के लिए उपलब्ध होने की प्रतीक्षा करता है। |
boolean | waitForDeviceAvailableInRecoverPath (long waitTime) पुनर्प्राप्ति पथ पर विचार किए बिना डिवाइस के प्रतिक्रियाशील और उपलब्ध होने की प्रतीक्षा करता है। |
void | waitForDeviceBootloader () फास्टबूट के माध्यम से डिवाइस दिखाई देने तक ब्लॉक रहता है। |
boolean | waitForDeviceInRecovery (long waitTime) डिवाइस के 'एडीबी रिकवरी' स्थिति में होने के लिए ब्लॉक (ध्यान दें कि यह |
boolean | waitForDeviceInSideload (long waitTime) डिवाइस को 'एडीबी साइडलोड' स्थिति में रखने के लिए ब्लॉक |
boolean | waitForDeviceNotAvailable (long waitTime) डिवाइस के लिए ब्लॉक उपलब्ध नहीं होना यानी एडीबी से गायब होना |
void | waitForDeviceOnline () जब तक डिवाइस एडीबी के माध्यम से दिखाई न दे तब तक ब्लॉक रहता है। |
void | waitForDeviceOnline (long waitTime) जब तक डिवाइस एडीबी के माध्यम से दिखाई न दे तब तक ब्लॉक रहता है। |
boolean | waitForDeviceShell (long waitTime) डिवाइस के मूल एडीबी शेल कमांड के प्रति प्रतिक्रियाशील होने की प्रतीक्षा करता है। |
संरक्षित तरीके | |
---|---|
void | addExtraConnectionBuilderArgs ( DefaultConnection.ConnectionBuilder builder) |
String[] | buildAdbShellCommand (String command, boolean forceExitStatusDetection) दिए गए एडीबी शेल कमांड सत्र और आर्ग्स के लिए ओएस कमांड बनाता है |
void | checkApiLevelAgainst (String feature, int strictMinLevel) |
NativeDevice.RebootDeviceAction | createRebootDeviceAction ( NativeDevice.RebootMode rebootMode, String reason) रीबूट कार्रवाई करते समय उपयोग करने के लिए एक |
IRunUtil | createRunUtil () |
void | doAdbReboot ( NativeDevice.RebootMode rebootMode, String reason) एडीबी रीबूट करें। |
void | ensureRuntimePermissionSupported () यदि रनटाइम अनुमति समर्थित नहीं है तो अपवाद फेंकने की सहायक विधि |
int | getApiLevelSafe () |
ITestLogger | getLogger () |
IRunUtil | getRunUtil () उपयोग करने के लिए |
void | initializeConnection ( IBuildInfo info, MultiMap <String, String> attributes) |
String | internalGetProperty (String propName, String fastbootVar, String description) डिफ़ॉल्ट रूप से ddmlib कैश से एक डिवाइस प्रॉपर्टी प्राप्त करें, और डिवाइस फास्टबूट में है या नहीं, इस पर निर्भर करते हुए या तो `एडीबी शेल गेटप्रॉप` या `फास्टबूट गेटवर` पर वापस आ जाएगा। |
boolean | isInRebootCallback () यह बताता है कि रिबूट कॉलबैक वर्तमान में निष्पादित हो रहा है या नहीं। |
boolean | isNewer (File localFile, IFileEntry entry) यदि स्थानीय फ़ाइल दूरस्थ फ़ाइल से नई है तो |
void | notifyRebootEnded () रिबूट समाप्ति घटना के बारे में सभी |
void | notifyRebootStarted () रिबूट प्रारंभ घटना के बारे में सभी |
boolean | performDeviceAction (String actionDescription, NativeDevice.DeviceAction action, int retryAttempts) इस डिवाइस पर एक क्रिया निष्पादित करता है. |
void | postAdbReboot () संभावित अतिरिक्त कार्रवाइयां जो रीबूट के बाद की जा सकती हैं। |
void | prePostBootSetup () प्रत्येक डिवाइस प्रकार (AndroidNativeDevice, TestDevice) को विशिष्ट पोस्ट बूट सेटअप के लिए इस विधि को ओवरराइड करने की अनुमति देता है। |
boolean | pullFileInternal (String remoteFilePath, File localFile) |
void | setClock (Clock clock) उपयोग के लिए क्लॉक इंस्टेंस सेट करें। |
void | setMicrodroidProcess (Process process) TestDevice को माइक्रोड्रॉइड के रूप में चिह्नित करता है और इसकी CID सेट करता है। |
void | setTestDeviceOptions ( deviceOptions) setTestDeviceOptions ( deviceOptions) |
CommandResult | simpleFastbootCommand (long timeout, envVarMap, String[] fullCmd) simpleFastbootCommand (long timeout, envVarMap, String[] fullCmd) पर्यावरण चर के साथ एक सरल फास्टबूट कमांड निष्पादित करता है और कमांड की स्थिति की रिपोर्ट करता है। |
CommandResult | simpleFastbootCommand (long timeout, String[] fullCmd) एक सरल फास्टबूट कमांड निष्पादित करता है और कमांड की स्थिति की रिपोर्ट करता है। |
boolean | waitForDeviceNotAvailable (String operationDesc, long time) डिवाइस के अनुपलब्ध होने की प्रतीक्षा करें (एडीबी को रिपोर्ट करना बंद करें)। |
स्थिरांक
अमान्य उपयोगकर्ता आइ डी
public static final int INVALID_USER_ID
किसी भी अमान्य/नहीं मिली उपयोगकर्ता आईडी के लिए लौटाया गया मान: UserHandle ने -10000 मान परिभाषित किया
स्थिर मान: -10000 (0xffffd8f0)
MAX_HOST_DEVICE_TIME_OFFSET
protected static final long MAX_HOST_DEVICE_TIME_OFFSET
स्थिर मान: 5000 (0x000000000001388)
MAX_RETRY_ATTEMPTS
protected static final int MAX_RETRY_ATTEMPTS
कमांड पुनः प्रयास करने के प्रयासों की डिफ़ॉल्ट संख्या
स्थिर मान: 2 (0x00000002)
खेत
एसडी कार्ड
protected static final String SD_CARD
भंडारण_अनुकरणित
protected static final String STORAGE_EMULATED
विकल्प
protected TestDeviceOptions mOptions
सार्वजनिक निर्माणकर्ता
नेटिवडिवाइस
public NativeDevice (IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)
एक TestDevice
बनाता है।
पैरामीटर | |
---|---|
device | IDevice : संबंधित IDevice |
stateMonitor | IDeviceStateMonitor : उपयोग करने के लिए IDeviceStateMonitor तंत्र |
allocationMonitor | IDeviceMonitor : आवंटन स्थिति में परिवर्तन की सूचना देने के लिए IDeviceMonitor । शून्य हो सकता है |
सार्वजनिक तरीके
बैचप्रीफेचस्टार्टअपबिल्डप्रॉप्स
public void batchPrefetchStartupBuildProps ()
सूक्ष्म अनुकूलन (लगभग 400 मिली) प्रत्येक प्रॉप्स के लिए 'एडीबी गेटप्रॉप' को कॉल करने के बजाय हमें आवश्यक सभी प्रॉप्स को प्रीफ़ेच करके। यानी यह सभी संपत्तियों को लाने में उतना ही तेज़ है जितना कि किसी एक को लाने में। डिवाइस.getApiLevel(), checkApiLevelAgainstNextRelease और getBuildAlias जैसी चीज़ें हुड के नीचे `adb getprop` कहती हैं। हम उन्हें एक कॉल में लाते हैं और NativeDevice.setProperty को कॉल करते हैं। भले ही हम ऐसा न करें, NativeDevice स्वयं setProperty को कॉल करेगा और भविष्य की कॉल के लिए परिणाम को कैश करेगा। हम इसे थोड़ा पहले ही कर रहे हैं। यदि डिवाइस पुनर्प्राप्ति में है या प्रॉप्स लाने में अन्य त्रुटियां हैं, तो हम उन्हें अनदेखा कर देते हैं।
canSwitchToHeadlessSystemUser
public boolean canSwitchToHeadlessSystemUser ()
यह बताता है कि क्या इसे हेडलेस सिस्टम उपयोगकर्ता पर स्विच करने की अनुमति है।
रिटर्न | |
---|---|
boolean |
फेंकता | |
---|---|
DeviceNotAvailableException |
ApiLevelAgainstNextRelease को चेक करें
public boolean checkApiLevelAgainstNextRelease (int strictMinLevel)
न्यूनतम समर्थित स्तर पर जांचें कि कोई सुविधा वर्तमान में समर्थित है या नहीं। एपीआई स्तर बढ़ाए जाने से पहले, यह विधि अभी तक अप्रकाशित सुविधाओं को ध्यान में रखती है।
पैरामीटर | |
---|---|
strictMinLevel | int : सख्त न्यूनतम संभव स्तर जो सुविधा का समर्थन करता है। |
रिटर्न | |
---|---|
boolean | यदि स्तर समर्थित है तो सत्य है। अन्यथा मिथ्या। |
फेंकता | |
---|---|
DeviceNotAvailableException |
कनेक्टिविटी की जाँच करें
public boolean checkConnectivity ()
जांचें कि डिवाइस में नेटवर्क कनेक्टिविटी है या नहीं।
रिटर्न | |
---|---|
boolean | यदि डिवाइस में कार्यशील नेटवर्क कनेक्शन है तो true , अन्यथा false । |
फेंकता | |
---|---|
DeviceNotAvailableException |
क्लियरएररडायलॉग्स
public boolean clearErrorDialogs ()
डिवाइस यूआई पर वर्तमान में प्रदर्शित किसी भी त्रुटि संवाद को खारिज करने का प्रयास करें।
रिटर्न | |
---|---|
boolean | यदि कोई संवाद मौजूद नहीं था या संवाद सफलतापूर्वक साफ़ कर दिए गए थे तो true । अन्यथा false । |
फेंकता | |
---|---|
DeviceNotAvailableException |
ClearLastConnectedWifiNetwork
public void clearLastConnectedWifiNetwork ()
अंतिम कनेक्टेड वाईफाई नेटवर्क को साफ़ करता है। डिवाइस रीबूट के बाद पिछले परीक्षण में उपयोग किए गए वाईफाई नेटवर्क से कनेक्ट होने से बचने के लिए नया इनवोकेशन शुरू करते समय इसे कॉल किया जाना चाहिए।
क्लियरलॉगकैट
public void clearLogcat ()
किसी भी संचित लॉगकैट डेटा को हटा देता है।
यह उन मामलों के लिए उपयोगी है जब आप यह सुनिश्चित करना चाहते हैं किITestDevice#getLogcat()
केवल एक निश्चित बिंदु के बाद उत्पन्न लॉग डेटा लौटाता है (जैसे कि एक नए डिवाइस बिल्ड को फ्लैश करने के बाद, आदि)। कनेक्टटूवाईफ़ाईनेटवर्क
public boolean connectToWifiNetwork (wifiSsidToPsk, boolean scanSsid)
वाईफ़ाई नेटवर्क से कनेक्ट होता है.
वाईफाई चालू करता है और तब तक ब्लॉक करता है जब तक कि wifiSsidToPsk मैप में दिए गए वाईफाई नेटवर्क में से किसी एक के साथ सफल कनेक्शन नहीं हो जाता। एक बार कनेक्शन बन जाने के बाद, इंस्टेंस प्रत्येक रीबूट के बाद कनेक्शन को पुनर्स्थापित करने का प्रयास करेगा जब तक कि ITestDevice#disconnectFromWifi()
या ITestDevice#clearLastConnectedWifiNetwork()
को कॉल न किया जाए।
पैरामीटर | |
---|---|
wifiSsidToPsk | |
scanSsid | boolean : क्या इस नेटवर्क के लिए छिपे हुए एसएसआईडी को स्कैन करना है। |
रिटर्न | |
---|---|
boolean | यदि वाईफ़ाई नेटवर्क से सफलतापूर्वक कनेक्ट किया गया है तो true । अन्यथा false |
फेंकता | |
---|---|
DeviceNotAvailableException |
कनेक्टटूवाईफ़ाईनेटवर्क
public boolean connectToWifiNetwork (String wifiSsid, String wifiPsk)
वाईफ़ाई नेटवर्क से कनेक्ट होता है.
निर्दिष्ट वाईफाई नेटवर्क से सफल कनेक्शन होने तक वाईफाई चालू करता है और ब्लॉक करता है। एक बार कनेक्शन बन जाने के बाद, इंस्टेंस प्रत्येक रीबूट के बाद कनेक्शन को पुनर्स्थापित करने का प्रयास करेगा जब तक किITestDevice#disconnectFromWifi()
या ITestDevice#clearLastConnectedWifiNetwork()
को कॉल न किया जाए।पैरामीटर | |
---|---|
wifiSsid | String : कनेक्ट करने के लिए वाईफ़ाई एसएसआईडी |
wifiPsk | String : पीएसके पासफ़्रेज़ या अनएन्क्रिप्टेड होने पर शून्य |
रिटर्न | |
---|---|
boolean | यदि वाईफ़ाई नेटवर्क से सफलतापूर्वक कनेक्ट किया गया है तो true । अन्यथा false |
फेंकता | |
---|---|
DeviceNotAvailableException |
कनेक्टटूवाईफ़ाईनेटवर्क
public boolean connectToWifiNetwork (wifiSsidToPsk)
वाईफ़ाई नेटवर्क से कनेक्ट होता है.
वाईफाई चालू करता है और तब तक ब्लॉक करता है जब तक कि wifiSsidToPsk मैप में दिए गए वाईफाई नेटवर्क में से किसी एक के साथ सफल कनेक्शन नहीं हो जाता। एक बार कनेक्शन बन जाने के बाद, इंस्टेंस प्रत्येक रीबूट के बाद कनेक्शन को पुनर्स्थापित करने का प्रयास करेगा जब तक कि ITestDevice#disconnectFromWifi()
या ITestDevice#clearLastConnectedWifiNetwork()
को कॉल न किया जाए।
पैरामीटर | |
---|---|
wifiSsidToPsk |
रिटर्न | |
---|---|
boolean | यदि वाईफ़ाई नेटवर्क से सफलतापूर्वक कनेक्ट किया गया है तो true । अन्यथा false |
फेंकता | |
---|---|
DeviceNotAvailableException |
कनेक्टटूवाईफ़ाईनेटवर्क
public boolean connectToWifiNetwork (String wifiSsid, String wifiPsk, boolean scanSsid)
वाईफ़ाई नेटवर्क से कनेक्ट होता है.
निर्दिष्ट वाईफाई नेटवर्क से सफल कनेक्शन होने तक वाईफाई चालू करता है और ब्लॉक करता है। एक बार कनेक्शन बन जाने के बाद, इंस्टेंस प्रत्येक रीबूट के बाद कनेक्शन को पुनर्स्थापित करने का प्रयास करेगा जब तक किITestDevice#disconnectFromWifi()
या ITestDevice#clearLastConnectedWifiNetwork()
को कॉल न किया जाए।पैरामीटर | |
---|---|
wifiSsid | String : कनेक्ट करने के लिए वाईफ़ाई एसएसआईडी |
wifiPsk | String : पीएसके पासफ़्रेज़ या अनएन्क्रिप्टेड होने पर शून्य |
scanSsid | boolean : क्या इस नेटवर्क के लिए छिपे हुए एसएसआईडी को स्कैन करना है। |
रिटर्न | |
---|---|
boolean | यदि वाईफ़ाई नेटवर्क से सफलतापूर्वक कनेक्ट किया गया है तो true । अन्यथा false |
फेंकता | |
---|---|
DeviceNotAvailableException |
कनेक्टटूवाईफाईनेटवर्कइफ नीडेड
public boolean connectToWifiNetworkIfNeeded (String wifiSsid, String wifiPsk, boolean scanSsid)
connectToWifiNetwork(String, String)
का एक प्रकार जो केवल तभी कनेक्ट होता है जब डिवाइस में वर्तमान में नेटवर्क कनेक्टिविटी नहीं है।
पैरामीटर | |
---|---|
scanSsid | boolean : क्या इस नेटवर्क के लिए छिपे हुए एसएसआईडी को स्कैन करना है |
रिटर्न | |
---|---|
boolean | यदि वाईफ़ाई नेटवर्क से सफलतापूर्वक कनेक्ट किया गया है तो true । अन्यथा false |
फेंकता | |
---|---|
DeviceNotAvailableException |
कनेक्टटूवाईफाईनेटवर्कइफ नीडेड
public boolean connectToWifiNetworkIfNeeded (String wifiSsid, String wifiPsk)
connectToWifiNetwork(String, String)
का एक प्रकार जो केवल तभी कनेक्ट होता है जब डिवाइस में वर्तमान में नेटवर्क कनेक्टिविटी नहीं है।
रिटर्न | |
---|---|
boolean | यदि वाईफ़ाई नेटवर्क से सफलतापूर्वक कनेक्ट किया गया है तो true । अन्यथा false |
फेंकता | |
---|---|
DeviceNotAvailableException |
उपयोगकर्ता बनाइये
public int createUser (String name, boolean guest, boolean ephemeral)
दिए गए नाम और दिए गए फ़्लैग के साथ एक उपयोगकर्ता बनाएं
पैरामीटर | |
---|---|
name | String : डिवाइस पर बनाने के लिए उपयोगकर्ता की |
guest | boolean : निर्माण के दौरान उपयोगकर्ता ध्वज --अतिथि को सक्षम करें |
ephemeral | boolean : निर्माण के दौरान उपयोगकर्ता ध्वज --क्षणिक सक्षम करें |
रिटर्न | |
---|---|
int | बनाए गए उपयोगकर्ता की आईडी |
फेंकता | |
---|---|
DeviceNotAvailableException |
उपयोगकर्ता बनाइये
public int createUser (String name, boolean guest, boolean ephemeral, boolean forTesting)
दिए गए नाम और दिए गए फ़्लैग के साथ एक उपयोगकर्ता बनाएं
पैरामीटर | |
---|---|
name | String : डिवाइस पर बनाने के लिए उपयोगकर्ता की |
guest | boolean : निर्माण के दौरान उपयोगकर्ता ध्वज --अतिथि को सक्षम करें |
ephemeral | boolean : निर्माण के दौरान उपयोगकर्ता ध्वज --क्षणिक सक्षम करें |
forTesting | boolean : निर्माण के दौरान परीक्षण के लिए परीक्षण ध्वज को सक्षम करें |
रिटर्न | |
---|---|
int | बनाए गए उपयोगकर्ता की आईडी |
फेंकता | |
---|---|
DeviceNotAvailableException |
उपयोगकर्ता बनाइये
public int createUser (String name)
दिए गए नाम और डिफ़ॉल्ट फ़्लैग 0 के साथ एक उपयोगकर्ता बनाएं।
पैरामीटर | |
---|---|
name | String : डिवाइस पर बनाने के लिए उपयोगकर्ता की |
रिटर्न | |
---|---|
int | उपयोगकर्ता आईडी के लिए पूर्णांक बनाया गया |
फेंकता | |
---|---|
DeviceNotAvailableException |
createUserNoThrow
public int createUserNoThrow (String name)
दिए गए नाम और डिफ़ॉल्ट फ़्लैग 0 के साथ एक उपयोगकर्ता बनाएं।
पैरामीटर | |
---|---|
name | String : डिवाइस पर बनाने के लिए उपयोगकर्ता की |
रिटर्न | |
---|---|
int | बनाई गई उपयोगकर्ता आईडी के लिए पूर्णांक या त्रुटि के लिए -1। |
फेंकता | |
---|---|
DeviceNotAvailableException |
फ़ाइल नष्ट करें
public void deleteFile (String deviceFilePath)
डिवाइस पर किसी फ़ाइल या निर्देशिका को हटाने के लिए सहायक विधि।
पैरामीटर | |
---|---|
deviceFilePath | String : डिवाइस पर फ़ाइल का पूर्ण पथ। |
फेंकता | |
---|---|
DeviceNotAvailableException |
डीरजिस्टरडिवाइसएक्शनरिसीवर
public void deregisterDeviceActionReceiver (IDeviceActionReceiver deviceActionReceiver)
पंजीकृत IDeviceActionReceiver
हटा देता है।
पैरामीटर | |
---|---|
deviceActionReceiver | IDeviceActionReceiver : एक IDeviceActionReceiver जिसे हटा दिया जाएगा। |
डिवाइससॉफ्टरीस्टार्ट
public boolean deviceSoftRestarted (ProcessInfo prevSystemServerProcess)
वर्तमान system_server की पिछले system_server ProcessInfo
से तुलना करके यह जांचने के लिए सहायक विधि कि डिवाइस सॉफ्ट-रीस्टार्ट हुआ है या नहीं। ProcessInfo
प्राप्त करने के लिए getProcessByName(String)
का उपयोग करें।
पैरामीटर | |
---|---|
prevSystemServerProcess | ProcessInfo : पिछली सिस्टम_सर्वर प्रक्रिया ProcessInfo । |
रिटर्न | |
---|---|
boolean | यदि डिवाइस सॉफ़्ट-रीस्टार्ट हुआ तो true |
फेंकता | |
---|---|
DeviceNotAvailableException |
डिवाइससॉफ्टRestartedSince
public boolean deviceSoftRestartedSince (long utcEpochTime, TimeUnit timeUnit)
यह जांचने के लिए सहायक विधि कि डिवाइस और उसके ERROR(/TimeUnit)
से यूटीसी समय के बाद से डिवाइस सॉफ्ट-रीस्टार्ट हुआ है या नहीं। सॉफ्ट-रीस्टार्ट से तात्पर्य डिवाइस के हार्ड रीबूट के बाहर सिस्टम_सर्वर को रीस्टार्ट करने से है (उदाहरण के लिए: रिबूट का अनुरोध किया गया)। milliseccond में वर्तमान डिवाइस utcEpochTime को getDeviceDate()
विधि द्वारा प्राप्त किया जा सकता है।
पैरामीटर | |
---|---|
utcEpochTime | long : युग के बाद से दूसरे में डिवाइस का समय। |
timeUnit | TimeUnit : दिए गए utcEpochTime के लिए समय इकाई TimeUnit । |
रिटर्न | |
---|---|
boolean | यदि डिवाइस सॉफ़्ट-रीस्टार्ट हुआ तो true |
फेंकता | |
---|---|
DeviceNotAvailableException |
AdbRoot को अक्षम करें
public boolean disableAdbRoot ()
एडीबी रूट को बंद कर देता है।
एडीबी रूट को अक्षम करने से डिवाइस एडीबी से डिस्कनेक्ट हो सकता है। डिवाइस उपलब्ध होने तक यह विधि ब्लॉक रहेगी.रिटर्न | |
---|---|
boolean | यदि सफल हो तो true । |
फेंकता | |
---|---|
DeviceNotAvailableException |
कुंजीगार्ड अक्षम करें
public void disableKeyguard ()
कीगार्ड को निष्क्रिय करने का प्रयास.
पहले इनपुट प्रेषण के तैयार होने की प्रतीक्षा करें, यह लगभग उसी समय होता है जब डिवाइस BOOT_COMPLETE की रिपोर्ट करता है, जाहिरा तौर पर अतुल्यकालिक रूप से, क्योंकि वर्तमान ढांचे के कार्यान्वयन में कभी-कभी दौड़ की स्थिति होती है। फिर कीगार्ड को बर्खास्त करने के लिए कमांड भेजा जाता है (केवल गैर-सुरक्षित पर काम करता है)
फेंकता | |
---|---|
DeviceNotAvailableException |
नेटवर्क मॉनिटर को अक्षम करें
public boolean disableNetworkMonitor ()
डिवाइस पर नेटवर्क मॉनिटरिंग अक्षम करता है।
रिटर्न | |
---|---|
boolean | यदि मॉनिटरिंग सफलतापूर्वक अक्षम कर दी गई है तो true । यदि यह असफल हुआ तो false । |
फेंकता | |
---|---|
DeviceNotAvailableException |
वाईफाई से डिस्कनेक्ट करें
public boolean disconnectFromWifi ()
वाईफ़ाई नेटवर्क से डिस्कनेक्ट हो जाता है।
ज्ञात नेटवर्क सूची से सभी नेटवर्क हटा देता है और वाईफाई अक्षम कर देता है।रिटर्न | |
---|---|
boolean | यदि वाईफ़ाई नेटवर्क से सफलतापूर्वक डिस्कनेक्ट किया गया है तो true । यदि डिस्कनेक्ट विफल हो गया तो false । |
फेंकता | |
---|---|
DeviceNotAvailableException |
फ़ाइल अस्तित्व में है
public boolean doesFileExist (String deviceFilePath, int userId)
यह निर्धारित करने के लिए सहायक विधि कि डिवाइस पर फ़ाइल किसी दिए गए उपयोगकर्ता के लिए मौजूद है या नहीं।
पैरामीटर | |
---|---|
deviceFilePath | String : जांचने के लिए डिवाइस पर फ़ाइल का पूर्ण पथ |
userId | int : उपयोगकर्ता आईडी जिसके विरुद्ध फ़ाइल अस्तित्व की जांच करनी है |
रिटर्न | |
---|---|
boolean | यदि फ़ाइल मौजूद है तो true , अन्यथा false । |
फेंकता | |
---|---|
DeviceNotAvailableException |
फ़ाइल अस्तित्व में है
public boolean doesFileExist (String deviceFilePath)
डिवाइस पर फ़ाइल मौजूद है या नहीं यह निर्धारित करने के लिए सहायक विधि।
पैरामीटर | |
---|---|
deviceFilePath | String : जांचने के लिए डिवाइस पर फ़ाइल का पूर्ण पथ |
रिटर्न | |
---|---|
boolean | यदि फ़ाइल मौजूद है तो true , अन्यथा false । |
फेंकता | |
---|---|
DeviceNotAvailableException |
डंपहीप
public File dumpHeap (String process, String devicePath)
System_server से ढेर को डंप करने का प्रयास करें। डंप की गई फ़ाइल को साफ़ करना कॉल करने वाले की ज़िम्मेदारी है।
पैरामीटर | |
---|---|
process | String : डंपहीप ऑन करने के लिए डिवाइस प्रक्रिया का नाम। |
devicePath | String : डिवाइस पर वह पथ जहां डंप डालना है। यह एक ऐसा स्थान होना चाहिए जहाँ अनुमतियाँ इसकी अनुमति देती हों। |
रिटर्न | |
---|---|
File | रिपोर्ट वाली ERROR(/File) । यदि कुछ विफल हुआ तो शून्य. |
फेंकता | |
---|---|
DeviceNotAvailableException |
EnableAdbRoot
public boolean enableAdbRoot ()
एडीबी रूट चालू करता है। यदि "सक्षम-रूट" सेटिंग "गलत" है, तो एक संदेश लॉग हो जाएगा और रूट सक्षम किए बिना वापस आ जाएगा।
एडीबी रूट को सक्षम करने से डिवाइस एडीबी से डिस्कनेक्ट हो सकता है। डिवाइस उपलब्ध होने तक यह विधि ब्लॉक रहेगी.रिटर्न | |
---|---|
boolean | यदि सफल हो तो true । |
फेंकता | |
---|---|
DeviceNotAvailableException |
EnableNetworkMonitor
public boolean enableNetworkMonitor ()
डिवाइस पर नेटवर्क मॉनिटरिंग सक्षम करता है।
रिटर्न | |
---|---|
boolean | यदि निगरानी सफलतापूर्वक सक्षम है तो true । यदि यह असफल हुआ तो false । |
फेंकता | |
---|---|
DeviceNotAvailableException |
निष्पादितएडीबीकमांड
public String executeAdbCommand (long timeout, String... cmdArgs)
हेल्पर विधि जो एक एडीबी कमांड को एक निर्दिष्ट टाइमआउट के साथ सिस्टम कमांड के रूप में निष्पादित करती है।
जहां भी संभव हो, executeShellCommand(String)
उपयोग किया जाना चाहिए, क्योंकि यह विधि बेहतर विफलता का पता लगाने और प्रदर्शन प्रदान करती है।
पैरामीटर | |
---|---|
timeout | long : डिवाइस से पहले मिलीसेकंड में समय को अनुत्तरदायी माना जाता है, बिना किसी टाइमआउट के 0L |
cmdArgs | String : एडीबी कमांड और चलाने के लिए तर्क |
रिटर्न | |
---|---|
String | कमांड से स्टडआउट। यदि आदेश निष्पादित करने में विफल रहा तो null । |
फेंकता | |
---|---|
DeviceNotAvailableException |
निष्पादितएडीबीकमांड
public String executeAdbCommand (long timeout,envMap, String... cmdArgs)
हेल्पर विधि जो एक एडीबी कमांड को एक निर्दिष्ट टाइमआउट के साथ सिस्टम कमांड के रूप में निष्पादित करती है।
जहां भी संभव हो, executeShellCommand(String)
उपयोग किया जाना चाहिए, क्योंकि यह विधि बेहतर विफलता का पता लगाने और प्रदर्शन प्रदान करती है।
पैरामीटर | |
---|---|
timeout | long : डिवाइस से पहले मिलीसेकंड में समय को अनुत्तरदायी माना जाता है, बिना किसी टाइमआउट के 0L |
envMap | |
cmdArgs | String : एडीबी कमांड और चलाने के लिए तर्क |
रिटर्न | |
---|---|
String | कमांड से स्टडआउट। यदि आदेश निष्पादित करने में विफल रहा तो null । |
फेंकता | |
---|---|
DeviceNotAvailableException |
निष्पादितएडीबीकमांड
public String executeAdbCommand (String... cmdArgs)
हेल्पर विधि जो एडीबी कमांड को सिस्टम कमांड के रूप में निष्पादित करती है।
जहां भी संभव हो,executeShellCommand(String)
उपयोग किया जाना चाहिए, क्योंकि यह विधि बेहतर विफलता का पता लगाने और प्रदर्शन प्रदान करती है।पैरामीटर | |
---|---|
cmdArgs | String : एडीबी कमांड और चलाने के लिए तर्क |
रिटर्न | |
---|---|
String | कमांड से स्टडआउट। यदि आदेश निष्पादित करने में विफल रहा तो null । |
फेंकता | |
---|---|
DeviceNotAvailableException |
एक्ज़ीक्यूटफ़ास्टबूटकमांड
public CommandResult executeFastbootCommand (String... cmdArgs)
हेल्पर विधि जो फास्टबूट कमांड को 2 मिनट के डिफ़ॉल्ट टाइमआउट के साथ सिस्टम कमांड के रूप में निष्पादित करती है।
जब डिवाइस पहले से ही फास्टबूट मोड में हो तो इसका उपयोग किए जाने की उम्मीद है।
पैरामीटर | |
---|---|
cmdArgs | String : फास्टबूट कमांड और चलाने के लिए तर्क |
रिटर्न | |
---|---|
CommandResult | CommandResult में कमांड का आउटपुट शामिल है |
फेंकता | |
---|---|
DeviceNotAvailableException |
एक्ज़ीक्यूटफ़ास्टबूटकमांड
public CommandResult executeFastbootCommand (long timeout, String... cmdArgs)
हेल्पर विधि जो फास्टबूट कमांड को सिस्टम कमांड के रूप में निष्पादित करती है।
जब डिवाइस पहले से ही फास्टबूट मोड में हो तो इसका उपयोग किए जाने की उम्मीद है।पैरामीटर | |
---|---|
timeout | long : कमांड समाप्त होने से पहले मिलीसेकंड में समय |
cmdArgs | String : फास्टबूट कमांड और चलाने के लिए तर्क |
रिटर्न | |
---|---|
CommandResult | CommandResult में कमांड का आउटपुट शामिल है |
फेंकता | |
---|---|
DeviceNotAvailableException |
निष्पादितLongFastbootCommand
public CommandResult executeLongFastbootCommand (String... cmdArgs)
हेल्पर विधि जो लंबे समय तक चलने वाले फास्टबूट कमांड को सिस्टम कमांड के रूप में निष्पादित करती है।
executeFastbootCommand(String)
के समान, लंबे टाइमआउट का उपयोग करने के अलावा।पैरामीटर | |
---|---|
cmdArgs | String : फास्टबूट कमांड और चलाने के लिए तर्क |
रिटर्न | |
---|---|
CommandResult | CommandResult में कमांड का आउटपुट शामिल है |
फेंकता | |
---|---|
DeviceNotAvailableException |
निष्पादितLongFastbootCommand
public CommandResult executeLongFastbootCommand (envVarMap, String... cmdArgs)
हेल्पर विधि जो सिस्टम वातावरण चर के साथ सिस्टम कमांड के रूप में लंबे समय तक चलने वाले फास्टबूट कमांड को निष्पादित करती है।
executeFastbootCommand(String)
के समान, लंबे टाइमआउट का उपयोग करने के अलावा।
पैरामीटर | |
---|---|
envVarMap | |
cmdArgs | String : फास्टबूट कमांड और चलाने के लिए तर्क |
रिटर्न | |
---|---|
CommandResult | CommandResult में कमांड का आउटपुट शामिल है |
फेंकता | |
---|---|
DeviceNotAvailableException |
एक्जीक्यूटशेलकमांड
public String executeShellCommand (String command)
Helper method which executes a adb shell command and returns output as a String
.
पैरामीटर | |
---|---|
command | String : the adb shell command to run |
रिटर्न | |
---|---|
String | the shell output |
फेंकता | |
---|---|
DeviceNotAvailableException |
executeShellCommand
public void executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts)
Executes a adb shell command, with more parameters to control command behavior.
पैरामीटर | |
---|---|
command | String : the adb shell command to run |
receiver | IShellOutputReceiver : the IShellOutputReceiver to direct shell output to. |
maxTimeToOutputShellResponse | long : the maximum amount of time during which the command is allowed to not output any response; unit as specified in timeUnit |
timeUnit | TimeUnit : unit for maxTimeToOutputShellResponse |
retryAttempts | int : the maximum number of times to retry command if it fails due to a exception. DeviceNotResponsiveException will be thrown if retryAttempts are performed without success. |
फेंकता | |
---|---|
DeviceNotAvailableException |
executeShellCommand
public void executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeoutForCommand, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts)
Executes a adb shell command, with more parameters to control command behavior.
पैरामीटर | |
---|---|
command | String : the adb shell command to run |
receiver | IShellOutputReceiver : the IShellOutputReceiver to direct shell output to. |
maxTimeoutForCommand | long : the maximum timeout for the command to complete; unit as specified in timeUnit |
maxTimeToOutputShellResponse | long : the maximum amount of time during which the command is allowed to not output any response; unit as specified in timeUnit |
timeUnit | TimeUnit : unit for maxTimeToOutputShellResponse |
retryAttempts | int : the maximum number of times to retry command if it fails due to a exception. DeviceNotResponsiveException will be thrown if retryAttempts are performed without success. |
फेंकता | |
---|---|
DeviceNotAvailableException |
executeShellCommand
public void executeShellCommand (String command, IShellOutputReceiver receiver)
Executes the given adb shell command, retrying multiple times if command fails.
A simpler form ofexecuteShellCommand(String, com.android.ddmlib.IShellOutputReceiver, long, TimeUnit, int)
with default values.पैरामीटर | |
---|---|
command | String : the adb shell command to run |
receiver | IShellOutputReceiver : the IShellOutputReceiver to direct shell output to. |
फेंकता | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd)
Helper method which executes a adb shell command and returns the results as a CommandResult
properly populated with the command status output, stdout and stderr.
पैरामीटर | |
---|---|
cmd | String : The command that should be run. |
रिटर्न | |
---|---|
CommandResult | The result in CommandResult . |
फेंकता | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd, OutputStream pipeToOutput)
Helper method which executes an adb shell command and returns the results as a CommandResult
properly populated with the command status output and stderr. stdout is directed to the specified stream.
पैरामीटर | |
---|---|
cmd | String : The command that should be run. |
pipeToOutput | OutputStream : ERROR(/OutputStream) where the std output will be redirected, or null. |
रिटर्न | |
---|---|
CommandResult | The result in CommandResult . |
फेंकता | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd, File pipeAsInput)
Helper method which executes an adb shell command and returns the results as a CommandResult
properly populated with the command status output, stdout and stderr.
पैरामीटर | |
---|---|
cmd | String : The command that should be run. |
pipeAsInput | File : A ERROR(/File) that will be piped as input to the command, or null. |
रिटर्न | |
---|---|
CommandResult | The result in CommandResult . |
फेंकता | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
Executes a adb shell command, with more parameters to control command behavior.
पैरामीटर | |
---|---|
cmd | String : the adb shell command to run |
maxTimeoutForCommand | long : the maximum timeout for the command to complete; unit as specified in timeUnit |
timeUnit | TimeUnit : unit for maxTimeToOutputShellResponse |
retryAttempts | int : the maximum number of times to retry command if it fails due to a exception. DeviceNotResponsiveException will be thrown if retryAttempts are performed without success. |
रिटर्न | |
---|---|
CommandResult |
फेंकता | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd, long maxTimeoutForCommand, TimeUnit timeUnit)
Executes a adb shell command, with more parameters to control command behavior.
पैरामीटर | |
---|---|
cmd | String : the adb shell command to run |
maxTimeoutForCommand | long : the maximum timeout for the command to complete; unit as specified in timeUnit |
timeUnit | TimeUnit : unit for maxTimeToOutputShellResponse |
रिटर्न | |
---|---|
CommandResult |
फेंकता | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd, File pipeAsInput, OutputStream pipeToOutput, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
Executes a adb shell command, with more parameters to control command behavior.
पैरामीटर | |
---|---|
cmd | String : the adb shell command to run |
pipeAsInput | File : A ERROR(/File) that will be piped as input to the command, or null. |
pipeToOutput | OutputStream : ERROR(/OutputStream) where the std output will be redirected, or null. |
maxTimeoutForCommand | long : the maximum timeout for the command to complete; unit as specified in timeUnit |
timeUnit | TimeUnit : unit for maxTimeToOutputShellResponse |
retryAttempts | int : the maximum number of times to retry command if it fails due to a exception. DeviceNotResponsiveException will be thrown if retryAttempts are performed without success. |
रिटर्न | |
---|---|
CommandResult |
फेंकता | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd, File pipeAsInput, OutputStream pipeToOutput, OutputStream pipeToError, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
Executes a adb shell command, with more parameters to control command behavior.
पैरामीटर | |
---|---|
cmd | String : the adb shell command to run |
pipeAsInput | File : A ERROR(/File) that will be piped as input to the command, or null. |
pipeToOutput | OutputStream : ERROR(/OutputStream) where the std output will be redirected, or null. |
pipeToError | OutputStream : ERROR(/OutputStream) where the std error will be redirected, or null. |
maxTimeoutForCommand | long : the maximum timeout for the command to complete; unit as specified in timeUnit |
timeUnit | TimeUnit : unit for maxTimeToOutputShellResponse |
retryAttempts | int : the maximum number of times to retry command if it fails due to a exception. DeviceNotResponsiveException will be thrown if retryAttempts are performed without success. |
रिटर्न | |
---|---|
CommandResult |
फेंकता | |
---|---|
DeviceNotAvailableException |
fastbootWipePartition
public CommandResult fastbootWipePartition (String partition)
Helper method which wipes a partition for the device.
IfgetUseFastbootErase()
is true
, then fastboot erase will be used to wipe the partition. The device must then create a filesystem the next time the device boots. Otherwise, fastboot format is used which will create a new filesystem on the device. Expected to be used when device is already in fastboot mode.पैरामीटर | |
---|---|
partition | String : the partition to wipe |
रिटर्न | |
---|---|
CommandResult | the CommandResult containing output of command |
फेंकता | |
---|---|
DeviceNotAvailableException |
getActiveApexes
publicgetActiveApexes ()
Fetch the information about APEXes activated on the device.
रिटर्न | |
---|---|
ERROR(/Set) of ApexInfo currently activated on the device |
फेंकता | |
---|---|
DeviceNotAvailableException |
getAllSettings
publicgetAllSettings (String namespace)
Return key value pairs of requested namespace.
पैरामीटर | |
---|---|
namespace | String : must be one of {"system", "secure", "global"} |
रिटर्न | |
---|---|
the map of key value pairs. Null if namespace is not supported. |
फेंकता | |
---|---|
DeviceNotAvailableException |
getAllocationState
public DeviceAllocationState getAllocationState ()
Return the current allocation state of device
रिटर्न | |
---|---|
DeviceAllocationState |
getAndroidId
public String getAndroidId (int userId)
Find and return the android-id associated to a userId, null if not found.
पैरामीटर | |
---|---|
userId | int |
रिटर्न | |
---|---|
String |
फेंकता | |
---|---|
DeviceNotAvailableException |
getAndroidIds
publicgetAndroidIds ()
Create a Map of android ids found matching user ids. There is no insurance that each user id will found an android id associated in this function so some user ids may match null.
रिटर्न | |
---|---|
Map of android ids found matching user ids. |
फेंकता | |
---|---|
DeviceNotAvailableException |
getApiLevel
public int getApiLevel ()
Get the device API Level. Defaults to UNKNOWN_API_LEVEL
.
रिटर्न | |
---|---|
int | an integer indicating the API Level of device |
फेंकता | |
---|---|
DeviceNotAvailableException |
getAppPackageInfo
public PackageInfo getAppPackageInfo (String packageName)
Fetch information about a package installed on device.
पैरामीटर | |
---|---|
packageName | String |
रिटर्न | |
---|---|
PackageInfo | the PackageInfo or null if information could not be retrieved |
फेंकता | |
---|---|
DeviceNotAvailableException |
getAppPackageInfos
publicgetAppPackageInfos ()
Fetch information of packages installed on the device.
रिटर्न | |
---|---|
ERROR(/List) of PackageInfo s installed on the device. |
फेंकता | |
---|---|
DeviceNotAvailableException |
getBasebandVersion
public String getBasebandVersion ()
Convenience method to get baseband (radio) version of this device. Getting the radio version is device specific, so it might not return the correct information for all devices. This method relies on the gsm.version.baseband propery to return the correct version information. This is not accurate for some CDMA devices and the version returned here might not match the version reported from fastboot and might not return the version for the CDMA radio. TL;DR this method only reports accurate version if the gsm.version.baseband property is the same as the version returned by fastboot getvar version-baseband
.
रिटर्न | |
---|---|
String | the String baseband version or null if it cannot be determined (device has no radio or version string cannot be read) |
फेंकता | |
---|---|
DeviceNotAvailableException |
getBattery
public Integer getBattery ()
Returns the current battery level of a device or Null if battery level unavailable.
रिटर्न | |
---|---|
Integer |
getBooleanProperty
public boolean getBooleanProperty (String name, boolean defaultValue)
Returns boolean value of the given property.
पैरामीटर | |
---|---|
name | String : the property name |
defaultValue | boolean : default value to return if property is empty or doesn't exist. |
रिटर्न | |
---|---|
boolean | true if the property has value "1" , "y" , "yes" , "on" , or "true" , false if the property has value of "0" , "n" , "no" , "off" , "false" , or defaultValue otherwise. |
फेंकता | |
---|---|
DeviceNotAvailableException |
getBootHistory
publicgetBootHistory ()
Helper method collects the boot history map with boot time and boot reason.
रिटर्न | |
---|---|
Map of boot time (UTC time in second since Epoch) and boot reason |
फेंकता | |
---|---|
DeviceNotAvailableException |
getBootHistorySince
publicgetBootHistorySince (long utcEpochTime, TimeUnit timeUnit)
Helper method collects the boot history map with boot time and boot reason since the given time since epoch from device and the time unit specified. The current device utcEpochTime in Millisecond can be obtained by method getDeviceDate()
.
पैरामीटर | |
---|---|
utcEpochTime | long : the device time since Epoch. |
timeUnit | TimeUnit : the time unit TimeUnit . |
रिटर्न | |
---|---|
Map of boot time (UTC time in second since Epoch) and boot reason |
फेंकता | |
---|---|
DeviceNotAvailableException |
getBootloaderVersion
public String getBootloaderVersion ()
Convenience method to get the bootloader version of this device.
Will attempt to retrieve bootloader version from the device's current state. (ie if device is in fastboot mode, it will attempt to retrieve version from fastboot)रिटर्न | |
---|---|
String | the String bootloader version or null if it cannot be found |
फेंकता | |
---|---|
DeviceNotAvailableException |
getBugreport
public InputStreamSource getBugreport ()
Retrieves a bugreport from the device.
The implementation of this is guaranteed to continue to work on a device without an sdcard (or where the sdcard is not yet mounted).
रिटर्न | |
---|---|
InputStreamSource | An InputStreamSource which will produce the bugreport contents on demand. In case of failure, the InputStreamSource will produce an empty ERROR(/InputStream) . |
getBugreportz
public InputStreamSource getBugreportz ()
Retrieves a bugreportz from the device. Zip format bugreport contains the main bugreport and other log files that are useful for debugging.
Only supported for 'adb version' > 1.0.36
रिटर्न | |
---|---|
InputStreamSource | a InputStreamSource of the zip file containing the bugreportz, return null in case of failure. |
getBuildAlias
public String getBuildAlias ()
Retrieve the alias of the build that the device is currently running.
Build alias is usually a more readable string than build id (typically a number for Nexus builds). For example, final Android 4.2 release has build alias JDQ39, and build id 573038
रिटर्न | |
---|---|
String | the build alias or fall back to build id if it could not be retrieved |
फेंकता | |
---|---|
DeviceNotAvailableException |
getBuildFlavor
public String getBuildFlavor ()
Retrieve the build flavor for the device.
रिटर्न | |
---|---|
String | the build flavor or null if it could not be retrieved |
फेंकता | |
---|---|
DeviceNotAvailableException |
getBuildId
public String getBuildId ()
Retrieve the build the device is currently running.
रिटर्न | |
---|---|
String | the build id or IBuildInfo#UNKNOWN_BUILD_ID if it could not be retrieved |
फेंकता | |
---|---|
DeviceNotAvailableException |
getBuildSigningKeys
public String getBuildSigningKeys ()
Returns the key type used to sign the device image
Typically Android devices may be signed with test-keys (like in AOSP) or release-keys (controlled by individual device manufacturers)
रिटर्न | |
---|---|
String | The signing key if found, null otherwise. |
फेंकता | |
---|---|
DeviceNotAvailableException |
getCachedDeviceDescriptor
public DeviceDescriptor getCachedDeviceDescriptor ()
Returns a cached DeviceDescriptor
if the device is allocated, otherwise returns the current DeviceDescriptor
.
रिटर्न | |
---|---|
DeviceDescriptor |
getCachedDeviceDescriptor
public DeviceDescriptor getCachedDeviceDescriptor (boolean shortDescriptor)
Returns a cached DeviceDescriptor
if the device is allocated, otherwise returns the current DeviceDescriptor
.
पैरामीटर | |
---|---|
shortDescriptor | boolean : Whether or not to limit descriptor to bare minimum info |
रिटर्न | |
---|---|
DeviceDescriptor |
getChildren
public String[] getChildren (String path)
Alternative to using IFileEntry
that sometimes won't work because of permissions.
पैरामीटर | |
---|---|
path | String : is the path on the device where to do the search |
रिटर्न | |
---|---|
String[] | Array of string containing all the file in a path on the device. |
फेंकता | |
---|---|
DeviceNotAvailableException |
getConnection
public AbstractConnection getConnection ()
The current connection associated with the device.
रिटर्न | |
---|---|
AbstractConnection |
getCurrentFoldableState
public DeviceFoldableState getCurrentFoldableState ()
Returns the current foldable state of the device or null if some issues occurred.
रिटर्न | |
---|---|
DeviceFoldableState |
फेंकता | |
---|---|
DeviceNotAvailableException |
getCurrentUser
public int getCurrentUser ()
Return the id of the current running user. In case of error, return -10000.
रिटर्न | |
---|---|
int |
फेंकता | |
---|---|
DeviceNotAvailableException |
getDeviceClass
public String getDeviceClass ()
Get the device class.
रिटर्न | |
---|---|
String | the String device class. |
getDeviceDate
public long getDeviceDate ()
Return the date of the device in millisecond since epoch.
रिटर्न | |
---|---|
long | the date of the device in epoch format. |
फेंकता | |
---|---|
DeviceNotAvailableException |
getDeviceDescriptor
public DeviceDescriptor getDeviceDescriptor ()
वास्तविक डिवाइस ऑब्जेक्ट को पास किए बिना इसके बारे में जानकारी प्राप्त करने के लिए डिवाइस जानकारी से DeviceDescriptor
लौटाएँ।
रिटर्न | |
---|---|
DeviceDescriptor |
getDeviceDescriptor
public DeviceDescriptor getDeviceDescriptor (boolean shortDescriptor)
वास्तविक डिवाइस ऑब्जेक्ट को पास किए बिना इसके बारे में जानकारी प्राप्त करने के लिए डिवाइस जानकारी से DeviceDescriptor
लौटाएँ।
पैरामीटर | |
---|---|
shortDescriptor | boolean : Whether or not to limit descriptor to bare minimum info |
रिटर्न | |
---|---|
DeviceDescriptor |
getDeviceState
public TestDeviceState getDeviceState ()
Get the device's state.
रिटर्न | |
---|---|
TestDeviceState |
getDeviceTimeOffset
public long getDeviceTimeOffset (Date date)
Helper to get the time difference between the device and a given ERROR(/Date)
. Use Epoch time internally.
पैरामीटर | |
---|---|
date | Date |
रिटर्न | |
---|---|
long | the difference in milliseconds |
फेंकता | |
---|---|
DeviceNotAvailableException |
getEmulatorOutput
public InputStreamSource getEmulatorOutput ()
Get the stream of emulator stdout and stderr
रिटर्न | |
---|---|
InputStreamSource | emulator output |
getEmulatorProcess
public Process getEmulatorProcess ()
Return the Process
corresponding to this emulator.
रिटर्न | |
---|---|
Process | the Process or null |
getExecuteShellCommandLog
public final File getExecuteShellCommandLog ()
The log that contains all the executeShellCommand(String)
logs.
रिटर्न | |
---|---|
File |
getExternalStoreFreeSpace
public long getExternalStoreFreeSpace ()
Helper method to determine amount of free space on device external storage.
रिटर्न | |
---|---|
long | the amount of free space in KB |
फेंकता | |
---|---|
DeviceNotAvailableException |
getFastbootPath
public String getFastbootPath ()
Returns the path of the fastboot binary being used. Still requires isFastbootEnabled()
to be true, to have fastboot functions enabled.
रिटर्न | |
---|---|
String |
getFastbootProductType
public String getFastbootProductType ()
Convenience method to get the product type of this device when its in fastboot mode.
This method should only be used if device should be in fastboot. Its a bit safer variant than the genericgetProductType()
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 |
getFastbootProductVariant
public String getFastbootProductVariant ()
Convenience method to get the product type of this device when its in fastboot mode.
This method should only be used if device should be in fastboot. Its a bit safer variant than the genericgetProductType()
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 |
getFastbootSerialNumber
public String getFastbootSerialNumber ()
Returns the fastboot mode serial number.
रिटर्न | |
---|---|
String |
getFastbootVariable
public 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 |
फेंकता | |
---|---|
DeviceNotAvailableException |
getFastbootVersion
public String getFastbootVersion ()
Returns the version string of the fastboot binary being used. Or null if something goes wrong.
रिटर्न | |
---|---|
String |
getFileEntry
public 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 |
फेंकता | |
---|---|
DeviceNotAvailableException |
getFileEntry
public IFileEntry getFileEntry (FileListingService.FileEntry entry)
Unofficial helper to get a FileEntry
from a non-root path. FIXME: Refactor the FileEntry system to have it available from any path. (even non root).
पैरामीटर | |
---|---|
entry | FileListingService.FileEntry : a FileEntry not necessarily root as Ddmlib requires. |
रिटर्न | |
---|---|
IFileEntry | a FileEntryWrapper representing the FileEntry. |
फेंकता | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
getFoldableStates
publicgetFoldableStates ()
Returns the list of foldable states on the device. Can be obtained with "cmd device_state print-states".
रिटर्न | |
---|---|
फेंकता | |
---|---|
DeviceNotAvailableException |
getIDevice
public IDevice getIDevice ()
Returns a reference to the associated ddmlib IDevice
.
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 |
getInstalledPackageNames
publicgetInstalledPackageNames ()
Fetch the application package names present on the device.
रिटर्न | |
---|---|
ERROR(/Set) of String package names currently installed on the device. |
फेंकता | |
---|---|
DeviceNotAvailableException |
getIntProperty
public 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 |
getIpAddress
public String getIpAddress ()
Gets the device's IP address.
रिटर्न | |
---|---|
String | the device's IP address, or null if device has no IP address |
फेंकता | |
---|---|
DeviceNotAvailableException |
getKeyguardState
public KeyguardControllerState getKeyguardState ()
Return an object to get the current state of the keyguard or null if not supported.
रिटर्न | |
---|---|
KeyguardControllerState | a KeyguardControllerState containing a snapshot of the state of the keyguard and returns Null if the Keyguard query is not supported. |
फेंकता | |
---|---|
DeviceNotAvailableException |
getLastExpectedRebootTimeMillis
public long getLastExpectedRebootTimeMillis ()
Returns the last time Tradefed APIs triggered a reboot in milliseconds since EPOCH as returned by System.currentTimeMillis()
.
रिटर्न | |
---|---|
long |
getLaunchApiLevel
public 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 |
फेंकता | |
---|---|
DeviceNotAvailableException |
getLogcat
public InputStreamSource getLogcat ()
Grabs a snapshot stream of the logcat data.
Works in two modes:
TestDeviceOptions.getMaxLogcatDataSize()
bytes of the current contents of the background logcat captureरिटर्न | |
---|---|
InputStreamSource |
getLogcat
public 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 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 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 |
getMacAddress
public String getMacAddress ()
Returns the MAC address of the device, null if it fails to query from the device.
रिटर्न | |
---|---|
String |
getMainUserId
public Integer getMainUserId ()
Returns the main user id.
रिटर्न | |
---|---|
Integer | the userId of the main user if there is one, and null if there is no main user. |
फेंकता | |
---|---|
DeviceNotAvailableException |
getMainlineModuleInfo
publicgetMainlineModuleInfo ()
Get the information about the mainline modules installed on the device.
रिटर्न | |
---|---|
ERROR(/Set) of String mainline modules currently installed on the device. |
फेंकता | |
---|---|
DeviceNotAvailableException |
getMaxNumberOfRunningUsersSupported
public int getMaxNumberOfRunningUsersSupported ()
Get the maximum number of supported simultaneously running users. Defaults to 0.
रिटर्न | |
---|---|
int | an integer indicating the number of simultaneously running users |
फेंकता | |
---|---|
DeviceNotAvailableException |
getMaxNumberOfUsersSupported
public int getMaxNumberOfUsersSupported ()
Get the maximum number of supported users. Defaults to 0.
रिटर्न | |
---|---|
int | an integer indicating the number of supported users |
फेंकता | |
---|---|
DeviceNotAvailableException |
getMicrodroidProcess
public Process getMicrodroidProcess ()
रिटर्न | |
---|---|
Process | Returns the Process of the Microdroid VM. If TestDevice is not a Microdroid, returns null. |
getMonitor
public IDeviceStateMonitor getMonitor ()
Return the IDeviceStateMonitor
associated with device.
रिटर्न | |
---|---|
IDeviceStateMonitor |
getMountPoint
public String getMountPoint (String mountName)
Returns a mount point.
Queries the device directly if the cached info inIDevice
is not available. TODO: move this behavior to IDevice#getMountPoint(String)
पैरामीटर | |
---|---|
mountName | String : the name of the mount point |
रिटर्न | |
---|---|
String | the mount point or null |
getMountPointInfo
public 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
publicgetMountPointInfo ()
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 |
getOptions
public TestDeviceOptions getOptions ()
Fetch the test options for the device.
रिटर्न | |
---|---|
TestDeviceOptions | TestDeviceOptions related to the device under test. |
getPartitionFreeSpace
public 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 |
getPrimaryUserId
public Integer getPrimaryUserId ()
Returns the primary user id.
रिटर्न | |
---|---|
Integer | the userId of the primary user if there is one, and null if there is no primary user. |
फेंकता | |
---|---|
DeviceNotAvailableException |
getProcessByName
public 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 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 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 |
getProductVariant
public 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 |
getProperty
public String getProperty (String name)
Retrieve the given property value from the device.
पैरामीटर | |
---|---|
name | String : the property name |
रिटर्न | |
---|---|
String | the property value or null if it does not exist |
फेंकता | |
---|---|
DeviceNotAvailableException |
getRecoveryMode
public ITestDevice.RecoveryMode getRecoveryMode ()
Get the current recovery mode used for the device.
रिटर्न | |
---|---|
ITestDevice.RecoveryMode | the current recovery mode used for the device. |
getScreenshot
public InputStreamSource getScreenshot (String format)
Grabs a screenshot from the device. Recommended to use getScreenshot(format) instead with JPEG encoding for smaller size
पैरामीटर | |
---|---|
format | String : supported PNG, JPEG |
रिटर्न | |
---|---|
InputStreamSource | a InputStreamSource of the screenshot in format, or null if the screenshot was not successful. |
फेंकता | |
---|---|
DeviceNotAvailableException |
getScreenshot
public InputStreamSource getScreenshot (long displayId)
Grabs a screenshot from the device given display id. Format is PNG.
TODO: extend the implementations above to support 'format' and 'rescale'
पैरामीटर | |
---|---|
displayId | long : the display id of the screen to get screenshot from. |
रिटर्न | |
---|---|
InputStreamSource | a InputStreamSource of the screenshot in format, or null if the screenshot was not successful. |
फेंकता | |
---|---|
DeviceNotAvailableException |
getScreenshot
public InputStreamSource getScreenshot (String format, boolean rescale)
Grabs a screenshot from the device. Recommended to use getScreenshot(String)
instead with JPEG encoding for smaller size.
पैरामीटर | |
---|---|
format | String : supported PNG, JPEG |
rescale | boolean : if screenshot should be rescaled to reduce the size of resulting image |
रिटर्न | |
---|---|
InputStreamSource | a InputStreamSource of the screenshot in format, or null if the screenshot was not successful. |
फेंकता | |
---|---|
DeviceNotAvailableException |
getScreenshot
public InputStreamSource getScreenshot ()
Grabs a screenshot from the device.
रिटर्न | |
---|---|
InputStreamSource | a InputStreamSource of the screenshot in png format, or null if the screenshot was not successful. |
फेंकता | |
---|---|
DeviceNotAvailableException |
getSerialNumber
public String getSerialNumber ()
Convenience method to get serial number of this device.
रिटर्न | |
---|---|
String | the String serial number |
getSetting
public String getSetting (int userId, String namespace, String key)
Return the value of the requested setting. namespace must be one of: {"system", "secure", "global"}
पैरामीटर | |
---|---|
userId | int |
namespace | String |
key | String |
रिटर्न | |
---|---|
String | the value associated with the namespace:key of a user. Null if not found. |
फेंकता | |
---|---|
DeviceNotAvailableException |
getSetting
public String getSetting (String namespace, String key)
See getSetting(int, String, String)
and performed on system user.
पैरामीटर | |
---|---|
namespace | String |
key | String |
रिटर्न | |
---|---|
String |
फेंकता | |
---|---|
DeviceNotAvailableException |
getSimOperator
public String getSimOperator ()
Return the SIM card operator or null if not available or if device is not available.
रिटर्न | |
---|---|
String |
getSimState
public String getSimState ()
Return the SIM card state or null if not available or device is not available.
रिटर्न | |
---|---|
String |
समाधि के पत्थर प्राप्त करें
publicgetTombstones ()
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.
रिटर्न | |
---|---|
समाधि-पत्थर फ़ाइलों की एक सूची, यदि कोई समाधि-पत्थर नहीं है तो खाली। |
फेंकता | |
---|---|
DeviceNotAvailableException |
getTotalMemory
public long getTotalMemory ()
Returns total physical memory size in bytes or -1 in case of internal error
रिटर्न | |
---|---|
long |
getUninstallablePackageNames
publicgetUninstallablePackageNames ()
Fetch the application package names that can be uninstalled. This is presently defined as non-system packages, and updated system packages.
रिटर्न | |
---|---|
ERROR(/Set) of uninstallable String package names currently installed on the device. |
फेंकता | |
---|---|
DeviceNotAvailableException |
getUseFastbootErase
public 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. |
getUserFlags
public int getUserFlags (int userId)
Find and return the flags of a given user. Flags are defined in "android.content.pm.UserInfo" class in Android Open Source Project.
पैरामीटर | |
---|---|
userId | int |
रिटर्न | |
---|---|
int | the flags associated with the userId provided if found, -10000 in any other cases. |
फेंकता | |
---|---|
DeviceNotAvailableException |
getUserInfos
publicgetUserInfos ()
Gets the Map of useId to UserInfo
on the device. Will throw DeviceRuntimeException
if output from device is not as expected.
रिटर्न | |
---|---|
the list of UserInfo objects. |
फेंकता | |
---|---|
DeviceNotAvailableException |
getUserSerialNumber
public int getUserSerialNumber (int userId)
Return the serial number associated to the userId if found, -10000 in any other cases.
पैरामीटर | |
---|---|
userId | int |
रिटर्न | |
---|---|
int |
फेंकता | |
---|---|
DeviceNotAvailableException |
handleAllocationEvent
public IManagedTestDevice.DeviceEventResponse handleAllocationEvent (DeviceEvent event)
Process the given DeviceEvent. May transition device to new state. Will inform the IDeviceMonitor
of any state transitions.
Process the DeviceEvent, which may or may not transition this device to a new allocation state.
पैरामीटर | |
---|---|
event | DeviceEvent |
रिटर्न | |
---|---|
IManagedTestDevice.DeviceEventResponse |
hasFeature
public boolean hasFeature (String feature)
Check if a feature is available on a device.
पैरामीटर | |
---|---|
feature | String : which format should be "feature: |
रिटर्न | |
---|---|
boolean | True if feature is found, false otherwise. |
फेंकता | |
---|---|
DeviceNotAvailableException |
installPackage
public String installPackage (File packageFile, boolean reinstall, String... extraArgs)
Install an Android package on device.
पैरामीटर | |
---|---|
packageFile | File : the apk file to install |
reinstall | boolean : true if a reinstall should be performed |
extraArgs | String : optional extra arguments to pass. See 'adb shell pm -h' for available options. |
रिटर्न | |
---|---|
String | a String with an error code, or null if success. |
फेंकता | |
---|---|
DeviceNotAvailableException |
installPackage
public String installPackage (File packageFile, boolean reinstall, boolean grantPermissions, String... extraArgs)
Install an Android package on device.
Note: Only use cases that requires explicit control of granting runtime permission at install time should call this function.
पैरामीटर | |
---|---|
packageFile | File : the apk file to install |
reinstall | boolean : true if a reinstall should be performed |
grantPermissions | boolean : if all runtime permissions should be granted at install time |
extraArgs | String : optional extra arguments to pass. See 'adb shell pm -h' for available options. |
रिटर्न | |
---|---|
String | a String with an error code, or null if success. |
फेंकता | |
---|---|
DeviceNotAvailableException |
installPackageForUser
public String installPackageForUser (File packageFile, boolean reinstall, int userId, String... extraArgs)
Install an Android package on device for a given user.
पैरामीटर | |
---|---|
packageFile | File : the apk file to install |
reinstall | boolean : true if a reinstall should be performed |
userId | int : the integer user id to install for. |
extraArgs | String : optional extra arguments to pass. See 'adb shell pm -h' for available options. |
रिटर्न | |
---|---|
String | a String with an error code, or null if success. |
फेंकता | |
---|---|
DeviceNotAvailableException |
installPackageForUser
public String installPackageForUser (File packageFile, boolean reinstall, boolean grantPermissions, int userId, String... extraArgs)
Install an Android package on device for a given user.
Note: Only use cases that requires explicit control of granting runtime permission at install time should call this function.
पैरामीटर | |
---|---|
packageFile | File : the apk file to install |
reinstall | boolean : true if a reinstall should be performed |
grantPermissions | boolean : if all runtime permissions should be granted at install time |
userId | int : the integer user id to install for. |
extraArgs | String : optional extra arguments to pass. See 'adb shell pm -h' for available options. |
रिटर्न | |
---|---|
String | a String with an error code, or null if success. |
फेंकता | |
---|---|
DeviceNotAvailableException |
invalidatePropertyCache
public void invalidatePropertyCache ()
isAdbTcp
public boolean isAdbTcp ()
रिटर्न | |
---|---|
boolean |
isAppEnumerationSupported
public boolean isAppEnumerationSupported ()
Check whether platform on device supports app enumeration
रिटर्न | |
---|---|
boolean | True if app enumeration is supported, false otherwise |
फेंकता | |
---|---|
DeviceNotAvailableException |
isBypassLowTargetSdkBlockSupported
public 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 |
फेंकता | |
---|---|
DeviceNotAvailableException |
isDeviceEncrypted
public boolean isDeviceEncrypted ()
Returns if the device is encrypted.
रिटर्न | |
---|---|
boolean | true if the device is encrypted. |
फेंकता | |
---|---|
DeviceNotAvailableException |
isDirectory
public boolean isDirectory (String path)
Return True if the path on the device is a directory, false otherwise.
पैरामीटर | |
---|---|
path | String |
रिटर्न | |
---|---|
boolean |
फेंकता | |
---|---|
DeviceNotAvailableException |
isEnableAdbRoot
public boolean isEnableAdbRoot ()
रिटर्न | |
---|---|
boolean | true if adb root should be enabled on device |
isEncryptionSupported
public boolean isEncryptionSupported ()
Returns if encryption is supported on the device.
रिटर्न | |
---|---|
boolean | true if the device supports encryption. |
फेंकता | |
---|---|
DeviceNotAvailableException |
isExecutable
public boolean isExecutable (String fullPath)
Returns True if the file path on the device is an executable file, false otherwise.
पैरामीटर | |
---|---|
fullPath | String |
रिटर्न | |
---|---|
boolean |
फेंकता | |
---|---|
DeviceNotAvailableException |
isFastbootEnabled
public boolean isFastbootEnabled ()
Return if fastboot is available for the device.
रिटर्न | |
---|---|
boolean |
isHeadless
public boolean isHeadless ()
Return true if the device is headless (no screen), false otherwise.
रिटर्न | |
---|---|
boolean |
फेंकता | |
---|---|
DeviceNotAvailableException |
isHeadlessSystemUserMode
public boolean isHeadlessSystemUserMode ()
Returns whether the device uses headless system user mode.
रिटर्न | |
---|---|
boolean |
फेंकता | |
---|---|
DeviceNotAvailableException |
isMainUserPermanentAdmin
public boolean isMainUserPermanentAdmin ()
Returns whether the main user is a permanent admin and can't be deleted or downgraded to non-admin status.
रिटर्न | |
---|---|
boolean |
फेंकता | |
---|---|
DeviceNotAvailableException |
isMultiUserSupported
public boolean isMultiUserSupported ()
Determines if multi user is supported.
रिटर्न | |
---|---|
boolean | true if multi user is supported, false otherwise |
फेंकता | |
---|---|
DeviceNotAvailableException |
isPackageInstalled
public boolean isPackageInstalled (String packageName, String userId)
Query the device for a given package name and given user id to check if it's currently installed or not for that user.
पैरामीटर | |
---|---|
packageName | String : the package we are checking if it's installed. |
userId | String : The user id we are checking the package is installed for. If null, primary user zero will be used. |
रिटर्न | |
---|---|
boolean | True if the package is reported as installed. False otherwise. |
फेंकता | |
---|---|
DeviceNotAvailableException |
isPackageInstalled
public boolean isPackageInstalled (String packageName)
Query the device for a given package name to check if it's currently installed or not.
पैरामीटर | |
---|---|
packageName | String |
रिटर्न | |
---|---|
boolean | True if the package is reported as installed. False otherwise. |
फेंकता | |
---|---|
DeviceNotAvailableException |
isRuntimePermissionSupported
public boolean isRuntimePermissionSupported ()
Check whether platform on device supports runtime permission granting
रिटर्न | |
---|---|
boolean | True if runtime permission are supported, false otherwise. |
फेंकता | |
---|---|
DeviceNotAvailableException |
isStateBootloaderOrFastbootd
public boolean isStateBootloaderOrFastbootd ()
Returns true if device is in TestDeviceState#FASTBOOT
or TestDeviceState.FASTBOOTD
.
रिटर्न | |
---|---|
boolean |
isUserRunning
public boolean isUserRunning (int userId)
Check if a given user is running.
पैरामीटर | |
---|---|
userId | int |
रिटर्न | |
---|---|
boolean | True if the user is running, false in every other cases. |
फेंकता | |
---|---|
DeviceNotAvailableException |
isUserSecondary
public boolean isUserSecondary (int userId)
Return whether the specified user is a secondary user according to it's flags.
पैरामीटर | |
---|---|
userId | int |
रिटर्न | |
---|---|
boolean | true if the user is secondary, false otherwise. |
फेंकता | |
---|---|
DeviceNotAvailableException |
isUserVisible
public boolean isUserVisible (int userId)
Checks if the given user is visible.
A "visible" user is a user that is interacting with the "human" user and hence is able to launch launch activities (typically in the default display).
पैरामीटर | |
---|---|
userId | int |
रिटर्न | |
---|---|
boolean |
फेंकता | |
---|---|
DeviceNotAvailableException |
isUserVisibleOnDisplay
public boolean isUserVisibleOnDisplay (int userId, int displayId)
Checks if the given user is visible in the given display.
A "visible" user is a user that is interacting with the "human" user and hence is able to launch launch activities in that display.
पैरामीटर | |
---|---|
userId | int |
displayId | int |
रिटर्न | |
---|---|
boolean |
फेंकता | |
---|---|
DeviceNotAvailableException |
isVisibleBackgroundUsersOnDefaultDisplaySupported
public boolean isVisibleBackgroundUsersOnDefaultDisplaySupported ()
Returns whether the device allow users to be started visible in the background in the ERROR(/java.android.view.Display#DEFAULT_DISPLAY)
.
If it does, you could call startVisibleBackgroundUser(int, int, boolean)
, passing a display returned by listDisplayIdsForStartingVisibleBackgroundUsers()
(which should include ERROR(/java.android.view.Display#DEFAULT_DISPLAY)
).
रिटर्न | |
---|---|
boolean |
फेंकता | |
---|---|
DeviceNotAvailableException |
isVisibleBackgroundUsersSupported
public boolean isVisibleBackgroundUsersSupported ()
Returns whether the device allow users to be started visible in the background.
If it does, you could call startVisibleBackgroundUser(int, int, boolean)
, passing a display returned by listDisplayIdsForStartingVisibleBackgroundUsers()
.
रिटर्न | |
---|---|
boolean |
फेंकता | |
---|---|
DeviceNotAvailableException |
isWifiEnabled
public boolean isWifiEnabled ()
Test if wifi is enabled.
Checks if wifi is enabled on device. Useful for asserting wifi status before tests that shouldn't run with wifi, eg mobile data tests.रिटर्न | |
---|---|
boolean | true if wifi is enabled. false if disabled |
फेंकता | |
---|---|
DeviceNotAvailableException |
listDisplayIds
publiclistDisplayIds ()
Collect the list of available displays id on the device as reported by "dumpsys SurfaceFlinger".
रिटर्न | |
---|---|
The list of displays. Default always returns the default display 0. |
फेंकता | |
---|---|
DeviceNotAvailableException |
listDisplayIdsForStartingVisibleBackgroundUsers
publiclistDisplayIdsForStartingVisibleBackgroundUsers ()
Gets the list of displays that can be used to start a user visible in the background
.
रिटर्न | |
---|---|
फेंकता | |
---|---|
DeviceNotAvailableException |
listUsers
publiclistUsers ()
Gets the list of users on the device. Will throw DeviceRuntimeException
if output from device is not as expected.
रिटर्न | |
---|---|
the list of user ids. |
फेंकता | |
---|---|
DeviceNotAvailableException |
logAnrs
public boolean logAnrs (ITestLogger logger)
Collects and log ANRs from the device.
पैरामीटर | |
---|---|
logger | ITestLogger : an ITestLogger to log the ANRs. |
रिटर्न | |
---|---|
boolean | True if the logging was successful, false otherwise. |
फेंकता | |
---|---|
DeviceNotAvailableException |
logBugreport
public boolean logBugreport (String dataName, ITestLogger listener)
Helper method to take a bugreport and log it to the reporters.
पैरामीटर | |
---|---|
dataName | String : name under which the bugreport will be reported. |
listener | ITestLogger : an ITestLogger to log the bugreport. |
रिटर्न | |
---|---|
boolean | True if the logging was successful, false otherwise. |
logOnDevice
public void logOnDevice (String tag, Log.LogLevel level, String format, Object... args)
Log a message in the logcat of the device. This is a safe call that will not throw even if the logging fails.
पैरामीटर | |
---|---|
tag | String : The tag under which we log our message in the logcat. |
level | Log.LogLevel : The debug level of the message in the logcat. |
format | String : The message format. |
args | Object : the args to be replaced via String.format(). |
nonBlockingReboot
public void nonBlockingReboot ()
Issues a command to reboot device and returns on command complete and when device is no longer visible to adb.
फेंकता | |
---|---|
DeviceNotAvailableException |
postAdbRootAction
public void postAdbRootAction ()
Override if the device needs some specific actions to be taken after adb root and before the device is back online. Default implementation doesn't include any addition actions. adb root is not guaranteed to be enabled at this stage.
फेंकता | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
postAdbUnrootAction
public void postAdbUnrootAction ()
Override if the device needs some specific actions to be taken after adb unroot and before the device is back online. Default implementation doesn't include any additional actions. adb root is not guaranteed to be disabled at this stage.
फेंकता | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
postBootSetup
public 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 |
postInvocationTearDown
public void postInvocationTearDown (Throwable exception)
Extra steps for device specific required clean up that will be executed after the invocation is done.
पैरामीटर | |
---|---|
exception | 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 |
फेंकता | |
---|---|
DeviceNotAvailableException | |
TargetSetupError |
pullDir
public 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 |
pullFile
public 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 |
pullFile
public 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 |
pullFile
public 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 |
pullFile
public 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 |
pullFileContents
public 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 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 |
pushDir
public boolean pushDir (File localFileDir, String deviceFilePath,excludedDirectories)
Recursively push directory contents to device while excluding some directories that are filtered.
पैरामीटर | |
---|---|
localFileDir | File : the local directory to push |
deviceFilePath | String : the absolute file path of the remote destination |
excludedDirectories |
रिटर्न | |
---|---|
boolean | true if file was pushed successfully. false otherwise. |
फेंकता | |
---|---|
DeviceNotAvailableException |
pushDir
public boolean pushDir (File localFileDir, String deviceFilePath)
Recursively push directory contents to device.
पैरामीटर | |
---|---|
localFileDir | 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 |
pushFile
public boolean pushFile (File localFile, String remoteFilePath, 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 |
remoteFilePath | 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 |
pushFile
public boolean pushFile (File localFile, String remoteFilePath)
Push a file to device. By default using a content provider.
पैरामीटर | |
---|---|
localFile | File : the local file to push |
remoteFilePath | String : the remote destination absolute file path |
रिटर्न | |
---|---|
boolean | true if file was pushed successfully. false otherwise. |
फेंकता | |
---|---|
DeviceNotAvailableException |
pushString
public boolean pushString (String contents, String remoteFilePath)
Push file created from a string to device
पैरामीटर | |
---|---|
contents | String : the contents of the file to push |
remoteFilePath | String : the remote destination absolute file path |
रिटर्न | |
---|---|
boolean | true if string was pushed successfully. false otherwise. |
फेंकता | |
---|---|
DeviceNotAvailableException |
reboot
public 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 |
reboot
public void reboot ()
Reboots the device into adb mode.
Blocks until device becomes available.फेंकता | |
---|---|
DeviceNotAvailableException |
rebootIntoBootloader
public void rebootIntoBootloader ()
Reboots the device into bootloader mode.
Blocks until device is in bootloader mode.फेंकता | |
---|---|
DeviceNotAvailableException |
rebootIntoFastbootd
public void rebootIntoFastbootd ()
Reboots the device into fastbootd mode.
Blocks until device is in fastbootd mode.
फेंकता | |
---|---|
DeviceNotAvailableException |
rebootIntoRecovery
public void rebootIntoRecovery ()
Reboots the device into adb recovery mode.
Blocks until device enters recoveryफेंकता | |
---|---|
DeviceNotAvailableException |
rebootIntoSideload
public 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 |
rebootIntoSideload
public 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 |
rebootUntilOnline
public void rebootUntilOnline ()
An alternate to reboot()
that only blocks until device is online ie visible to adb.
फेंकता | |
---|---|
DeviceNotAvailableException |
rebootUntilOnline
public 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 |
rebootUserspace
public 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 |
rebootUserspaceUntilOnline
public void rebootUserspaceUntilOnline ()
An alternate to rebootUserspace()
()} that only blocks until device is online ie visible to adb.
फेंकता | |
---|---|
DeviceNotAvailableException |
recoverDevice
public boolean recoverDevice ()
Attempts to recover device communication.
रिटर्न | |
---|---|
boolean | True if recovery attempted and successful, returns False if recovery was skipped |
फेंकता | |
---|---|
DeviceNotAvailableException | if device is no longer available |
registerDeviceActionReceiver
public void registerDeviceActionReceiver (IDeviceActionReceiver deviceActionReceiver)
Registers a IDeviceActionReceiver
for this device.
All registered IDeviceActionReceiver
s will be notified before a device action starts and after the device action ends.
पैरामीटर | |
---|---|
deviceActionReceiver | IDeviceActionReceiver : A IDeviceActionReceiver which will be registered. |
remountSystemReadOnly
public void remountSystemReadOnly ()
Make the system partition on the device read-only. May reboot the device.
फेंकता | |
---|---|
DeviceNotAvailableException |
remountSystemWritable
public void remountSystemWritable ()
Make the system partition on the device writable. May reboot the device.
फेंकता | |
---|---|
DeviceNotAvailableException |
remountVendorReadOnly
public void remountVendorReadOnly ()
Make the vendor partition on the device read-only. May reboot the device.
फेंकता | |
---|---|
DeviceNotAvailableException |
remountVendorWritable
public void remountVendorWritable ()
Make the vendor partition on the device writable. May reboot the device.
फेंकता | |
---|---|
DeviceNotAvailableException |
removeAdmin
public boolean removeAdmin (String componentName, int userId)
Remove given device admin in given user and return true
if it is successful, false
otherwise.
पैरामीटर | |
---|---|
componentName | String : of device admin to be removed. |
userId | int : of user that the device admin lives in. |
रिटर्न | |
---|---|
boolean | True if it is successful, false otherwise. |
फेंकता | |
---|---|
DeviceNotAvailableException |
removeOwners
public void removeOwners ()
Remove all existing device profile owners with the best effort.
फेंकता | |
---|---|
DeviceNotAvailableException |
removeUser
public boolean removeUser (int userId)
Remove a given user from the device.
पैरामीटर | |
---|---|
userId | int : of the user to remove |
रिटर्न | |
---|---|
boolean | true if we were successful in removing the user, false otherwise. |
फेंकता | |
---|---|
DeviceNotAvailableException |
resetContentProviderSetup
public void resetContentProviderSetup ()
Reset the flag for content provider setup in order to trigger it again.
runInstrumentationTests
public 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 |
runInstrumentationTests
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner,listeners)
Runs instrumentation tests, and provides device recovery.
If connection with device is lost before test run completes, and recovery succeeds, all listeners will be informed of testRunFailed and "false" will be returned. The test command will not be rerun. It is left to callers to retry if necessary.
If connection with device is lost before test run completes, and recovery fails, all listeners will be informed of testRunFailed and DeviceNotAvailableException will be thrown.
पैरामीटर | |
---|---|
runner | IRemoteAndroidTestRunner : the IRemoteAndroidTestRunner which runs the tests |
listeners |
रिटर्न | |
---|---|
boolean | true if test command completed. false if it failed to complete due to device communication exception, but recovery succeeded |
फेंकता | |
---|---|
DeviceNotAvailableException |
runInstrumentationTestsAsUser
public 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 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 |
setConfiguration
public void setConfiguration (IConfiguration configuration)
Injects the IConfiguration
in use.
पैरामीटर | |
---|---|
configuration | IConfiguration |
setConnectionAvdInfo
public final void setConnectionAvdInfo (GceAvdInfo avdInfo)
पैरामीटर | |
---|---|
avdInfo | GceAvdInfo |
setDate
public void setDate (Date date)
Sets the date on device
Note: setting date on device requires root
पैरामीटर | |
---|---|
date | Date : specify a particular date; will use host date if null |
फेंकता | |
---|---|
DeviceNotAvailableException |
setDeviceOwner
public boolean setDeviceOwner (String componentName, int userId)
Set a device admin component as device owner in given user.
पैरामीटर | |
---|---|
componentName | String : of device admin to be device owner. |
userId | int : of the user that the device owner lives in. |
रिटर्न | |
---|---|
boolean | True if it is successful, false otherwise. |
फेंकता | |
---|---|
DeviceNotAvailableException |
setDeviceState
public void setDeviceState (TestDeviceState deviceState)
Update the device's state.
पैरामीटर | |
---|---|
deviceState | TestDeviceState : the TestDeviceState |
setEmulatorOutputStream
public void setEmulatorOutputStream (SizeLimitedOutputStream output)
For emulator set SizeLimitedOutputStream
to log output
पैरामीटर | |
---|---|
output | SizeLimitedOutputStream : to log the output |
setEmulatorProcess
public void setEmulatorProcess (Process p)
Sets the Process
, when this device is an emulator.
पैरामीटर | |
---|---|
p | Process |
setFastbootEnabled
public void setFastbootEnabled (boolean fastbootEnabled)
Set the fastboot option for the device. Should be set when device is first allocated.
पैरामीटर | |
---|---|
fastbootEnabled | boolean : whether fastboot is available for the device or not |
setFastbootPath
public void setFastbootPath (String fastbootPath)
Sets the path to the fastboot binary that should be used. Still requires isFastbootEnabled()
to be true, to have fastboot functions enabled.
पैरामीटर | |
---|---|
fastbootPath | String |
setIDevice
public void setIDevice (IDevice newDevice)
Update the IDevice associated with this ITestDevice.
The new IDevice must refer the same physical device as the current reference. This method will be called if DDMS has allocated a new IDeviceपैरामीटर | |
---|---|
newDevice | IDevice : the IDevice |
setLogStartDelay
public void setLogStartDelay (int delay)
Sets the time in ms to wait before starting logcat capture for a online device.
पैरामीटर | |
---|---|
delay | int : the delay in ms |
setOptions
public void setOptions (TestDeviceOptions options)
Set the TestDeviceOptions
for the device
पैरामीटर | |
---|---|
options | TestDeviceOptions |
setProperty
public boolean setProperty (String propKey, String propValue)
Sets the given property value on the device. Requires adb root is true.
पैरामीटर | |
---|---|
propKey | String : The key targeted to be set. |
propValue | String : The property value to be set. |
रिटर्न | |
---|---|
boolean | returns True if the setprop command was successful, False otherwise. |
फेंकता | |
---|---|
DeviceNotAvailableException |
setRecovery
public 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 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. |
setSetting
public void setSetting (String namespace, String key, String value)
See setSetting(int, String, String, String)
and performed on system user.
पैरामीटर | |
---|---|
namespace | String |
key | String |
value | String |
फेंकता | |
---|---|
DeviceNotAvailableException |
setSetting
public void setSetting (int userId, String namespace, String key, String value)
Add a setting value to the namespace of a given user. Some settings will only be available after a reboot. namespace must be one of: {"system", "secure", "global"}
पैरामीटर | |
---|---|
userId | int |
namespace | String |
key | String |
value | String |
फेंकता | |
---|---|
DeviceNotAvailableException |
setTestLogger
public void setTestLogger (ITestLogger testLogger)
Injects the ITestLogger
instance
पैरामीटर | |
---|---|
testLogger | ITestLogger |
setUseFastbootErase
public 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 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.startUser
public boolean startUser (int userId)
Starts a given user in the background if it is currently stopped. If the user is already running in the background, this method is a NOOP.
पैरामीटर | |
---|---|
userId | int : of the user to start in the background |
रिटर्न | |
---|---|
boolean | true if the user was successfully started in the background. |
फेंकता | |
---|---|
DeviceNotAvailableException |
startUser
public boolean startUser (int userId, boolean waitFlag)
Starts a given user in the background if it is currently stopped. If the user is already running in the background, this method is a NOOP. Possible to provide extra flag to wait for the operation to have effect.
पैरामीटर | |
---|---|
userId | int : of the user to start in the background |
waitFlag | boolean : will make the command wait until user is started and unlocked. |
रिटर्न | |
---|---|
boolean | true if the user was successfully started in the background. |
फेंकता | |
---|---|
DeviceNotAvailableException |
startVisibleBackgroundUser
public boolean startVisibleBackgroundUser (int userId, int displayId, boolean waitFlag)
Starts a given user in the background, visible in the given display (ie, allowing the user to launch activities in that display).
NOTE: this command doesn't check if the user exists, display is available, device supports such feature
, etc.
पैरामीटर | |
---|---|
userId | int : of the user to start in the background |
displayId | int : display to start user visible on |
waitFlag | boolean : will make the command wait until user is started and unlocked. |
रिटर्न | |
---|---|
boolean | true if the user was successfully started visible in the background. |
फेंकता | |
---|---|
DeviceNotAvailableException |
stopEmulatorOutput
public void stopEmulatorOutput ()
Close and delete the emulator output.
stopLogcat
public 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.stopUser
public boolean stopUser (int userId)
Stops a given user. If the user is already stopped, this method is a NOOP. Cannot stop current and system user.
पैरामीटर | |
---|---|
userId | int : of the user to stop. |
रिटर्न | |
---|---|
boolean | true if the user was successfully stopped. |
फेंकता | |
---|---|
DeviceNotAvailableException |
stopUser
public boolean stopUser (int userId, boolean waitFlag, boolean forceFlag)
Stop a given user. Possible to provide extra flags to wait for the operation to have effect, and force terminate the user. Cannot stop current and system user.
पैरामीटर | |
---|---|
userId | int : of the user to stop. |
waitFlag | boolean : will make the command wait until user is stopped. |
forceFlag | boolean : will force stop the user. |
रिटर्न | |
---|---|
boolean | true if the user was successfully stopped. |
फेंकता | |
---|---|
DeviceNotAvailableException |
switchToAdbTcp
public String switchToAdbTcp ()
Switch device to adb-over-tcp mode.
रिटर्न | |
---|---|
String | the tcp serial number or null if device could not be switched |
फेंकता | |
---|---|
DeviceNotAvailableException |
switchToAdbUsb
public boolean switchToAdbUsb ()
Switch device to adb over usb mode.
रिटर्न | |
---|---|
boolean | true if switch was successful, false otherwise. |
फेंकता | |
---|---|
DeviceNotAvailableException |
switchUser
public boolean switchUser (int userId)
Switch to another userId with a default timeout. switchUser(int, long)
.
पैरामीटर | |
---|---|
userId | int |
रिटर्न | |
---|---|
boolean | True if the new userId matches the userId provider. False otherwise. |
फेंकता | |
---|---|
DeviceNotAvailableException |
switchUser
public boolean switchUser (int userId, long timeout)
Switch to another userId with the provided timeout as deadline. Attempt to disable keyguard after user change is successful.
पैरामीटर | |
---|---|
userId | int |
timeout | long : to wait before returning false for switch-user failed. |
रिटर्न | |
---|---|
boolean | True if the new userId matches the userId provider. False otherwise. |
फेंकता | |
---|---|
DeviceNotAvailableException |
syncFiles
public 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 |
takeBugreport
public Bugreport takeBugreport ()
Take a bugreport and returns it inside a Bugreport
object to handle it. Return null in case of issue. File referenced in the Bugreport object need to be cleaned via Bugreport.close()
.
रिटर्न | |
---|---|
Bugreport |
uninstallPackage
public String uninstallPackage (String packageName)
Uninstall an Android package from device.
पैरामीटर | |
---|---|
packageName | String : the Android package to uninstall |
रिटर्न | |
---|---|
String | a String with an error code, or null if success. |
फेंकता | |
---|---|
DeviceNotAvailableException |
uninstallPackageForUser
public String uninstallPackageForUser (String packageName, int userId)
Uninstall an Android package from device for a given user.
पैरामीटर | |
---|---|
packageName | String : the Android package to uninstall |
userId | int : the integer user id to uninstall for. |
रिटर्न | |
---|---|
String | a String with an error code, or null if success. |
फेंकता | |
---|---|
DeviceNotAvailableException |
unlockDevice
public boolean unlockDevice ()
Unlocks the device if the device is in an encrypted state.
This method may restart the framework but will not callpostBootSetup()
. Therefore, the device might not be fully ready to be tested when this method returns.रिटर्न | |
---|---|
boolean | true if successful or if the device is unencrypted. |
फेंकता | |
---|---|
DeviceNotAvailableException |
waitForBootComplete
public boolean waitForBootComplete (long timeOut)
Blocks until the device's boot complete flag is set.
पैरामीटर | |
---|---|
timeOut | long : time in msecs to wait for the flag to be set |
रिटर्न | |
---|---|
boolean | true if device's boot complete flag is set within the timeout |
फेंकता | |
---|---|
DeviceNotAvailableException |
waitForDeviceAvailable
public 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 |
waitForDeviceAvailable
public 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 |
waitForDeviceAvailableInRecoverPath
public 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 |
waitForDeviceBootloader
public void waitForDeviceBootloader ()
Blocks until device is visible via fastboot. Use default timeout.
फेंकता | |
---|---|
DeviceNotAvailableException |
waitForDeviceInRecovery
public 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 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 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 void waitForDeviceOnline ()
Blocks until device is visible via adb. Uses default timeout
Note the device may not necessarily be responsive to commands on completion. UsewaitForDeviceAvailable()
instead.फेंकता | |
---|---|
DeviceNotAvailableException |
waitForDeviceOnline
public void waitForDeviceOnline (long waitTime)
Blocks until device is visible via adb.
Note the device may not necessarily be responsive to commands on completion. UsewaitForDeviceAvailable()
instead.पैरामीटर | |
---|---|
waitTime | long : the time in ms to wait |
फेंकता | |
---|---|
DeviceNotAvailableException |
waitForDeviceShell
public 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. |
संरक्षित तरीके
addExtraConnectionBuilderArgs
protected void addExtraConnectionBuilderArgs (DefaultConnection.ConnectionBuilder builder)
पैरामीटर | |
---|---|
builder | DefaultConnection.ConnectionBuilder |
buildAdbShellCommand
protected String[] buildAdbShellCommand (String command, boolean forceExitStatusDetection)
Builds the OS command for the given adb shell command session and args
पैरामीटर | |
---|---|
command | String |
forceExitStatusDetection | boolean |
रिटर्न | |
---|---|
String[] |
checkApiLevelAgainst
protected void checkApiLevelAgainst (String feature, int strictMinLevel)
पैरामीटर | |
---|---|
feature | String |
strictMinLevel | int |
createRebootDeviceAction
protected NativeDevice.RebootDeviceAction createRebootDeviceAction (NativeDevice.RebootMode rebootMode, String reason)
Create a RebootDeviceAction
to be used when performing a reboot action.
पैरामीटर | |
---|---|
rebootMode | NativeDevice.RebootMode : a mode of this reboot. |
reason | String : for this reboot. |
रिटर्न | |
---|---|
NativeDevice.RebootDeviceAction | the created RebootDeviceAction . |
doAdbReboot
protected void doAdbReboot (NativeDevice.RebootMode rebootMode, String reason)
Perform a adb reboot.
पैरामीटर | |
---|---|
rebootMode | NativeDevice.RebootMode : a mode of this reboot. |
reason | String : for this reboot. |
फेंकता | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
ensureRuntimePermissionSupported
protected void ensureRuntimePermissionSupported ()
helper method to throw exception if runtime permission isn't supported
फेंकता | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
getApiLevelSafe
protected int getApiLevelSafe ()
रिटर्न | |
---|---|
int |
initializeConnection
protected void initializeConnection (IBuildInfo info, MultiMap<String, String> attributes)
पैरामीटर | |
---|---|
info | IBuildInfo |
attributes | MultiMap |
फेंकता | |
---|---|
DeviceNotAvailableException | |
TargetSetupError |
internalGetProperty
protected String internalGetProperty (String propName, String fastbootVar, String description)
Fetch a device property, from the ddmlib cache by default, and falling back to either `adb shell getprop` or `fastboot getvar` depending on whether the device is in Fastboot or not.
पैरामीटर | |
---|---|
propName | String : The name of the device property as returned by `adb shell getprop` |
fastbootVar | String : The name of the equivalent fastboot variable to query. if null , fastboot query will not be attempted |
description | String : A simple description of the variable. First letter should be capitalized. |
रिटर्न | |
---|---|
String | A string, possibly null or empty, containing the value of the given property |
फेंकता | |
---|---|
DeviceNotAvailableException |
isInRebootCallback
protected boolean isInRebootCallback ()
Returns whether reboot callbacks is currently being executed or not. All public api's for reboot should be disabled if true.
रिटर्न | |
---|---|
boolean |
isNewer
protected boolean isNewer (File localFile, IFileEntry entry)
Return true
if local file is newer than remote file. IFileEntry
being accurate to the minute, in case of equal times, the file will be considered newer.
पैरामीटर | |
---|---|
localFile | File |
entry | IFileEntry |
रिटर्न | |
---|---|
boolean |
notifyRebootEnded
protected void notifyRebootEnded ()
Notifies all IDeviceActionReceiver
about reboot end event.
फेंकता | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
notifyRebootStarted
protected void notifyRebootStarted ()
Notifies all IDeviceActionReceiver
about reboot start event.
फेंकता | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
performDeviceAction
protected boolean performDeviceAction (String actionDescription, NativeDevice.DeviceAction action, int retryAttempts)
Performs an action on this device. Attempts to recover device and optionally retry command if action fails.
पैरामीटर | |
---|---|
actionDescription | String : a short description of action to be performed. Used for logging purposes only. |
action | NativeDevice.DeviceAction : the action to be performed |
retryAttempts | int : the retry attempts to make for action if it fails but recovery succeeds |
रिटर्न | |
---|---|
boolean | true if action was performed successfully |
फेंकता | |
---|---|
DeviceNotAvailableException | if recovery attempt fails or max attempts done without success |
postAdbReboot
protected void postAdbReboot ()
Possible extra actions that can be taken after a reboot.
फेंकता | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
prePostBootSetup
protected void prePostBootSetup ()
Allows each device type (AndroidNativeDevice, TestDevice) to override this method for specific post boot setup.
फेंकता | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
pullFileInternal
protected boolean pullFileInternal (String remoteFilePath, File localFile)
पैरामीटर | |
---|---|
remoteFilePath | String |
localFile | File |
रिटर्न | |
---|---|
boolean |
फेंकता | |
---|---|
DeviceNotAvailableException |
setClock
protected void setClock (Clock clock)
Set the Clock instance to use.
पैरामीटर | |
---|---|
clock | Clock |
setMicrodroidProcess
protected void setMicrodroidProcess (Process process)
Marks the TestDevice as microdroid and sets its CID.
पैरामीटर | |
---|---|
process | Process : Process of the Microdroid VM. |
setTestDeviceOptions
protected void setTestDeviceOptions (deviceOptions)
पैरामीटर | |
---|---|
deviceOptions |
simpleFastbootCommand
protected CommandResult simpleFastbootCommand (long timeout,envVarMap, String[] fullCmd)
Executes a simple fastboot command with environment variables and report the status of the command.
पैरामीटर | |
---|---|
timeout | long |
envVarMap | |
fullCmd | String |
रिटर्न | |
---|---|
CommandResult |
simpleFastbootCommand
protected CommandResult simpleFastbootCommand (long timeout, String[] fullCmd)
Executes a simple fastboot command and report the status of the command.
पैरामीटर | |
---|---|
timeout | long |
fullCmd | String |
रिटर्न | |
---|---|
CommandResult |
waitForDeviceNotAvailable
protected boolean waitForDeviceNotAvailable (String operationDesc, long time)
Wait to see the device going unavailable (stop reporting to adb).
पैरामीटर | |
---|---|
operationDesc | String : The name of the operation that is waiting for unavailable. |
time | long : The time to wait for unavailable to occur. |
रिटर्न | |
---|---|
boolean | True if device did become unavailable. |
इस पेज पर मौजूद कॉन्टेंट और कोड सैंपल कॉन्टेंट के लाइसेंस में बताए गए लाइसेंस के हिसाब से हैं. Java और OpenJDK, Oracle और/या इससे जुड़ी हुई कंपनियों के ट्रेडमार्क या रजिस्टर किए हुए ट्रेडमार्क हैं.
आखिरी बार 2023-07-19 (UTC) को अपडेट किया गया.