TestDevice
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
دستوراتی که می توان از آنها برای حذف صفحه کلید استفاده کرد.
سازندگان عمومی
TestDevice
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 | |
غیرفعال کردن کیگارد
public void disableKeyguard ()
پرتاب می کند |
---|
DeviceNotAvailableException | |
doesFileExist
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)
مولفه های |
---|
namespace | String |
پرتاب می کند |
---|
DeviceNotAvailableException | |
getAndroidId
public String getAndroidId (int userId)
پرتاب می کند |
---|
DeviceNotAvailableException | |
getAndroidIds
public getAndroidIds ()
پرتاب می کند |
---|
DeviceNotAvailableException | |
getAppPackageInfo
public PackageInfo getAppPackageInfo (String packageName)
مولفه های |
---|
packageName | String |
پرتاب می کند |
---|
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 | |
دریافت اسکرین شات
public InputStreamSource getScreenshot ()
برمی گرداند |
---|
InputStreamSource | |
پرتاب می کند |
---|
DeviceNotAvailableException | |
دریافت اسکرین شات
public InputStreamSource getScreenshot (String format,
boolean rescale)
مولفه های |
---|
format | String |
rescale | boolean |
برمی گرداند |
---|
InputStreamSource | |
پرتاب می کند |
---|
DeviceNotAvailableException | |
دریافت اسکرین شات
public InputStreamSource getScreenshot (String format)
برمی گرداند |
---|
InputStreamSource | |
پرتاب می کند |
---|
DeviceNotAvailableException | |
دریافت اسکرین شات
public InputStreamSource getScreenshot (long displayId)
برمی گرداند |
---|
InputStreamSource | |
پرتاب می کند |
---|
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 | |
getUninstalablePackageNames
public getUninstallablePackageNames ()
پرتاب می کند |
---|
DeviceNotAvailableException | |
getUserFlags
public int getUserFlags (int userId)
پرتاب می کند |
---|
DeviceNotAvailableException | |
getUserInfos
public getUserInfos ()
پرتاب می کند |
---|
DeviceNotAvailableException | |
getUserSerialNumber
public int getUserSerialNumber (int userId)
پرتاب می کند |
---|
DeviceNotAvailableException | |
دارای ویژگی
public boolean hasFeature (String feature)
پرتاب می کند |
---|
DeviceNotAvailableException | |
installPackage
public String installPackage (File packageFile,
boolean reinstall,
String... extraArgs)
مولفه های |
---|
packageFile | File |
reinstall | boolean |
extraArgs | String |
پرتاب می کند |
---|
DeviceNotAvailableException | |
installPackage
public String installPackage (File packageFile,
File certFile,
boolean reinstall,
String... extraArgs)
مولفه های |
---|
packageFile | File |
certFile | File |
reinstall | boolean |
extraArgs | String |
پرتاب می کند |
---|
DeviceNotAvailableException | |
installPackage
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 | |
RemotePackages را نصب کنید
public String installRemotePackages ( remoteApkPaths,
boolean reinstall,
boolean grantPermissions,
String... extraArgs)
مولفه های |
---|
remoteApkPaths | |
reinstall | boolean |
grantPermissions | boolean |
extraArgs | String |
پرتاب می کند |
---|
DeviceNotAvailableException | |
RemotePackages را نصب کنید
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)
مولفه های |
---|
packageName | String |
پرتاب می کند |
---|
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 | |
لیست کاربران
public listUsers ()
پرتاب می کند |
---|
DeviceNotAvailableException | |
postInvocationTearDown
public void postInvocationTearDown (Throwable exception)
مولفه های |
---|
exception | Throwable |
حذف ادمین
public boolean removeAdmin (String componentName,
int userId)
مولفه های |
---|
componentName | String |
userId | int |
پرتاب می کند |
---|
DeviceNotAvailableException | |
حذف مالکان
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)
مولفه های |
---|
packageName | String |
پرتاب می کند |
---|
DeviceNotAvailableException | |
uninstallPackageForUser
public String uninstallPackageForUser (String packageName,
int userId)
مولفه های |
---|
packageName | String |
userId | int |
پرتاب می کند |
---|
DeviceNotAvailableException | |
روش های محافظت شده
doAdbReboot
protected void doAdbReboot (NativeDevice.RebootMode rebootMode,
String reason)
یک راه اندازی مجدد adb انجام دهید.
مولفه های |
---|
rebootMode | NativeDevice.RebootMode : حالتی از این راهاندازی مجدد. |
reason | String : برای این راه اندازی مجدد. |
پرتاب می کند |
---|
DeviceNotAvailableException | |
getCheckNewUserSleep
protected long getCheckNewUserSleep ()
در معرض آزمایش قرار گرفته است.
getHostCurrentTime
protected long getHostCurrentTime ()
در معرض آزمایش قرار گرفته است
prePostBootSetup
protected void prePostBootSetup ()
به هر نوع دستگاه (AndroidNativeDevice، TestDevice) اجازه میدهد این روش را برای راهاندازی خاص پس از بوت لغو کند.
پرتاب می کند |
---|
DeviceNotAvailableException | |