جهاز اختبار
public class TestDevice
extends NativeDevice
الفئات الفرعية المباشرة المعروفة |
الفئات الفرعية غير المباشرة المعروفة |
تنفيذ ITestDevice
لجهاز أندرويد كامل المكدس
ملخص
مجالات |
---|
public static final String | DISMISS_KEYGUARD_CMD الأوامر التي يمكن استخدامها لإغلاق حارس المفاتيح. |
الأساليب العامة |
---|
boolean | clearErrorDialogs () |
int | createUser (String name) |
int | createUser (String name, boolean guest, boolean ephemeral) |
int | createUserNoThrow (String name) |
void | disableKeyguard () |
boolean | doesFileExist (String deviceFilePath) |
File | dumpHeap (String process, String devicePath) |
| getActiveApexes () |
| getAllSettings (String namespace) |
String | getAndroidId (int userId) |
| getAndroidIds () |
PackageInfo | getAppPackageInfo (String packageName) |
| getAppPackageInfos () |
DeviceFoldableState | getCurrentFoldableState () |
int | getCurrentUser () |
| getFoldableStates () |
| getInstalledPackageNames () |
KeyguardControllerState | getKeyguardState () |
| getMainlineModuleInfo () |
int | getMaxNumberOfRunningUsersSupported () |
int | getMaxNumberOfUsersSupported () |
Integer | getPrimaryUserId () |
InputStreamSource | getScreenshot () |
InputStreamSource | getScreenshot (String format, boolean rescale) |
InputStreamSource | getScreenshot (String format) |
InputStreamSource | getScreenshot (long displayId) |
String | getSetting (String namespace, String key) |
String | getSetting (int userId, String namespace, String key) |
| getUninstallablePackageNames () |
int | getUserFlags (int userId) |
| getUserInfos () |
int | getUserSerialNumber (int userId) |
boolean | hasFeature (String feature) |
String | installPackage (File packageFile, boolean reinstall, String... extraArgs) |
String | installPackage (File packageFile, File certFile, boolean reinstall, String... extraArgs) |
String | installPackage (File packageFile, boolean reinstall, boolean grantPermissions, String... extraArgs) |
String | installPackageForUser (File packageFile, boolean reinstall, boolean grantPermissions, int userId, String... extraArgs) |
String | installPackageForUser (File packageFile, boolean reinstall, int userId, String... extraArgs) |
String | installPackages ( packageFiles, boolean reinstall, String... extraArgs) installPackages ( packageFiles, boolean reinstall, String... extraArgs) |
String | installPackages ( packageFiles, boolean reinstall, boolean grantPermissions, String... extraArgs) installPackages ( packageFiles, boolean reinstall, boolean grantPermissions, String... extraArgs) |
String | installPackagesForUser ( packageFiles, boolean reinstall, boolean grantPermissions, int userId, String... extraArgs) installPackagesForUser ( packageFiles, boolean reinstall, boolean grantPermissions, int userId, String... extraArgs) |
String | installPackagesForUser ( packageFiles, boolean reinstall, int userId, String... extraArgs) installPackagesForUser ( packageFiles, boolean reinstall, int userId, String... extraArgs) |
String | installRemotePackages ( remoteApkPaths, boolean reinstall, boolean grantPermissions, String... extraArgs) installRemotePackages ( remoteApkPaths, boolean reinstall, boolean grantPermissions, String... extraArgs) |
String | installRemotePackages ( remoteApkPaths, boolean reinstall, String... extraArgs) installRemotePackages ( remoteApkPaths, boolean reinstall, String... extraArgs) |
boolean | isAppEnumerationSupported () |
boolean | isMultiUserSupported () |
boolean | isPackageInstalled (String packageName) |
boolean | isPackageInstalled (String packageName, String userId) |
boolean | isUserRunning (int userId) |
boolean | isUserSecondary (int userId) |
| listDisplayIds () |
| listUsers () |
void | postInvocationTearDown (Throwable exception) |
boolean | removeAdmin (String componentName, int userId) |
void | removeOwners () |
boolean | removeUser (int userId) |
boolean | setDeviceOwner (String componentName, int userId) |
void | setSetting (String namespace, String key, String value) |
void | setSetting (int userId, String namespace, String key, String value) |
boolean | startUser (int userId) |
boolean | startUser (int userId, boolean waitFlag) |
boolean | stopUser (int userId, boolean waitFlag, boolean forceFlag) |
boolean | stopUser (int userId) |
boolean | switchUser (int userId) |
boolean | switchUser (int userId, long timeout) |
String | uninstallPackage (String packageName) |
String | uninstallPackageForUser (String packageName, int userId) |
مجالات
DISMISS_KEYGUARD_CMD
public static final String DISMISS_KEYGUARD_CMD
الأوامر التي يمكن استخدامها لإغلاق حارس المفاتيح.
المقاولين العامة
جهاز اختبار
public TestDevice (IDevice device,
IDeviceStateMonitor stateMonitor,
IDeviceMonitor allocationMonitor)
الأساليب العامة
ClearErrorDialogs
public boolean clearErrorDialogs ()
رميات |
---|
DeviceNotAvailableException | |
createUser
public int createUser (String name)
رميات |
---|
DeviceNotAvailableException | |
createUser
public int createUser (String name,
boolean guest,
boolean ephemeral)
حدود |
---|
name | String |
guest | boolean |
ephemeral | boolean |
رميات |
---|
DeviceNotAvailableException | |
createUserNoThrow
public int createUserNoThrow (String name)
رميات |
---|
DeviceNotAvailableException | |
dableKeyguard
public void disableKeyguard ()
رميات |
---|
DeviceNotAvailableException | |
doFileExist
public boolean doesFileExist (String deviceFilePath)
حدود |
---|
deviceFilePath | String |
رميات |
---|
DeviceNotAvailableException | |
dumpHeap
public File dumpHeap (String process,
String devicePath)
حدود |
---|
process | String |
devicePath | String |
رميات |
---|
DeviceNotAvailableException | |
getActiveApexes
public getActiveApexes ()
رميات |
---|
DeviceNotAvailableException | |
getAllSettings
public getAllSettings (String namespace)
رميات |
---|
DeviceNotAvailableException | |
getAndroidId
public String getAndroidId (int userId)
رميات |
---|
DeviceNotAvailableException | |
getAndroidIds
public getAndroidIds ()
رميات |
---|
DeviceNotAvailableException | |
getAppPackageInfo
public PackageInfo getAppPackageInfo (String packageName)
رميات |
---|
DeviceNotAvailableException | |
getAppPackageInfos
public getAppPackageInfos ()
رميات |
---|
DeviceNotAvailableException | |
getCurrentFoldableState
public DeviceFoldableState getCurrentFoldableState ()
عائدات |
---|
DeviceFoldableState | |
رميات |
---|
DeviceNotAvailableException | |
getCurrentUser
public int getCurrentUser ()
رميات |
---|
DeviceNotAvailableException | |
getFoldableStates
public getFoldableStates ()
رميات |
---|
DeviceNotAvailableException | |
getInstalledPackageNames
public getInstalledPackageNames ()
رميات |
---|
DeviceNotAvailableException | |
getKeyguardState
public KeyguardControllerState getKeyguardState ()
عائدات |
---|
KeyguardControllerState | |
رميات |
---|
DeviceNotAvailableException | |
getMainlineModuleInfo
public getMainlineModuleInfo ()
رميات |
---|
DeviceNotAvailableException | |
public int getMaxNumberOfRunningUsersSupported ()
رميات |
---|
DeviceNotAvailableException | |
public int getMaxNumberOfUsersSupported ()
رميات |
---|
DeviceNotAvailableException | |
getPrimaryUserId
public Integer getPrimaryUserId ()
رميات |
---|
DeviceNotAvailableException | |
getScreenshot
public InputStreamSource getScreenshot ()
رميات |
---|
DeviceNotAvailableException | |
getScreenshot
public InputStreamSource getScreenshot (String format,
boolean rescale)
حدود |
---|
format | String |
rescale | boolean |
رميات |
---|
DeviceNotAvailableException | |
getScreenshot
public InputStreamSource getScreenshot (String format)
رميات |
---|
DeviceNotAvailableException | |
getScreenshot
public InputStreamSource getScreenshot (long displayId)
رميات |
---|
DeviceNotAvailableException | |
getSetting
public String getSetting (String namespace,
String key)
حدود |
---|
namespace | String |
key | String |
رميات |
---|
DeviceNotAvailableException | |
getSetting
public String getSetting (int userId,
String namespace,
String key)
حدود |
---|
userId | int |
namespace | String |
key | String |
رميات |
---|
DeviceNotAvailableException | |
getUninstallablePackageNames
public getUninstallablePackageNames ()
رميات |
---|
DeviceNotAvailableException | |
getUserFlags
public int getUserFlags (int userId)
رميات |
---|
DeviceNotAvailableException | |
getUserInfos
public getUserInfos ()
رميات |
---|
DeviceNotAvailableException | |
getUserSerialNumber
public int getUserSerialNumber (int userId)
رميات |
---|
DeviceNotAvailableException | |
hasFeature
public boolean hasFeature (String feature)
رميات |
---|
DeviceNotAvailableException | |
ثبت المجموعة
public String installPackage (File packageFile,
boolean reinstall,
String... extraArgs)
حدود |
---|
packageFile | File |
reinstall | boolean |
extraArgs | String |
رميات |
---|
DeviceNotAvailableException | |
ثبت المجموعة
public String installPackage (File packageFile,
File certFile,
boolean reinstall,
String... extraArgs)
حدود |
---|
packageFile | File |
certFile | File |
reinstall | boolean |
extraArgs | String |
رميات |
---|
DeviceNotAvailableException | |
ثبت المجموعة
public String installPackage (File packageFile,
boolean reinstall,
boolean grantPermissions,
String... extraArgs)
حدود |
---|
packageFile | File |
reinstall | boolean |
grantPermissions | boolean |
extraArgs | String |
رميات |
---|
DeviceNotAvailableException | |
installPackageForUser
public String installPackageForUser (File packageFile,
boolean reinstall,
boolean grantPermissions,
int userId,
String... extraArgs)
حدود |
---|
packageFile | File |
reinstall | boolean |
grantPermissions | boolean |
userId | int |
extraArgs | String |
رميات |
---|
DeviceNotAvailableException | |
installPackageForUser
public String installPackageForUser (File packageFile,
boolean reinstall,
int userId,
String... extraArgs)
حدود |
---|
packageFile | File |
reinstall | boolean |
userId | int |
extraArgs | String |
رميات |
---|
DeviceNotAvailableException | |
installPackages
public String installPackages ( packageFiles,
boolean reinstall,
String... extraArgs)
حدود |
---|
packageFiles | |
reinstall | boolean |
extraArgs | String |
رميات |
---|
DeviceNotAvailableException | |
installPackages
public String installPackages ( packageFiles,
boolean reinstall,
boolean grantPermissions,
String... extraArgs)
حدود |
---|
packageFiles | |
reinstall | boolean |
grantPermissions | boolean |
extraArgs | String |
رميات |
---|
DeviceNotAvailableException | |
installPackagesForUser
public String installPackagesForUser ( packageFiles,
boolean reinstall,
boolean grantPermissions,
int userId,
String... extraArgs)
حدود |
---|
packageFiles | |
reinstall | boolean |
grantPermissions | boolean |
userId | int |
extraArgs | String |
رميات |
---|
DeviceNotAvailableException | |
installPackagesForUser
public String installPackagesForUser ( packageFiles,
boolean reinstall,
int userId,
String... extraArgs)
حدود |
---|
packageFiles | |
reinstall | boolean |
userId | int |
extraArgs | String |
رميات |
---|
DeviceNotAvailableException | |
installRemotePackages
public String installRemotePackages ( remoteApkPaths,
boolean reinstall,
boolean grantPermissions,
String... extraArgs)
حدود |
---|
remoteApkPaths | |
reinstall | boolean |
grantPermissions | boolean |
extraArgs | String |
رميات |
---|
DeviceNotAvailableException | |
installRemotePackages
public String installRemotePackages ( remoteApkPaths,
boolean reinstall,
String... extraArgs)
حدود |
---|
remoteApkPaths | |
reinstall | boolean |
extraArgs | String |
رميات |
---|
DeviceNotAvailableException | |
isAppEnumerationSupported
public boolean isAppEnumerationSupported ()
رميات |
---|
DeviceNotAvailableException | |
isMultiUserSupported
public boolean isMultiUserSupported ()
رميات |
---|
DeviceNotAvailableException | |
isPackageInstalled
public boolean isPackageInstalled (String packageName)
رميات |
---|
DeviceNotAvailableException | |
isPackageInstalled
public boolean isPackageInstalled (String packageName,
String userId)
حدود |
---|
packageName | String |
userId | String |
رميات |
---|
DeviceNotAvailableException | |
isUserRunning
public boolean isUserRunning (int userId)
رميات |
---|
DeviceNotAvailableException | |
isUserSecondary
public boolean isUserSecondary (int userId)
رميات |
---|
DeviceNotAvailableException | |
listDisplayIds
public listDisplayIds ()
رميات |
---|
DeviceNotAvailableException | |
listUsers
public listUsers ()
رميات |
---|
DeviceNotAvailableException | |
postInvocationTearDown
public void postInvocationTearDown (Throwable exception)
RemoveAdmin
public boolean removeAdmin (String componentName,
int userId)
حدود |
---|
componentName | String |
userId | int |
رميات |
---|
DeviceNotAvailableException | |
RemoveOwners
public void removeOwners ()
رميات |
---|
DeviceNotAvailableException | |
RemoveUser
public boolean removeUser (int userId)
رميات |
---|
DeviceNotAvailableException | |
setDeviceOwner
public boolean setDeviceOwner (String componentName,
int userId)
حدود |
---|
componentName | String |
userId | int |
رميات |
---|
DeviceNotAvailableException | |
setSetting
public void setSetting (String namespace,
String key,
String value)
حدود |
---|
namespace | String |
key | String |
value | String |
رميات |
---|
DeviceNotAvailableException | |
setSetting
public void setSetting (int userId,
String namespace,
String key,
String value)
حدود |
---|
userId | int |
namespace | String |
key | String |
value | String |
رميات |
---|
DeviceNotAvailableException | |
startUser
public boolean startUser (int userId)
رميات |
---|
DeviceNotAvailableException | |
startUser
public boolean startUser (int userId,
boolean waitFlag)
حدود |
---|
userId | int |
waitFlag | boolean |
رميات |
---|
DeviceNotAvailableException | |
stopUser
public boolean stopUser (int userId,
boolean waitFlag,
boolean forceFlag)
حدود |
---|
userId | int |
waitFlag | boolean |
forceFlag | boolean |
رميات |
---|
DeviceNotAvailableException | |
stopUser
public boolean stopUser (int userId)
رميات |
---|
DeviceNotAvailableException | |
تغير المستخدم
public boolean switchUser (int userId)
رميات |
---|
DeviceNotAvailableException | |
تغير المستخدم
public boolean switchUser (int userId,
long timeout)
حدود |
---|
userId | int |
timeout | long |
رميات |
---|
DeviceNotAvailableException | |
uninstallPackage
public String uninstallPackage (String packageName)
رميات |
---|
DeviceNotAvailableException | |
إلغاء التثبيتPackageForUser
public String uninstallPackageForUser (String packageName,
int userId)
حدود |
---|
packageName | String |
userId | int |
رميات |
---|
DeviceNotAvailableException | |
الأساليب المحمية
doAdbReboot
protected void doAdbReboot (NativeDevice.RebootMode rebootMode,
String reason)
إجراء إعادة تشغيل بنك التنمية الآسيوي.
حدود |
---|
rebootMode | NativeDevice.RebootMode : وضع إعادة التشغيل هذا. |
reason | String : لإعادة التشغيل هذه. |
رميات |
---|
DeviceNotAvailableException | |
getCheckNewUserSleep
protected long getCheckNewUserSleep ()
تعرض للاختبار.
getHostCurrentTime
protected long getHostCurrentTime ()
تعرض للاختبار
prePostBootSetup
protected void prePostBootSetup ()
يسمح لكل نوع جهاز (AndroidNativeDevice، TestDevice) بتجاوز هذه الطريقة لإعداد محدد بعد التمهيد.
رميات |
---|
DeviceNotAvailableException | |