테스트 장치
public class TestDevice
extends NativeDevice
(A)의 구현 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)
공개 메서드
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 | |
비활성화 키가드
public void disableKeyguard ()
던지다 |
---|
DeviceNotAvailableException | |
파일 존재
public boolean doesFileExist (String deviceFilePath)
매개변수 |
---|
deviceFilePath | String |
던지다 |
---|
DeviceNotAvailableException | |
덤프힙
public File dumpHeap (String process,
String devicePath)
매개변수 |
---|
process | String |
devicePath | String |
던지다 |
---|
DeviceNotAvailableException | |
getActive에이펙스
public getActiveApexes ()
던지다 |
---|
DeviceNotAvailableException | |
모든 설정 가져오기
public getAllSettings (String namespace)
던지다 |
---|
DeviceNotAvailableException | |
getAndroidId
public String getAndroidId (int userId)
던지다 |
---|
DeviceNotAvailableException | |
getAndroidIds
public getAndroidIds ()
던지다 |
---|
DeviceNotAvailableException | |
getApp 패키지 정보
public PackageInfo getAppPackageInfo (String packageName)
던지다 |
---|
DeviceNotAvailableException | |
getApp 패키지 정보
public getAppPackageInfos ()
던지다 |
---|
DeviceNotAvailableException | |
getCurrentFoldableState
public DeviceFoldableState getCurrentFoldableState ()
던지다 |
---|
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 ()
던지다 |
---|
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 | |
설치 패키지
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 | |
원격 패키지 설치
public String installRemotePackages ( remoteApkPaths,
boolean reinstall,
boolean grantPermissions,
String... extraArgs)
매개변수 |
---|
remoteApkPaths | |
reinstall | boolean |
grantPermissions | boolean |
extraArgs | String |
던지다 |
---|
DeviceNotAvailableException | |
원격 패키지 설치
public String installRemotePackages ( remoteApkPaths,
boolean reinstall,
String... extraArgs)
매개변수 |
---|
remoteApkPaths | |
reinstall | boolean |
extraArgs | String |
던지다 |
---|
DeviceNotAvailableException | |
isAppEnumeration지원됨
public boolean isAppEnumerationSupported ()
던지다 |
---|
DeviceNotAvailableException | |
isMultiUserSupported
public boolean isMultiUserSupported ()
던지다 |
---|
DeviceNotAvailableException | |
isPackage설치됨
public boolean isPackageInstalled (String packageName)
던지다 |
---|
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 | |
목록 표시 ID
public listDisplayIds ()
던지다 |
---|
DeviceNotAvailableException | |
목록사용자
public listUsers ()
던지다 |
---|
DeviceNotAvailableException | |
postInvocationTearDown
public void postInvocationTearDown (Throwable exception)
제거관리자
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 | |
set설정
public void setSetting (String namespace,
String key,
String value)
매개변수 |
---|
namespace | String |
key | String |
value | String |
던지다 |
---|
DeviceNotAvailableException | |
set설정
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 | |
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)
던지다 |
---|
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 ()
테스트를 위해 노출되었습니다.
getHostCurrentTime
protected long getHostCurrentTime ()
테스트를 위해 노출됨
사전 사후 부팅 설정
protected void prePostBootSetup ()
각 기기 유형(AndroidNativeDevice, TestDevice)이 특정 사후 부팅 설정에 대해 이 메서드를 재정의할 수 있도록 합니다.
던지다 |
---|
DeviceNotAvailableException | |