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 | |
צור משתמש
public int createUser (String name)
זורק |
---|
DeviceNotAvailableException | |
צור משתמש
public int createUser (String name,
boolean guest,
boolean ephemeral)
פרמטרים |
---|
name | String |
guest | boolean |
ephemeral | boolean |
זורק |
---|
DeviceNotAvailableException | |
createUserNoThrow
public int createUserNoThrow (String name)
זורק |
---|
DeviceNotAvailableException | |
disableKeyguard
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)
זורק |
---|
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 | |
get Screenshot
public InputStreamSource getScreenshot ()
זורק |
---|
DeviceNotAvailableException | |
get Screenshot
public InputStreamSource getScreenshot (String format,
boolean rescale)
פרמטרים |
---|
format | String |
rescale | boolean |
זורק |
---|
DeviceNotAvailableException | |
get Screenshot
public InputStreamSource getScreenshot (String format)
זורק |
---|
DeviceNotAvailableException | |
get Screenshot
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 | |
יש תכונה
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 | |
התקנת חבילות
public String installPackages ( packageFiles,
boolean reinstall,
String... extraArgs)
פרמטרים |
---|
packageFiles | |
reinstall | boolean |
extraArgs | String |
זורק |
---|
DeviceNotAvailableException | |
התקנת חבילות
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 | |
הסר משתמש
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 | |
הסר את חבילת ההתקנה
public String uninstallPackage (String packageName)
פרמטרים |
---|
packageName | String |
זורק |
---|
DeviceNotAvailableException | |
הסר את ההתקנה שלPackageForUser
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 | |