テストデバイス
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 () |
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)
パブリックメソッド
クリアエラーダイアログ
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 | |
キーガードを無効にする
public void disableKeyguard ()
投げる |
---|
DeviceNotAvailableException | |
ファイルが存在しますか
public boolean doesFileExist (String deviceFilePath)
パラメーター |
---|
deviceFilePath | String |
投げる |
---|
DeviceNotAvailableException | |
ダンプヒープ
public File dumpHeap (String process,
String devicePath)
パラメーター |
---|
process | String |
devicePath | String |
投げる |
---|
DeviceNotAvailableException | |
getActiveApexes
public getActiveApexes ()
投げる |
---|
DeviceNotAvailableException | |
すべての設定を取得
public getAllSettings (String namespace)
投げる |
---|
DeviceNotAvailableException | |
AndroidIdを取得する
public String getAndroidId (int userId)
投げる |
---|
DeviceNotAvailableException | |
AndroidID を取得する
public getAndroidIds ()
投げる |
---|
DeviceNotAvailableException | |
getAppPackageInfo
public PackageInfo getAppPackageInfo (String packageName)
投げる |
---|
DeviceNotAvailableException | |
getAppPackageInfos
public getAppPackageInfos ()
投げる |
---|
DeviceNotAvailableException | |
getCurrentFoldableState
public DeviceFoldableState getCurrentFoldableState ()
投げる |
---|
DeviceNotAvailableException | |
現在のユーザーを取得
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 ()
投げる |
---|
DeviceNotAvailableException | |
スクリーンショットの取得
public InputStreamSource getScreenshot (String format,
boolean rescale)
パラメーター |
---|
format | String |
rescale | boolean |
投げる |
---|
DeviceNotAvailableException | |
スクリーンショットの取得
public InputStreamSource getScreenshot (String format)
投げる |
---|
DeviceNotAvailableException | |
スクリーンショットの取得
public InputStreamSource getScreenshot (long displayId)
投げる |
---|
DeviceNotAvailableException | |
設定の取得
public String getSetting (String namespace,
String key)
パラメーター |
---|
namespace | String |
key | String |
投げる |
---|
DeviceNotAvailableException | |
設定の取得
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 | |
ユーザー情報の取得
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 | |
ユーザー向けのインストールパッケージ
public String installPackageForUser (File packageFile,
boolean reinstall,
boolean grantPermissions,
int userId,
String... extraArgs)
パラメーター |
---|
packageFile | File |
reinstall | boolean |
grantPermissions | boolean |
userId | int |
extraArgs | String |
投げる |
---|
DeviceNotAvailableException | |
ユーザー向けのインストールパッケージ
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 | |
ユーザー向けのインストールパッケージ
public String installPackagesForUser ( packageFiles,
boolean reinstall,
boolean grantPermissions,
int userId,
String... extraArgs)
パラメーター |
---|
packageFiles | |
reinstall | boolean |
grantPermissions | boolean |
userId | int |
extraArgs | String |
投げる |
---|
DeviceNotAvailableException | |
ユーザー向けのインストールパッケージ
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 | |
マルチユーザーサポートです
public boolean isMultiUserSupported ()
投げる |
---|
DeviceNotAvailableException | |
パッケージがインストールされています
public boolean isPackageInstalled (String packageName)
投げる |
---|
DeviceNotAvailableException | |
パッケージがインストールされています
public boolean isPackageInstalled (String packageName,
String userId)
パラメーター |
---|
packageName | String |
userId | String |
投げる |
---|
DeviceNotAvailableException | |
ユーザーが実行中です
public boolean isUserRunning (int userId)
投げる |
---|
DeviceNotAvailableException | |
isUserSecondary
public boolean isUserSecondary (int userId)
投げる |
---|
DeviceNotAvailableException | |
listDisplayIds
public listDisplayIds ()
投げる |
---|
DeviceNotAvailableException | |
ユーザーのリスト
public listUsers ()
投げる |
---|
DeviceNotAvailableException | |
post呼び出しTearDown
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 | |
セット設定
public void setSetting (String namespace,
String key,
String value)
パラメーター |
---|
namespace | String |
key | String |
value | String |
投げる |
---|
DeviceNotAvailableException | |
セット設定
public void setSetting (int userId,
String namespace,
String key,
String value)
パラメーター |
---|
userId | int |
namespace | String |
key | String |
value | String |
投げる |
---|
DeviceNotAvailableException | |
スタートユーザー
public boolean startUser (int userId)
投げる |
---|
DeviceNotAvailableException | |
スタートユーザー
public boolean startUser (int userId,
boolean waitFlag)
パラメーター |
---|
userId | int |
waitFlag | boolean |
投げる |
---|
DeviceNotAvailableException | |
停止ユーザー
public boolean stopUser (int userId,
boolean waitFlag,
boolean forceFlag)
パラメーター |
---|
userId | int |
waitFlag | boolean |
forceFlag | boolean |
投げる |
---|
DeviceNotAvailableException | |
停止ユーザー
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)
投げる |
---|
DeviceNotAvailableException | |
アンインストールパッケージユーザー用
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 ()
テストのために露出しました。
getホスト現在時刻
protected long getHostCurrentTime ()
テストのために暴露された
ブート後のセットアップ
protected void prePostBootSetup ()
各デバイス タイプ (AndroidNativeDevice、TestDevice) が特定の起動後のセットアップ用にこのメソッドをオーバーライドできるようにします。
投げる |
---|
DeviceNotAvailableException | |