TestDevice
public
class
TestDevice
extends NativeDevice
java.lang.Object | ||
↳ | com.android.tradefed.device.NativeDevice | |
↳ | com.android.tradefed.device.TestDevice |
전체 스택 Android 기기의 ITestDevice
구현
요약
필드 | |
---|---|
public
static
final
String |
DISMISS_KEYGUARD_CMD
키가드를 닫는 데 사용할 수 있는 명령어입니다. |
공개 생성자 | |
---|---|
TestDevice(IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)
|
공개 메서드 | |
---|---|
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(
|
String
|
installPackages(
|
String
|
installPackagesForUser(
|
String
|
installPackagesForUser(
|
String
|
installRemotePackages(
|
String
|
installRemotePackages(
|
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)
|
보호된 메서드 | |
---|---|
void
|
doAdbReboot(NativeDevice.RebootMode rebootMode, String reason)
adb 재부팅을 실행합니다. |
long
|
getCheckNewUserSleep()
테스트를 위해 노출됩니다. |
long
|
getHostCurrentTime()
테스트용으로 노출됨 |
void
|
prePostBootSetup()
각 기기 유형 (AndroidNativeDevice, TestDevice)이 특정 부팅 후 설정에 대해 이 메서드를 재정의할 수 있습니다. |
필드
DISMISS_KEYGUARD_CMD
public static final String DISMISS_KEYGUARD_CMD
키가드를 닫는 데 사용할 수 있는 명령어입니다.
공개 생성자
TestDevice
public TestDevice (IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)
공개 메서드
clearErrorDialogs
public boolean clearErrorDialogs ()
반환 값 | |
---|---|
boolean |
생성 값 | |
---|---|
DeviceNotAvailableException |
createUser
public int createUser (String name)
매개변수 | |
---|---|
name |
String |
반환 값 | |
---|---|
int |
생성 값 | |
---|---|
DeviceNotAvailableException |
createUser
public int createUser (String name, boolean guest, boolean ephemeral)
매개변수 | |
---|---|
name |
String |
guest |
boolean |
ephemeral |
boolean |
반환 값 | |
---|---|
int |
생성 값 | |
---|---|
DeviceNotAvailableException |
createUserNoThrow
public int createUserNoThrow (String name)
매개변수 | |
---|---|
name |
String |
반환 값 | |
---|---|
int |
생성 값 | |
---|---|
DeviceNotAvailableException |
disableKeyguard
public void disableKeyguard ()
생성 값 | |
---|---|
DeviceNotAvailableException |
doesFileExist
public boolean doesFileExist (String deviceFilePath)
매개변수 | |
---|---|
deviceFilePath |
String |
반환 값 | |
---|---|
boolean |
생성 값 | |
---|---|
DeviceNotAvailableException |
dumpHeap
public File dumpHeap (String process, String devicePath)
매개변수 | |
---|---|
process |
String |
devicePath |
String |
반환 값 | |
---|---|
File |
생성 값 | |
---|---|
DeviceNotAvailableException |
getActiveApexes
publicgetActiveApexes ()
반환 값 | |
---|---|
|
생성 값 | |
---|---|
DeviceNotAvailableException |
getAllSettings
publicgetAllSettings (String namespace)
매개변수 | |
---|---|
namespace |
String |
반환 값 | |
---|---|
|
생성 값 | |
---|---|
DeviceNotAvailableException |
getAndroidId
public String getAndroidId (int userId)
매개변수 | |
---|---|
userId |
int |
반환 값 | |
---|---|
String |
생성 값 | |
---|---|
DeviceNotAvailableException |
getAndroidIds
publicgetAndroidIds ()
반환 값 | |
---|---|
|
생성 값 | |
---|---|
DeviceNotAvailableException |
getAppPackageInfo
public PackageInfo getAppPackageInfo (String packageName)
매개변수 | |
---|---|
packageName |
String |
반환 값 | |
---|---|
PackageInfo |
생성 값 | |
---|---|
DeviceNotAvailableException |
getAppPackageInfos
publicgetAppPackageInfos ()
반환 값 | |
---|---|
|
생성 값 | |
---|---|
DeviceNotAvailableException |
getCurrentFoldableState
public DeviceFoldableState getCurrentFoldableState ()
반환 값 | |
---|---|
DeviceFoldableState |
생성 값 | |
---|---|
DeviceNotAvailableException |
getCurrentUser
public int getCurrentUser ()
반환 값 | |
---|---|
int |
생성 값 | |
---|---|
DeviceNotAvailableException |
getFoldableStates
publicgetFoldableStates ()
반환 값 | |
---|---|
|
생성 값 | |
---|---|
DeviceNotAvailableException |
getInstalledPackageNames
publicgetInstalledPackageNames ()
반환 값 | |
---|---|
|
생성 값 | |
---|---|
DeviceNotAvailableException |
getKeyguardState
public KeyguardControllerState getKeyguardState ()
반환 값 | |
---|---|
KeyguardControllerState |
생성 값 | |
---|---|
DeviceNotAvailableException |
getMainlineModuleInfo
publicgetMainlineModuleInfo ()
반환 값 | |
---|---|
|
생성 값 | |
---|---|
DeviceNotAvailableException |
getMaxNumberOfRunningUsersSupported
public int getMaxNumberOfRunningUsersSupported ()
반환 값 | |
---|---|
int |
생성 값 | |
---|---|
DeviceNotAvailableException |
getMaxNumberOfUsersSupported
public int getMaxNumberOfUsersSupported ()
반환 값 | |
---|---|
int |
생성 값 | |
---|---|
DeviceNotAvailableException |
getPrimaryUserId
public Integer getPrimaryUserId ()
반환 값 | |
---|---|
Integer |
생성 값 | |
---|---|
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)
매개변수 | |
---|---|
format |
String |
반환 값 | |
---|---|
InputStreamSource |
생성 값 | |
---|---|
DeviceNotAvailableException |
getScreenshot
public InputStreamSource getScreenshot (long displayId)
매개변수 | |
---|---|
displayId |
long |
반환 값 | |
---|---|
InputStreamSource |
생성 값 | |
---|---|
DeviceNotAvailableException |
getSetting
public String getSetting (String namespace, String key)
매개변수 | |
---|---|
namespace |
String |
key |
String |
반환 값 | |
---|---|
String |
생성 값 | |
---|---|
DeviceNotAvailableException |
getSetting
public String getSetting (int userId, String namespace, String key)
매개변수 | |
---|---|
userId |
int |
namespace |
String |
key |
String |
반환 값 | |
---|---|
String |
생성 값 | |
---|---|
DeviceNotAvailableException |
getUninstallablePackageNames
publicgetUninstallablePackageNames ()
반환 값 | |
---|---|
|
생성 값 | |
---|---|
DeviceNotAvailableException |
getUserFlags
public int getUserFlags (int userId)
매개변수 | |
---|---|
userId |
int |
반환 값 | |
---|---|
int |
생성 값 | |
---|---|
DeviceNotAvailableException |
getUserInfos
publicgetUserInfos ()
반환 값 | |
---|---|
|
생성 값 | |
---|---|
DeviceNotAvailableException |
getUserSerialNumber
public int getUserSerialNumber (int userId)
매개변수 | |
---|---|
userId |
int |
반환 값 | |
---|---|
int |
생성 값 | |
---|---|
DeviceNotAvailableException |
hasFeature
public boolean hasFeature (String feature)
매개변수 | |
---|---|
feature |
String |
반환 값 | |
---|---|
boolean |
생성 값 | |
---|---|
DeviceNotAvailableException |
installPackage
public String installPackage (File packageFile, boolean reinstall, String... extraArgs)
매개변수 | |
---|---|
packageFile |
File |
reinstall |
boolean |
extraArgs |
String |
반환 값 | |
---|---|
String |
생성 값 | |
---|---|
DeviceNotAvailableException |
installPackage
public String installPackage (File packageFile, File certFile, boolean reinstall, String... extraArgs)
매개변수 | |
---|---|
packageFile |
File |
certFile |
File |
reinstall |
boolean |
extraArgs |
String |
반환 값 | |
---|---|
String |
생성 값 | |
---|---|
DeviceNotAvailableException |
installPackage
public String installPackage (File packageFile, boolean reinstall, boolean grantPermissions, String... extraArgs)
매개변수 | |
---|---|
packageFile |
File |
reinstall |
boolean |
grantPermissions |
boolean |
extraArgs |
String |
반환 값 | |
---|---|
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 |
반환 값 | |
---|---|
String |
생성 값 | |
---|---|
DeviceNotAvailableException |
installPackageForUser
public String installPackageForUser (File packageFile, boolean reinstall, int userId, String... extraArgs)
매개변수 | |
---|---|
packageFile |
File |
reinstall |
boolean |
userId |
int |
extraArgs |
String |
반환 값 | |
---|---|
String |
생성 값 | |
---|---|
DeviceNotAvailableException |
installPackages
public String installPackages (packageFiles, boolean reinstall, String... extraArgs)
매개변수 | |
---|---|
packageFiles |
|
reinstall |
boolean |
extraArgs |
String |
반환 값 | |
---|---|
String |
생성 값 | |
---|---|
DeviceNotAvailableException |
installPackages
public String installPackages (packageFiles, boolean reinstall, boolean grantPermissions, String... extraArgs)
매개변수 | |
---|---|
packageFiles |
|
reinstall |
boolean |
grantPermissions |
boolean |
extraArgs |
String |
반환 값 | |
---|---|
String |
생성 값 | |
---|---|
DeviceNotAvailableException |
installPackagesForUser
public String installPackagesForUser (packageFiles, boolean reinstall, boolean grantPermissions, int userId, String... extraArgs)
매개변수 | |
---|---|
packageFiles |
|
reinstall |
boolean |
grantPermissions |
boolean |
userId |
int |
extraArgs |
String |
반환 값 | |
---|---|
String |
생성 값 | |
---|---|
DeviceNotAvailableException |
installPackagesForUser
public String installPackagesForUser (packageFiles, boolean reinstall, int userId, String... extraArgs)
매개변수 | |
---|---|
packageFiles |
|
reinstall |
boolean |
userId |
int |
extraArgs |
String |
반환 값 | |
---|---|
String |
생성 값 | |
---|---|
DeviceNotAvailableException |
installRemotePackages
public String installRemotePackages (remoteApkPaths, boolean reinstall, boolean grantPermissions, String... extraArgs)
매개변수 | |
---|---|
remoteApkPaths |
|
reinstall |
boolean |
grantPermissions |
boolean |
extraArgs |
String |
반환 값 | |
---|---|
String |
생성 값 | |
---|---|
DeviceNotAvailableException |
installRemotePackages
public String installRemotePackages (remoteApkPaths, boolean reinstall, String... extraArgs)
매개변수 | |
---|---|
remoteApkPaths |
|
reinstall |
boolean |
extraArgs |
String |
반환 값 | |
---|---|
String |
생성 값 | |
---|---|
DeviceNotAvailableException |
isAppEnumerationSupported
public boolean isAppEnumerationSupported ()
반환 값 | |
---|---|
boolean |
생성 값 | |
---|---|
DeviceNotAvailableException |
isMultiUserSupported
public boolean isMultiUserSupported ()
반환 값 | |
---|---|
boolean |
생성 값 | |
---|---|
DeviceNotAvailableException |
isPackageInstalled
public boolean isPackageInstalled (String packageName)
매개변수 | |
---|---|
packageName |
String |
반환 값 | |
---|---|
boolean |
생성 값 | |
---|---|
DeviceNotAvailableException |
isPackageInstalled
public boolean isPackageInstalled (String packageName, String userId)
매개변수 | |
---|---|
packageName |
String |
userId |
String |
반환 값 | |
---|---|
boolean |
생성 값 | |
---|---|
DeviceNotAvailableException |
isUserRunning
public boolean isUserRunning (int userId)
매개변수 | |
---|---|
userId |
int |
반환 값 | |
---|---|
boolean |
생성 값 | |
---|---|
DeviceNotAvailableException |
isUserSecondary
public boolean isUserSecondary (int userId)
매개변수 | |
---|---|
userId |
int |
반환 값 | |
---|---|
boolean |
생성 값 | |
---|---|
DeviceNotAvailableException |
listDisplayIds
publiclistDisplayIds ()
반환 값 | |
---|---|
|
생성 값 | |
---|---|
DeviceNotAvailableException |
listUsers
publiclistUsers ()
반환 값 | |
---|---|
|
생성 값 | |
---|---|
DeviceNotAvailableException |
postInvocationTearDown
public void postInvocationTearDown (Throwable exception)
매개변수 | |
---|---|
exception |
Throwable |
removeAdmin
public boolean removeAdmin (String componentName, int userId)
매개변수 | |
---|---|
componentName |
String |
userId |
int |
반환 값 | |
---|---|
boolean |
생성 값 | |
---|---|
DeviceNotAvailableException |
removeOwners
public void removeOwners ()
생성 값 | |
---|---|
DeviceNotAvailableException |
removeUser
public boolean removeUser (int userId)
매개변수 | |
---|---|
userId |
int |
반환 값 | |
---|---|
boolean |
생성 값 | |
---|---|
DeviceNotAvailableException |
setDeviceOwner
public boolean setDeviceOwner (String componentName, int userId)
매개변수 | |
---|---|
componentName |
String |
userId |
int |
반환 값 | |
---|---|
boolean |
생성 값 | |
---|---|
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)
매개변수 | |
---|---|
userId |
int |
반환 값 | |
---|---|
boolean |
생성 값 | |
---|---|
DeviceNotAvailableException |
startUser
public boolean startUser (int userId, boolean waitFlag)
매개변수 | |
---|---|
userId |
int |
waitFlag |
boolean |
반환 값 | |
---|---|
boolean |
생성 값 | |
---|---|
DeviceNotAvailableException |
stopUser
public boolean stopUser (int userId, boolean waitFlag, boolean forceFlag)
매개변수 | |
---|---|
userId |
int |
waitFlag |
boolean |
forceFlag |
boolean |
반환 값 | |
---|---|
boolean |
생성 값 | |
---|---|
DeviceNotAvailableException |
stopUser
public boolean stopUser (int userId)
매개변수 | |
---|---|
userId |
int |
반환 값 | |
---|---|
boolean |
생성 값 | |
---|---|
DeviceNotAvailableException |
switchUser
public boolean switchUser (int userId)
매개변수 | |
---|---|
userId |
int |
반환 값 | |
---|---|
boolean |
생성 값 | |
---|---|
DeviceNotAvailableException |
switchUser
public boolean switchUser (int userId, long timeout)
매개변수 | |
---|---|
userId |
int |
timeout |
long |
반환 값 | |
---|---|
boolean |
생성 값 | |
---|---|
DeviceNotAvailableException |
uninstallPackage
public String uninstallPackage (String packageName)
매개변수 | |
---|---|
packageName |
String |
반환 값 | |
---|---|
String |
생성 값 | |
---|---|
DeviceNotAvailableException |
uninstallPackageForUser
public String uninstallPackageForUser (String packageName, int userId)
매개변수 | |
---|---|
packageName |
String |
userId |
int |
반환 값 | |
---|---|
String |
생성 값 | |
---|---|
DeviceNotAvailableException |
보호된 메서드
doAdbReboot
protected void doAdbReboot (NativeDevice.RebootMode rebootMode, String reason)
adb 재부팅을 실행합니다.
매개변수 | |
---|---|
rebootMode |
NativeDevice.RebootMode : 이 재부팅의 모드입니다. |
reason |
String : 이 재부팅에 관한 정보입니다. |
생성 값 | |
---|---|
DeviceNotAvailableException |
getCheckNewUserSleep
protected long getCheckNewUserSleep ()
테스트를 위해 노출됩니다.
반환 값 | |
---|---|
long |
getHostCurrentTime
protected long getHostCurrentTime ()
테스트용으로 노출됨
반환 값 | |
---|---|
long |
prePostBootSetup
protected void prePostBootSetup ()
각 기기 유형 (AndroidNativeDevice, TestDevice)이 특정 부팅 후 설정에 대해 이 메서드를 재정의할 수 있습니다.
생성 값 | |
---|---|
DeviceNotAvailableException |