TestDevice
public class TestDevice
extends NativeDevice
フルスタックAndroidデバイス用のITestDevice
実装
概要
パブリックメソッド |
---|
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 () |
int | getCurrentUser () |
| getInstalledPackageNames () |
KeyguardControllerState | getKeyguardState () |
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) |
田畑
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)
投げる |
---|
DeviceNotAvailableException | |
getAppPackageInfos
public getAppPackageInfos ()
投げる |
---|
DeviceNotAvailableException | |
getCurrentUser
public int getCurrentUser ()
投げる |
---|
DeviceNotAvailableException | |
getInstalledPackageNames
public getInstalledPackageNames ()
投げる |
---|
DeviceNotAvailableException | |
getKeyguardState
public KeyguardControllerState getKeyguardState ()
戻り値 |
---|
KeyguardControllerState | |
投げる |
---|
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 | |
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 | |
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)
パラメーター |
---|
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 | |
switchUser
public boolean switchUser (int userId)
投げる |
---|
DeviceNotAvailableException | |
switchUser
public boolean switchUser (int userId,
long timeout)
パラメーター |
---|
userId | int |
timeout | long |
投げる |
---|
DeviceNotAvailableException | |
UninstallPackage
public String uninstallPackage (String packageName)
投げる |
---|
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 | |