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 | |
غیر فعال کردن Keyguard
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 | |
getScreenshot
public InputStreamSource getScreenshot ()
برمی گردد |
---|
InputStreamSource | |
پرتاب می کند |
---|
DeviceNotAvailableException | |
getScreenshot
public InputStreamSource getScreenshot (String format,
boolean rescale)
مولفه های |
---|
format | String |
rescale | boolean |
برمی گردد |
---|
InputStreamSource | |
پرتاب می کند |
---|
DeviceNotAvailableException | |
getScreenshot
public InputStreamSource getScreenshot (String format)
برمی گردد |
---|
InputStreamSource | |
پرتاب می کند |
---|
DeviceNotAvailableException | |
getScreenshot
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 | |
getUninstallablePackageNames
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 | |
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 | |
isPackage نصب شده است
public boolean isPackageInstalled (String packageName)
مولفه های |
---|
packageName | String |
پرتاب می کند |
---|
DeviceNotAvailableException | |
isPackage نصب شده است
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 | |
postIvococTearDown
public void postInvocationTearDown (Throwable exception)
مولفه های |
---|
exception | Throwable |
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)
مولفه های |
---|
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 | |