네이티브디바이스
public class NativeDevice
extends Object
implements IManagedTestDevice , IConfigurationReceiver , ITestLoggerReceiver
java.lang.Object | |
↳ | com.android.tradefed.device.NativeDevice |
ITestDevice
비-풀 스택 안드로이드 장치의 기본 구현입니다.
요약
중첩 클래스 | |
---|---|
class | NativeDevice.AdbAction OS 'adb ....' 명령 실행에 대한 |
class | NativeDevice.AdbShellAction |
class | NativeDevice.RebootDeviceAction 장치 재부팅에 대한 |
상수 | |
---|---|
int | INVALID_USER_ID 유효하지 않거나 찾을 수 없는 사용자 ID에 대해 반환된 값: UserHandle이 -10000 값을 정의했습니다. |
long | MAX_HOST_DEVICE_TIME_OFFSET |
int | MAX_RETRY_ATTEMPTS 수행할 명령 재시도의 기본 횟수 |
필드 | |
---|---|
protected static final String | SD_CARD |
protected static final String | STORAGE_EMULATED |
protected TestDeviceOptions | mOptions |
protected final IDeviceStateMonitor | mStateMonitor
|
공개 생성자 | |
---|---|
NativeDevice (IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor) |
공개 메소드 | |
---|---|
void | batchPrefetchStartupBuildProps () 각 속성에 대해 'adb getprop'를 호출하는 대신 필요한 모든 속성을 미리 가져와 미세 최적화(약 400밀리초)합니다. |
boolean | canSwitchToHeadlessSystemUser () 헤드리스 SYSTEM 사용자로 전환이 허용되는지 여부를 반환합니다. |
boolean | checkApiLevelAgainstNextRelease (int strictMinLevel) 최소 지원 수준을 기준으로 현재 기능이 지원되는지 여부를 확인하세요. |
boolean | checkConnectivity () 장치가 네트워크에 연결되어 있는지 확인하십시오. |
boolean | clearErrorDialogs () 현재 장치 UI에 표시되는 오류 대화 상자를 닫으려고 합니다. |
void | clearLastConnectedWifiNetwork () 마지막으로 연결된 Wi-Fi 네트워크를 지웁니다. |
void | clearLogcat () 누적된 Logcat 데이터를 삭제합니다. |
boolean | connectToWifiNetwork ( wifiSsidToPsk, boolean scanSsid) connectToWifiNetwork ( wifiSsidToPsk, boolean scanSsid) Wi-Fi 네트워크에 연결됩니다. |
boolean | connectToWifiNetwork (String wifiSsid, String wifiPsk) Wi-Fi 네트워크에 연결됩니다. |
boolean | connectToWifiNetwork ( wifiSsidToPsk) connectToWifiNetwork ( wifiSsidToPsk) Wi-Fi 네트워크에 연결합니다.f |
boolean | connectToWifiNetwork (String wifiSsid, String wifiPsk, boolean scanSsid) Wi-Fi 네트워크에 연결됩니다. |
boolean | connectToWifiNetworkIfNeeded (String wifiSsid, String wifiPsk, boolean scanSsid) 장치가 현재 네트워크에 연결되어 있지 않은 경우에만 연결하는 |
boolean | connectToWifiNetworkIfNeeded (String wifiSsid, String wifiPsk) 장치가 현재 네트워크에 연결되어 있지 않은 경우에만 연결하는 |
int | createUser (String name, boolean guest, boolean ephemeral) 주어진 이름과 제공된 플래그를 사용하여 사용자를 생성합니다. |
int | createUser (String name, boolean guest, boolean ephemeral, boolean forTesting) 주어진 이름과 제공된 플래그를 사용하여 사용자를 생성합니다. |
int | createUser (String name) 지정된 이름과 기본 플래그 0을 사용하여 사용자를 만듭니다. |
int | createUserNoThrow (String name) 지정된 이름과 기본 플래그 0을 사용하여 사용자를 만듭니다. |
void | deleteFile (String deviceFilePath) 장치에서 파일이나 디렉터리를 삭제하는 도우미 메서드입니다. |
void | deregisterDeviceActionReceiver ( IDeviceActionReceiver deviceActionReceiver) 등록된 |
boolean | deviceSoftRestarted ( ProcessInfo prevSystemServerProcess) 현재 system_server를 이전 system_server |
boolean | deviceSoftRestartedSince (long utcEpochTime, TimeUnit timeUnit) 장치 및 해당 |
boolean | disableAdbRoot () adb 루트를 끕니다. |
void | disableKeyguard () 키가드를 비활성화하려고 시도합니다. |
boolean | disableNetworkMonitor () 장치에서 네트워크 모니터링을 비활성화합니다. |
boolean | disconnectFromWifi () Wi-Fi 네트워크 연결을 끊습니다. |
boolean | doesFileExist (String deviceFilePath, int userId) 특정 사용자에 대해 장치에 파일이 있는지 확인하는 도우미 메서드입니다. |
boolean | doesFileExist (String deviceFilePath) 장치에 파일이 있는지 확인하는 도우미 메서드입니다. |
File | dumpHeap (String process, String devicePath) system_server에서 힙 덤프를 시도합니다. |
boolean | enableAdbRoot () adb 루트를 켭니다. |
boolean | enableNetworkMonitor () 장치에서 네트워크 모니터링을 활성화합니다. |
String | executeAdbCommand (long timeout, String... cmdArgs) 지정된 시간 제한을 사용하여 adb 명령을 시스템 명령으로 실행하는 도우미 메서드입니다. |
String | executeAdbCommand (long timeout, envMap, String... cmdArgs) executeAdbCommand (long timeout, envMap, String... cmdArgs) 지정된 시간 제한을 사용하여 adb 명령을 시스템 명령으로 실행하는 도우미 메서드입니다. |
String | executeAdbCommand (String... cmdArgs) adb 명령을 시스템 명령으로 실행하는 도우미 메서드입니다. |
CommandResult | executeFastbootCommand (String... cmdArgs) 기본 시간 제한이 2분인 시스템 명령으로 fastboot 명령을 실행하는 도우미 메서드입니다. |
CommandResult | executeFastbootCommand (long timeout, String... cmdArgs) fastboot 명령을 시스템 명령으로 실행하는 도우미 메서드입니다. |
CommandResult | executeLongFastbootCommand (String... cmdArgs) 장기 실행 fastboot 명령을 시스템 명령으로 실행하는 도우미 방법입니다. |
CommandResult | executeLongFastbootCommand ( envVarMap, String... cmdArgs) executeLongFastbootCommand ( envVarMap, String... cmdArgs) 시스템 환경 변수를 사용하여 장기 실행 fastboot 명령을 시스템 명령으로 실행하는 도우미 방법입니다. |
String | executeShellCommand (String command) adb 쉘 명령어를 실행하고 출력을 |
void | executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts) 명령 동작을 제어하기 위한 추가 매개변수와 함께 adb 쉘 명령을 실행합니다. |
void | executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeoutForCommand, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts) 명령 동작을 제어하기 위한 추가 매개변수와 함께 adb 쉘 명령을 실행합니다. |
void | executeShellCommand (String command, IShellOutputReceiver receiver) 주어진 adb 쉘 명령을 실행하고 명령이 실패하면 여러 번 재시도합니다. |
CommandResult | executeShellV2Command (String cmd) adb 셸 명령을 실행하고 결과를 명령 상태 출력, stdout 및 stderr로 적절하게 채워진 |
CommandResult | executeShellV2Command (String cmd, OutputStream pipeToOutput) adb 쉘 명령을 실행하고 결과를 명령 상태 출력 및 stderr로 적절하게 채워진 |
CommandResult | executeShellV2Command (String cmd, File pipeAsInput) adb 셸 명령을 실행하고 결과를 명령 상태 출력, stdout 및 stderr로 적절하게 채워진 |
CommandResult | executeShellV2Command (String cmd, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts) 명령 동작을 제어하기 위한 추가 매개변수와 함께 adb 쉘 명령을 실행합니다. |
CommandResult | executeShellV2Command (String cmd, long maxTimeoutForCommand, TimeUnit timeUnit) 명령 동작을 제어하기 위한 추가 매개변수와 함께 adb 쉘 명령을 실행합니다. |
CommandResult | executeShellV2Command (String cmd, File pipeAsInput, OutputStream pipeToOutput, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts) 명령 동작을 제어하기 위한 추가 매개변수와 함께 adb 쉘 명령을 실행합니다. |
CommandResult | executeShellV2Command (String cmd, File pipeAsInput, OutputStream pipeToOutput, OutputStream pipeToError, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts) 명령 동작을 제어하기 위한 추가 매개변수와 함께 adb 쉘 명령을 실행합니다. |
CommandResult | fastbootWipePartition (String partition) 장치의 파티션을 지우는 도우미 메서드입니다. |
getActiveApexes () 기기에서 활성화된 APEX에 대한 정보를 가져옵니다. | |
getAllSettings (String namespace) 요청된 네임스페이스의 키 값 쌍을 반환합니다. | |
DeviceAllocationState | getAllocationState () 장치의 현재 할당 상태를 반환합니다. |
String | getAndroidId (int userId) userId에 연결된 android-id를 찾아서 반환합니다. 찾을 수 없으면 null입니다. |
getAndroidIds () 사용자 ID와 일치하는 Android ID의 맵을 만듭니다. | |
int | getApiLevel () 장치 API 레벨을 가져옵니다. |
PackageInfo | getAppPackageInfo (String packageName) 장치에 설치된 패키지에 대한 정보를 가져옵니다. |
getAppPackageInfos () 기기에 설치된 패키지 정보를 가져옵니다. | |
String | getBasebandVersion () 이 장치의 베이스밴드(라디오) 버전을 가져오는 편리한 방법입니다. |
Integer | getBattery () 장치의 현재 배터리 수준을 반환하거나, 배터리 수준을 사용할 수 없는 경우 Null을 반환합니다. |
boolean | getBooleanProperty (String name, boolean defaultValue) 주어진 속성의 부울 값을 반환합니다. |
getBootHistory () 도우미 메서드는 부팅 시간 및 부팅 이유와 함께 부팅 기록 맵을 수집합니다. | |
getBootHistorySince (long utcEpochTime, TimeUnit timeUnit) 도우미 메서드는 장치에서 에포크 이후 지정된 시간 이후의 부팅 시간 및 부팅 이유와 지정된 시간 단위로 부팅 기록 맵을 수집합니다. | |
String | getBootloaderVersion () 이 장치의 부트로더 버전을 가져오는 편리한 방법입니다. |
InputStreamSource | getBugreport () 장치에서 버그 보고서를 검색합니다. |
InputStreamSource | getBugreportz () 장치에서 버그 보고서를 검색합니다. |
String | getBuildAlias () 장치가 현재 실행 중인 빌드의 별칭을 검색합니다. |
String | getBuildFlavor () 장치의 빌드 버전을 검색합니다. |
String | getBuildId () 장치가 현재 실행 중인 빌드를 검색합니다. |
String | getBuildSigningKeys () 장치 이미지 서명에 사용된 키 유형을 반환합니다. 일반적으로 Android 기기는 테스트 키(예: AOSP) 또는 릴리스 키(개별 기기 제조업체에서 관리)로 서명할 수 있습니다. |
DeviceDescriptor | getCachedDeviceDescriptor () 장치가 할당된 경우 캐시된 |
DeviceDescriptor | getCachedDeviceDescriptor (boolean shortDescriptor) 장치가 할당된 경우 캐시된 |
String[] | getChildren (String path) 권한 때문에 때때로 작동하지 않는 |
AbstractConnection | getConnection () 장치와 관련된 현재 연결입니다. |
DeviceFoldableState | getCurrentFoldableState () 기기의 현재 폴더블 상태를 반환하거나 일부 문제가 발생한 경우 null을 반환합니다. |
int | getCurrentUser () 현재 실행 중인 사용자의 ID를 반환합니다. |
String | getDeviceClass () 장치 클래스를 가져옵니다. |
long | getDeviceDate () 에포크 이후 장치의 날짜를 밀리초 단위로 반환합니다. |
DeviceDescriptor | getDeviceDescriptor () 실제 장치 객체를 전달하지 않고 정보를 얻으려면 장치 정보에서 |
DeviceDescriptor | getDeviceDescriptor (boolean shortDescriptor) 실제 장치 객체를 전달하지 않고 정보를 얻으려면 장치 정보에서 |
TestDeviceState | getDeviceState () 장치의 상태를 가져옵니다. |
long | getDeviceTimeOffset (Date date) 장치와 지정된 |
InputStreamSource | getEmulatorOutput () 에뮬레이터 stdout 및 stderr 스트림 가져오기 |
Process | getEmulatorProcess () 이 에뮬레이터에 해당하는 |
final File | getExecuteShellCommandLog () 모든 |
long | getExternalStoreFreeSpace () 장치 외부 저장소의 여유 공간을 확인하는 도우미 방법입니다. |
String | getFastbootPath () 사용 중인 fastboot 바이너리의 경로를 반환합니다. |
String | getFastbootProductType () 빠른 부팅 모드에 있을 때 이 장치의 제품 유형을 가져오는 편리한 방법입니다. |
String | getFastbootProductVariant () 빠른 부팅 모드에 있을 때 이 장치의 제품 유형을 가져오는 편리한 방법입니다. |
String | getFastbootSerialNumber () fastboot 모드 일련 번호를 반환합니다. |
String | getFastbootVariable (String variableName) 기기에서 지정된 fastboot 변수 값을 검색합니다. |
String | getFastbootVersion () 사용 중인 fastboot 바이너리의 버전 문자열을 반환합니다. |
IFileEntry | getFileEntry (String path) 장치의 원격 파일에 대한 참조를 검색합니다. |
IFileEntry | getFileEntry (FileListingService.FileEntry entry) 루트가 아닌 경로에서 |
getFoldableStates () 기기의 폴더블 상태 목록을 반환합니다. | |
IDevice | getIDevice () 연관된 ddmlib |
getInstalledPackageNames () 기기에 있는 애플리케이션 패키지 이름을 가져옵니다. | |
long | getIntProperty (String name, long defaultValue) 장치에서 지정된 속성의 정수 값을 반환합니다. |
String | getIpAddress () 장치의 IP 주소를 가져옵니다. |
KeyguardControllerState | getKeyguardState () 키가드의 현재 상태를 가져오려면 객체를 반환하거나, 지원되지 않으면 null을 반환합니다. |
long | getLastExpectedRebootTimeMillis () |
int | getLaunchApiLevel () 기기에서 처음으로 실행된 API 레벨을 가져옵니다. |
InputStreamSource | getLogcat () logcat 데이터의 스냅샷 스트림을 가져옵니다. |
InputStreamSource | getLogcat (int maxBytes) 캡처된 logcat 데이터의 마지막 |
InputStreamSource | getLogcatDump () 장치의 현재 logcat 덤프를 가져옵니다. |
InputStreamSource | getLogcatSince (long date) 제공된 날짜부터 캡처된 logcat 데이터의 스냅샷 스트림을 가져옵니다. |
String | getMacAddress () 장치의 MAC 주소를 반환하며, 장치에서 쿼리하지 못한 경우 null을 반환합니다. |
Integer | getMainUserId () 기본 사용자 ID를 반환합니다. |
getMainlineModuleInfo () 장치에 설치된 메인라인 모듈에 대한 정보를 가져옵니다. | |
int | getMaxNumberOfRunningUsersSupported () 지원되는 동시 실행 사용자의 최대 수를 가져옵니다. |
int | getMaxNumberOfUsersSupported () 지원되는 최대 사용자 수를 확보하세요. |
Process | getMicrodroidProcess () |
IDeviceStateMonitor | getMonitor () 장치와 연결된 |
String | getMountPoint (String mountName) 마운트 지점을 반환합니다. |
ITestDevice.MountPointInfo | getMountPointInfo (String mountpoint) 지정된 마운트 지점 경로에 해당하는 |
getMountPointInfo () 장치의 /proc/mounts에 있는 정보의 구문 분석된 버전을 반환합니다. | |
TestDeviceOptions | getOptions () 장치의 테스트 옵션을 가져옵니다. |
long | getPartitionFreeSpace (String partition) 장치 파티션의 여유 공간을 확인하는 도우미 방법입니다. |
Integer | getPrimaryUserId () 기본 사용자 ID를 반환합니다. |
ProcessInfo | getProcessByName (String processName) 도우미 메서드는 "pidof" 및 "stat" 명령을 실행하고 지정된 프로세스의 PID 및 프로세스 시작 시간과 함께 |
String | getProcessPid (String process) 서비스의 pid를 반환하거나 문제가 발생한 경우 null을 반환합니다. |
String | getProductType () 이 장치의 제품 유형을 가져오는 편리한 방법입니다. |
String | getProductVariant () 이 장치의 제품 변형을 가져오는 편리한 방법입니다. |
String | getProperty (String name) 장치에서 지정된 속성 값을 검색합니다. |
ITestDevice.RecoveryMode | getRecoveryMode () 장치에 사용되는 현재 복구 모드를 가져옵니다. |
InputStreamSource | getScreenshot (String format) 장치에서 스크린샷을 찍습니다. |
InputStreamSource | getScreenshot (long displayId) 디스플레이 ID가 지정된 장치에서 스크린샷을 가져옵니다. |
InputStreamSource | getScreenshot (String format, boolean rescale) 장치에서 스크린샷을 찍습니다. |
InputStreamSource | getScreenshot () 장치에서 스크린샷을 찍습니다. |
String | getSerialNumber () 이 장치의 일련번호를 가져오는 편리한 방법입니다. |
String | getSetting (int userId, String namespace, String key) 요청된 설정의 값을 반환합니다. |
String | getSetting (String namespace, String key) |
String | getSimOperator () SIM 카드 운영자를 반환하거나, 사용할 수 없거나 장치를 사용할 수 없는 경우 null을 반환합니다. |
String | getSimState () SIM 카드 상태를 반환하거나, 사용할 수 없거나 장치를 사용할 수 없는 경우 null을 반환합니다. |
getTombstones () 장치에서 삭제 표시 목록을 가져오고 반환합니다. | |
long | getTotalMemory () 총 물리적 메모리 크기를 바이트 단위로 반환하거나 내부 오류가 있는 경우 -1을 반환합니다. |
getUninstallablePackageNames () 제거할 수 있는 애플리케이션 패키지 이름을 가져옵니다. | |
boolean | getUseFastbootErase () 장치의 파티션을 지울 때 빠른 부팅 지우기 또는 빠른 부팅 형식을 사용할지 여부를 확인하세요. |
int | getUserFlags (int userId) 특정 사용자의 플래그를 찾아 반환합니다. |
getUserInfos () 장치의 | |
int | getUserSerialNumber (int userId) 발견된 경우 userId와 연관된 일련 번호를 반환하고, 다른 경우에는 -10000을 반환합니다. |
IManagedTestDevice.DeviceEventResponse | handleAllocationEvent (DeviceEvent event) 지정된 DeviceEvent를 처리합니다. 이 장치를 새로운 할당 상태로 전환할 수도 있고 전환하지 않을 수도 있는 DeviceEvent를 처리합니다. |
boolean | hasFeature (String feature) 장치에서 기능을 사용할 수 있는지 확인하십시오. |
String | installPackage (File packageFile, boolean reinstall, String... extraArgs) 기기에 Android 패키지를 설치합니다. |
String | installPackage (File packageFile, boolean reinstall, boolean grantPermissions, String... extraArgs) 기기에 Android 패키지를 설치합니다. |
String | installPackageForUser (File packageFile, boolean reinstall, int userId, String... extraArgs) 특정 사용자의 기기에 Android 패키지를 설치합니다. |
String | installPackageForUser (File packageFile, boolean reinstall, boolean grantPermissions, int userId, String... extraArgs) 특정 사용자의 기기에 Android 패키지를 설치합니다. |
void | invalidatePropertyCache () |
boolean | isAdbRoot () |
boolean | isAdbTcp () |
boolean | isAppEnumerationSupported () 기기의 플랫폼이 앱 열거를 지원하는지 확인하세요. |
boolean | isBypassLowTargetSdkBlockSupported () 기기의 플랫폼이 앱 설치 시 낮은 대상 SDK 차단 우회를 지원하는지 확인하세요. |
boolean | isDeviceEncrypted () 장치가 암호화되었는지 여부를 반환합니다. |
boolean | isDirectory (String path) 장치의 경로가 디렉터리이면 True를 반환하고, 그렇지 않으면 False를 반환합니다. |
boolean | isEnableAdbRoot () |
boolean | isEncryptionSupported () 기기에서 암호화가 지원되는지 여부를 반환합니다. |
boolean | isExecutable (String fullPath) 장치의 파일 경로가 실행 파일이면 True를 반환하고, 그렇지 않으면 False를 반환합니다. |
boolean | isFastbootEnabled () 장치에 fastboot를 사용할 수 있으면 반환합니다. |
boolean | isHeadless () 장치가 헤드리스(화면 없음)이면 true를 반환하고, 그렇지 않으면 false를 반환합니다. |
boolean | isHeadlessSystemUserMode () 장치가 헤드리스 시스템 사용자 모드를 사용하는지 여부를 반환합니다. |
boolean | isMainUserPermanentAdmin () 기본 사용자가 영구 관리자인지, 삭제하거나 관리자가 아닌 상태로 다운그레이드할 수 없는지 여부를 반환합니다. |
boolean | isMultiUserSupported () 다중 사용자가 지원되는지 결정합니다. |
boolean | isPackageInstalled (String packageName, String userId) 주어진 패키지 이름과 주어진 사용자 ID에 대해 장치를 쿼리하여 해당 사용자에 대해 현재 설치되어 있는지 확인합니다. |
boolean | isPackageInstalled (String packageName) 특정 패키지 이름을 장치에 쿼리하여 현재 설치되어 있는지 확인하세요. |
boolean | isRuntimePermissionSupported () 기기의 플랫폼이 런타임 권한 부여를 지원하는지 확인하세요. |
boolean | isStateBootloaderOrFastbootd () 장치가 |
boolean | isUserRunning (int userId) 특정 사용자가 실행 중인지 확인합니다. |
boolean | isUserSecondary (int userId) 플래그에 따라 지정된 사용자가 보조 사용자인지 여부를 반환합니다. |
boolean | isUserVisible (int userId) 해당 사용자가 표시되는지 확인합니다. |
boolean | isUserVisibleOnDisplay (int userId, int displayId) 지정된 사용자가 지정된 디스플레이에 표시되는지 확인합니다. |
boolean | isVisibleBackgroundUsersOnDefaultDisplaySupported () |
boolean | isVisibleBackgroundUsersSupported () 장치가 사용자가 백그라운드에서 볼 수 있도록 시작할 수 있는지 여부를 반환합니다. |
boolean | isWifiEnabled () Wi-Fi가 활성화되어 있는지 테스트합니다. |
listDisplayIds () "dumpsys SurfaceFlinger"에서 보고한 대로 장치에서 사용 가능한 디스플레이 ID 목록을 수집합니다. | |
listDisplayIdsForStartingVisibleBackgroundUsers () | |
listUsers () 기기의 사용자 목록을 가져옵니다. | |
boolean | logAnrs ( ITestLogger logger) 기기에서 ANR을 수집하고 기록합니다. |
boolean | logBugreport (String dataName, ITestLogger listener) 버그 신고를 받아 기자에게 기록하는 도우미 메서드입니다. |
void | logOnDevice (String tag, Log.LogLevel level, String format, Object... args) 장치의 logcat에 메시지를 기록합니다. |
void | nonBlockingReboot () 기기를 재부팅하는 명령어를 실행하고 명령어가 완료되고 기기가 더 이상 adb에 표시되지 않을 때 반환됩니다. |
void | postAdbRootAction () adb 루트 이후와 장치가 다시 온라인 상태가 되기 전에 장치에 특정 작업을 수행해야 하는 경우 재정의합니다. |
void | postAdbUnrootAction () adb 루트를 해제한 후 기기가 다시 온라인 상태가 되기 전에 기기에서 수행해야 할 특정 작업이 필요한 경우 재정의하세요. |
void | postBootSetup () 부팅할 때마다 테스트를 위해 장치를 구성하는 지침을 수행합니다. |
void | postInvocationTearDown (Throwable exception) 호출이 완료된 후 실행될 장치별 필수 정리를 위한 추가 단계입니다. |
void | preInvocationSetup ( IBuildInfo info, MultiMap <String, String> attributes) 호출 흐름 전에 장치에서 실행될 장치별 필수 설정을 위한 추가 단계입니다. |
boolean | pullDir (String deviceFilePath, File localDir) 장치에서 디렉터리 콘텐츠를 반복적으로 가져옵니다. |
boolean | pullFile (String remoteFilePath, File localFile) 장치에서 파일을 검색합니다. |
File | pullFile (String remoteFilePath, int userId) 장치에서 파일을 검색하여 로컬 임시 |
File | pullFile (String remoteFilePath) 장치에서 파일을 검색하여 로컬 임시 |
boolean | pullFile (String remoteFilePath, File localFile, int userId) 장치에서 파일을 검색합니다. |
String | pullFileContents (String remoteFilePath) 장치에서 파일을 검색하고 내용을 반환합니다. |
File | pullFileFromExternal (String remoteFilePath) 장치의 외부 저장소에서 파일을 검색하여 로컬 임시 |
boolean | pushDir (File localFileDir, String deviceFilePath, excludedDirectories) pushDir (File localFileDir, String deviceFilePath, excludedDirectories) 필터링된 일부 디렉터리를 제외하면서 디렉터리 내용을 장치에 반복적으로 푸시합니다. |
boolean | pushDir (File localFileDir, String deviceFilePath) 디렉터리 내용을 장치에 반복적으로 푸시합니다. |
boolean | pushFile (File localFile, String remoteFilePath, boolean evaluateContentProviderNeeded) 콘텐츠 제공자에 대한 필요성 평가를 선택적으로 고려할 수 있는 |
boolean | pushFile (File localFile, String remoteFilePath) 파일을 장치에 푸시합니다. |
boolean | pushString (String contents, String remoteFilePath) 문자열에서 생성된 파일을 장치로 푸시 |
void | reboot (String reason) 재부팅 후에도 지속되도록 지정된 |
void | reboot () 기기를 adb 모드로 재부팅합니다. |
void | rebootIntoBootloader () 장치를 부트로더 모드로 재부팅합니다. |
void | rebootIntoFastbootd () 장치를 fastbootd 모드로 재부팅합니다. |
void | rebootIntoRecovery () 기기를 adb 복구 모드로 재부팅합니다. |
void | rebootIntoSideload () 기기를 adb 사이드로드 모드로 재부팅합니다(이는 복구 중인 특수 모드입니다). 기기가 사이드로드 모드로 들어갈 때까지 차단됩니다. |
void | rebootIntoSideload (boolean autoReboot) 기기를 adb 사이드로드 모드로 재부팅합니다(이는 복구 중인 특수 모드입니다). 기기가 사이드로드 모드로 들어갈 때까지 차단됩니다. |
void | rebootUntilOnline () 장치가 온라인 상태가 될 때까지, 즉 adb에 표시될 때까지만 차단하는 |
void | rebootUntilOnline (String reason) 장치가 온라인 상태가 될 때까지, 즉 adb에 표시될 때까지만 차단하는 |
void | rebootUserspace () 장치의 사용자 공간 부분만 재부팅합니다. |
void | rebootUserspaceUntilOnline () 장치가 온라인 상태가 될 때까지, 즉 adb에 표시될 때까지만 차단하는 |
boolean | recoverDevice () 장치 통신을 복구하려고 시도합니다. |
void | registerDeviceActionReceiver ( IDeviceActionReceiver deviceActionReceiver) 이 장치에 대한 |
void | remountSystemReadOnly () 장치의 시스템 파티션을 읽기 전용으로 만듭니다. |
void | remountSystemWritable () 장치의 시스템 파티션을 쓰기 가능하게 만듭니다. |
void | remountVendorReadOnly () 장치의 공급업체 파티션을 읽기 전용으로 만듭니다. |
void | remountVendorWritable () 장치의 공급업체 파티션을 쓰기 가능하게 만듭니다. |
boolean | removeAdmin (String componentName, int userId) 특정 사용자에서 해당 장치 관리자를 제거하고 성공하면 |
void | removeOwners () 최선을 다해 기존 장치 프로필 소유자를 모두 제거하세요. |
boolean | removeUser (int userId) 장치에서 특정 사용자를 제거합니다. |
void | resetContentProviderSetup () 다시 트리거하려면 콘텐츠 제공자 설정에 대한 플래그를 재설정하세요. |
boolean | runInstrumentationTests (IRemoteAndroidTestRunner runner, ITestLifeCycleReceiver... listeners) 매개변수로 전달된 하나 이상의 리스너를 사용 |
boolean | runInstrumentationTests (IRemoteAndroidTestRunner runner, listeners) runInstrumentationTests (IRemoteAndroidTestRunner runner, listeners) 계측 테스트를 실행하고 장치 복구를 제공합니다. |
boolean | runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, listeners) runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, listeners) |
boolean | runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, ITestLifeCycleReceiver... listeners) |
void | setConfiguration ( IConfiguration configuration) 사용 중인 |
final void | setConnectionAvdInfo ( GceAvdInfo avdInfo) |
void | setDate (Date date) 기기의 날짜를 설정합니다. 참고: 기기의 날짜를 설정하려면 루트가 필요합니다. |
boolean | setDeviceOwner (String componentName, int userId) 특정 사용자의 장치 관리자 구성 요소를 장치 소유자로 설정합니다. |
void | setDeviceState ( TestDeviceState deviceState) 장치 상태를 업데이트합니다. |
void | setEmulatorOutputStream ( SizeLimitedOutputStream output) 에뮬레이터의 경우 |
void | setEmulatorProcess (Process p) 이 장치가 에뮬레이터인 경우 |
void | setFastbootEnabled (boolean fastbootEnabled) 장치의 빠른 부팅 옵션을 설정합니다. |
void | setFastbootPath (String fastbootPath) 사용해야 하는 fastboot 바이너리의 경로를 설정합니다. |
void | setIDevice (IDevice newDevice) 이 ITestDevice와 연결된 IDevice를 업데이트합니다. |
void | setLogStartDelay (int delay) 온라인 장치에 대한 Logcat 캡처를 시작하기 전에 기다리는 시간(ms)을 설정합니다. |
void | setOptions ( TestDeviceOptions options) 장치에 대한 |
boolean | setProperty (String propKey, String propValue) 장치에 지정된 속성 값을 설정합니다. |
void | setRecovery ( IDeviceRecovery recovery) 이 장치에 사용할 |
void | setRecoveryMode ( ITestDevice.RecoveryMode mode) 장치에 사용할 현재 복구 모드를 설정합니다. |
void | setSetting (String namespace, String key, String value) |
void | setSetting (int userId, String namespace, String key, String value) 특정 사용자의 네임스페이스에 설정 값을 추가합니다. |
void | setTestLogger ( ITestLogger testLogger) |
void | setUseFastbootErase (boolean useFastbootErase) 장치의 파티션을 지울 때 빠른 부팅 지우기 또는 빠른 부팅 형식을 사용할지 여부를 설정합니다. |
void | startLogcat () 백그라운드에서 장치의 logcat 출력 캡처를 시작합니다. |
boolean | startUser (int userId) 현재 중지된 경우 지정된 사용자를 백그라운드에서 시작합니다. |
boolean | startUser (int userId, boolean waitFlag) 현재 중지된 경우 지정된 사용자를 백그라운드에서 시작합니다. |
boolean | startVisibleBackgroundUser (int userId, int displayId, boolean waitFlag) 지정된 디스플레이에 표시되는 백그라운드에서 지정된 사용자를 시작합니다(즉, 사용자가 해당 디스플레이에서 활동을 시작할 수 있도록 허용). |
void | stopEmulatorOutput () 에뮬레이터 출력을 닫고 삭제합니다. |
void | stopLogcat () 장치에서 logcat 출력 캡처를 중지하고 현재 저장된 logcat 데이터를 삭제합니다. |
boolean | stopUser (int userId) 지정된 사용자를 중지합니다. |
boolean | stopUser (int userId, boolean waitFlag, boolean forceFlag) 특정 사용자를 중지합니다. |
String | switchToAdbTcp () 장치를 adb-over-tcp 모드로 전환합니다. |
boolean | switchToAdbUsb () USB 모드를 통해 장치를 adb로 전환합니다. |
boolean | switchUser (int userId) 기본 시간 제한을 사용하여 다른 userId로 전환합니다. |
boolean | switchUser (int userId, long timeout) 제공된 제한 시간을 기한으로 사용하여 다른 userId로 전환합니다. |
boolean | syncFiles (File localFileDir, String deviceFilePath) 로컬 파일 디렉터리의 콘텐츠를 장치에 점진적으로 동기화합니다. |
Bugreport | takeBugreport () 버그 보고서를 가져와 |
String | uninstallPackage (String packageName) 기기에서 Android 패키지를 제거합니다. |
String | uninstallPackageForUser (String packageName, int userId) 특정 사용자의 기기에서 Android 패키지를 제거합니다. |
boolean | unlockDevice () 장치가 암호화된 상태인 경우 장치를 잠금 해제합니다. |
boolean | waitForBootComplete (long timeOut) 장치의 부팅 완료 플래그가 설정될 때까지 차단됩니다. |
boolean | waitForDeviceAvailable () 장치가 응답하고 테스트에 사용할 수 있을 때까지 기다립니다. |
boolean | waitForDeviceAvailable (long waitTime) 장치가 응답하고 테스트에 사용할 수 있을 때까지 기다립니다. |
boolean | waitForDeviceAvailableInRecoverPath (long waitTime) 복구 경로를 고려하지 않고 장치가 응답하고 사용할 수 있을 때까지 기다립니다. |
void | waitForDeviceBootloader () fastboot를 통해 장치가 표시될 때까지 차단됩니다. |
boolean | waitForDeviceInRecovery (long waitTime) 기기가 'adb 복구' 상태가 되도록 차단합니다(이는 |
boolean | waitForDeviceInSideload (long waitTime) 기기가 'adb 사이드로드' 상태가 되도록 차단합니다. |
boolean | waitForDeviceNotAvailable (long waitTime) 장치를 사용할 수 없도록 차단합니다. 즉, adb에서 누락되었습니다. |
void | waitForDeviceOnline () adb를 통해 기기가 표시될 때까지 차단됩니다. |
void | waitForDeviceOnline (long waitTime) adb를 통해 기기가 표시될 때까지 차단됩니다. |
boolean | waitForDeviceShell (long waitTime) 기기가 기본 adb 셸 명령어에 응답할 때까지 기다립니다. |
보호된 방법 | |
---|---|
void | addExtraConnectionBuilderArgs ( DefaultConnection.ConnectionBuilder builder) |
String[] | buildAdbShellCommand (String command, boolean forceExitStatusDetection) 지정된 adb 쉘 명령 세션 및 인수에 대한 OS 명령을 빌드합니다. |
void | checkApiLevelAgainst (String feature, int strictMinLevel) |
NativeDevice.RebootDeviceAction | createRebootDeviceAction ( NativeDevice.RebootMode rebootMode, String reason) 재부팅 작업을 수행할 때 사용할 |
IRunUtil | createRunUtil () |
void | doAdbReboot ( NativeDevice.RebootMode rebootMode, String reason) adb 재부팅을 수행합니다. |
void | ensureRuntimePermissionSupported () 런타임 권한이 지원되지 않는 경우 예외를 발생시키는 도우미 메서드 |
int | getApiLevelSafe () |
ITestLogger | getLogger () |
IRunUtil | getRunUtil () 사용할 |
void | initializeConnection ( IBuildInfo info, MultiMap <String, String> attributes) |
String | internalGetProperty (String propName, String fastbootVar, String description) 기본적으로 ddmlib 캐시에서 장치 속성을 가져오고 장치가 Fastboot에 있는지 여부에 따라 `adb shell getprop` 또는 `fastboot getvar`로 대체됩니다. |
boolean | isInRebootCallback () 현재 재부팅 콜백이 실행 중인지 여부를 반환합니다. |
boolean | isNewer (File localFile, IFileEntry entry) 로컬 파일이 원격 파일보다 최신이면 |
void | notifyRebootEnded () 재부팅 종료 이벤트에 대해 모든 |
void | notifyRebootStarted () 재부팅 시작 이벤트에 대해 모든 |
boolean | performDeviceAction (String actionDescription, NativeDevice.DeviceAction action, int retryAttempts) 이 장치에서 작업을 수행합니다. |
void | postAdbReboot () 재부팅 후 수행할 수 있는 추가 작업입니다. |
void | prePostBootSetup () 각 장치 유형(AndroidNativeDevice, TestDevice)이 특정 부팅 후 설정에 대해 이 메서드를 재정의할 수 있도록 허용합니다. |
boolean | pullFileInternal (String remoteFilePath, File localFile) |
void | setClock (Clock clock) 사용할 Clock 인스턴스를 설정합니다. |
void | setMicrodroidProcess (Process process) TestDevice를 마이크로드로이드로 표시하고 CID를 설정합니다. |
void | setTestDeviceOptions ( deviceOptions) setTestDeviceOptions ( deviceOptions) |
CommandResult | simpleFastbootCommand (long timeout, envVarMap, String[] fullCmd) simpleFastbootCommand (long timeout, envVarMap, String[] fullCmd) 환경 변수를 사용하여 간단한 fastboot 명령을 실행하고 명령 상태를 보고합니다. |
CommandResult | simpleFastbootCommand (long timeout, String[] fullCmd) 간단한 fastboot 명령을 실행하고 명령 상태를 보고합니다. |
boolean | waitForDeviceNotAvailable (String operationDesc, long time) 기기를 사용할 수 없게 될 때까지 기다립니다(adb에 보고 중지). |
상수
INVALID_USER_ID
public static final int INVALID_USER_ID
유효하지 않거나 찾을 수 없는 사용자 ID에 대해 반환된 값: UserHandle이 -10000 값을 정의했습니다.
상수값: -10000(0xffffd8f0)
MAX_HOST_DEVICE_TIME_OFFSET
protected static final long MAX_HOST_DEVICE_TIME_OFFSET
상수값: 5000 (0x0000000000001388)
MAX_RETRY_ATTEMPTS
protected static final int MAX_RETRY_ATTEMPTS
수행할 명령 재시도의 기본 횟수
상수값: 2 (0x00000002)
필드
SD_CARD
protected static final String SD_CARD
STORAGE_EMULATED
protected static final String STORAGE_EMULATED
공개 생성자
네이티브디바이스
public NativeDevice (IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)
TestDevice
생성합니다.
매개변수 | |
---|---|
device | IDevice : 연결된 IDevice |
stateMonitor | IDeviceStateMonitor : 사용할 IDeviceStateMonitor 메커니즘 |
allocationMonitor | IDeviceMonitor : 할당 상태 변경을 알리는 IDeviceMonitor . null일 수 있음 |
공개 메소드
BatchPrefetchStartupBuildProps
public void batchPrefetchStartupBuildProps ()
각 속성에 대해 'adb getprop'를 호출하는 대신 필요한 모든 속성을 미리 가져와 미세 최적화(약 400밀리초)합니다. 즉, 모든 속성을 가져오는 것은 하나를 가져오는 것만큼 빠릅니다. device.getApiLevel(), checkApiLevelAgainstNextRelease 및 getBuildAlias와 같은 것들은 모두 내부적으로 `adb getprop`을 호출합니다. 한 번의 호출로 이를 가져와 NativeDevice.setProperty를 호출합니다. 이렇게 하지 않더라도 NativeDevice는 자체적으로 setProperty를 호출하고 향후 호출을 위해 결과를 캐시합니다. 우리는 그것을 조금 더 일찍 하고 있을 뿐입니다. 장치가 복구 중이거나 props를 가져오는 데 다른 오류가 있는 경우 이를 무시합니다.
canSwitchToHeadlessSystemUser
public boolean canSwitchToHeadlessSystemUser ()
헤드리스 SYSTEM 사용자로 전환이 허용되는지 여부를 반환합니다.
보고 | |
---|---|
boolean |
던지기 | |
---|---|
DeviceNotAvailableException |
checkApiLevelAgainstNextRelease
public boolean checkApiLevelAgainstNextRelease (int strictMinLevel)
최소 지원 수준을 기준으로 현재 기능이 지원되는지 여부를 확인하세요. 이 방법은 API 레벨이 올라가기 전에 아직 출시되지 않은 기능을 고려합니다.
매개변수 | |
---|---|
strictMinLevel | int : 기능을 지원하는 엄격한 최소 수준입니다. |
보고 | |
---|---|
boolean | 해당 수준이 지원되는 경우 True입니다. 그렇지 않으면 거짓입니다. |
던지기 | |
---|---|
DeviceNotAvailableException |
연결 확인
public boolean checkConnectivity ()
장치가 네트워크에 연결되어 있는지 확인하십시오.
보고 | |
---|---|
boolean | 장치에 작동 중인 네트워크 연결이 있으면 true 이고, 그렇지 않으면 false . |
던지기 | |
---|---|
DeviceNotAvailableException |
클리어오류대화상자
public boolean clearErrorDialogs ()
현재 장치 UI에 표시되는 오류 대화 상자를 닫으려고 합니다.
보고 | |
---|---|
boolean | 대화 상자가 없거나 대화 상자가 성공적으로 지워진 경우 true . 그렇지 않으면 false . |
던지기 | |
---|---|
DeviceNotAvailableException |
지우기마지막 연결WiFi네트워크
public void clearLastConnectedWifiNetwork ()
마지막으로 연결된 Wi-Fi 네트워크를 지웁니다. 기기 재부팅 후 이전 테스트에서 사용된 Wi-Fi 네트워크에 연결되지 않도록 새 호출을 시작할 때 이 호출을 호출해야 합니다.
클리어로그캣
public void clearLogcat ()
누적된 Logcat 데이터를 삭제합니다.
이는ITestDevice#getLogcat()
특정 지점(예: 새 장치 빌드를 플래시한 후 등) 이후에 생성된 로그 데이터만 반환하도록 하려는 경우에 유용합니다. connectToWiFi네트워크
public boolean connectToWifiNetwork (wifiSsidToPsk, boolean scanSsid)
Wi-Fi 네트워크에 연결됩니다.
Wi-Fi를 켜고 wifiSsidToPsk 맵에 지정된 Wi-Fi 네트워크 중 하나에 성공적으로 연결될 때까지 차단합니다. 연결이 설정되면 인스턴스는 ITestDevice#disconnectFromWifi()
또는 ITestDevice#clearLastConnectedWifiNetwork()
호출될 때까지 재부팅할 때마다 연결 복원을 시도합니다.
매개변수 | |
---|---|
wifiSsidToPsk | |
scanSsid | boolean : 이 네트워크의 숨겨진 SSID를 검색할지 여부입니다. |
보고 | |
---|---|
boolean | Wi-Fi 네트워크에 성공적으로 연결된 경우 true . 그렇지 않으면 false |
던지기 | |
---|---|
DeviceNotAvailableException |
connectToWiFi네트워크
public boolean connectToWifiNetwork (String wifiSsid, String wifiPsk)
Wi-Fi 네트워크에 연결됩니다.
Wi-Fi를 켜고 지정된 Wi-Fi 네트워크에 성공적으로 연결될 때까지 차단합니다. 연결이 설정되면 인스턴스는ITestDevice#disconnectFromWifi()
또는 ITestDevice#clearLastConnectedWifiNetwork()
호출될 때까지 재부팅할 때마다 연결 복원을 시도합니다.매개변수 | |
---|---|
wifiSsid | String : 연결할 Wi-Fi ssid |
wifiPsk | String : PSK 암호 또는 암호화되지 않은 경우 null |
보고 | |
---|---|
boolean | Wi-Fi 네트워크에 성공적으로 연결된 경우 true . 그렇지 않으면 false |
던지기 | |
---|---|
DeviceNotAvailableException |
connectToWiFi네트워크
public boolean connectToWifiNetwork (wifiSsidToPsk)
Wi-Fi 네트워크에 연결됩니다.
Wi-Fi를 켜고 wifiSsidToPsk 맵에 지정된 Wi-Fi 네트워크 중 하나에 성공적으로 연결될 때까지 차단합니다. 연결이 설정되면 인스턴스는 ITestDevice#disconnectFromWifi()
또는 ITestDevice#clearLastConnectedWifiNetwork()
호출될 때까지 재부팅할 때마다 연결 복원을 시도합니다.f
매개변수 | |
---|---|
wifiSsidToPsk |
보고 | |
---|---|
boolean | Wi-Fi 네트워크에 성공적으로 연결된 경우 true . 그렇지 않으면 false |
던지기 | |
---|---|
DeviceNotAvailableException |
connectToWiFi네트워크
public boolean connectToWifiNetwork (String wifiSsid, String wifiPsk, boolean scanSsid)
Wi-Fi 네트워크에 연결됩니다.
Wi-Fi를 켜고 지정된 Wi-Fi 네트워크에 성공적으로 연결될 때까지 차단합니다. 연결이 설정되면 인스턴스는ITestDevice#disconnectFromWifi()
또는 ITestDevice#clearLastConnectedWifiNetwork()
호출될 때까지 재부팅할 때마다 연결 복원을 시도합니다.매개변수 | |
---|---|
wifiSsid | String : 연결할 Wi-Fi ssid |
wifiPsk | String : PSK 암호 또는 암호화되지 않은 경우 null |
scanSsid | boolean : 이 네트워크의 숨겨진 SSID를 검색할지 여부입니다. |
보고 | |
---|---|
boolean | Wi-Fi 네트워크에 성공적으로 연결된 경우 true . 그렇지 않으면 false |
던지기 | |
---|---|
DeviceNotAvailableException |
connectToWifiNetworkIf필요한 경우
public boolean connectToWifiNetworkIfNeeded (String wifiSsid, String wifiPsk, boolean scanSsid)
장치가 현재 네트워크에 연결되어 있지 않은 경우에만 연결하는 connectToWifiNetwork(String, String)
의 변형입니다.
매개변수 | |
---|---|
scanSsid | boolean : 이 네트워크에 대해 숨겨진 SSID를 검색할지 여부 |
보고 | |
---|---|
boolean | Wi-Fi 네트워크에 성공적으로 연결된 경우 true . 그렇지 않으면 false |
던지기 | |
---|---|
DeviceNotAvailableException |
connectToWifiNetworkIf필요한 경우
public boolean connectToWifiNetworkIfNeeded (String wifiSsid, String wifiPsk)
장치가 현재 네트워크에 연결되어 있지 않은 경우에만 연결하는 connectToWifiNetwork(String, String)
의 변형입니다.
보고 | |
---|---|
boolean | Wi-Fi 네트워크에 성공적으로 연결된 경우 true . 그렇지 않으면 false |
던지기 | |
---|---|
DeviceNotAvailableException |
사용자 생성
public int createUser (String name, boolean guest, boolean ephemeral)
주어진 이름과 제공된 플래그를 사용하여 사용자를 생성합니다.
매개변수 | |
---|---|
name | String : 장치에서 생성할 사용자의 것입니다. |
guest | boolean : 생성 중에 사용자 플래그 --guest를 활성화합니다. |
ephemeral | boolean : 생성 중에 사용자 플래그 --ephemeral을 활성화합니다. |
보고 | |
---|---|
int | 생성된 사용자의 ID |
던지기 | |
---|---|
DeviceNotAvailableException |
사용자 생성
public int createUser (String name, boolean guest, boolean ephemeral, boolean forTesting)
주어진 이름과 제공된 플래그를 사용하여 사용자를 생성합니다.
매개변수 | |
---|---|
name | String : 장치에서 생성할 사용자의 것입니다. |
guest | boolean : 생성 중에 사용자 플래그 --guest를 활성화합니다. |
ephemeral | boolean : 생성 중에 사용자 플래그 --ephemeral을 활성화합니다. |
forTesting | boolean : 생성 중에 테스트 플래그 --for-testing을 활성화합니다. |
보고 | |
---|---|
int | 생성된 사용자의 ID |
던지기 | |
---|---|
DeviceNotAvailableException |
사용자 생성
public int createUser (String name)
지정된 이름과 기본 플래그 0을 사용하여 사용자를 만듭니다.
매개변수 | |
---|---|
name | String : 장치에서 생성할 사용자의 것입니다. |
보고 | |
---|---|
int | 생성된 사용자 ID의 정수 |
던지기 | |
---|---|
DeviceNotAvailableException |
createUserNoThrow
public int createUserNoThrow (String name)
지정된 이름과 기본 플래그 0을 사용하여 사용자를 만듭니다.
매개변수 | |
---|---|
name | String : 장치에서 생성할 사용자의 것입니다. |
보고 | |
---|---|
int | 생성된 사용자 ID의 정수 또는 오류의 경우 -1입니다. |
던지기 | |
---|---|
DeviceNotAvailableException |
파일 삭제
public void deleteFile (String deviceFilePath)
장치에서 파일이나 디렉터리를 삭제하는 도우미 메서드입니다.
매개변수 | |
---|---|
deviceFilePath | String : 장치에 있는 파일의 절대 경로입니다. |
던지기 | |
---|---|
DeviceNotAvailableException |
deregisterDeviceActionReceiver
public void deregisterDeviceActionReceiver (IDeviceActionReceiver deviceActionReceiver)
등록된 IDeviceActionReceiver
제거합니다.
매개변수 | |
---|---|
deviceActionReceiver | IDeviceActionReceiver : 제거될 IDeviceActionReceiver 입니다. |
deviceSoft다시 시작됨
public boolean deviceSoftRestarted (ProcessInfo prevSystemServerProcess)
현재 system_server를 이전 system_server ProcessInfo
와 비교하여 장치가 소프트 재시작되었는지 확인하는 도우미 메서드입니다. ProcessInfo
얻으려면 getProcessByName(String)
사용하십시오.
매개변수 | |
---|---|
prevSystemServerProcess | ProcessInfo : 이전 system_server 프로세스 ProcessInfo . |
보고 | |
---|---|
boolean | 장치가 소프트 재시작되면 true |
던지기 | |
---|---|
DeviceNotAvailableException |
deviceSoftRestarted이후
public boolean deviceSoftRestartedSince (long utcEpochTime, TimeUnit timeUnit)
장치 및 해당 ERROR(/TimeUnit)
에포크 이후 UTC 시간 이후 장치가 소프트 재시작되었는지 확인하는 도우미 메서드입니다. 소프트 재시작은 장치 하드 재부팅(예: 재부팅 요청) 외부에서 system_server가 다시 시작되는 것을 의미합니다. Milliseccond의 현재 장치 utcEpochTime은 getDeviceDate()
메서드를 통해 얻을 수 있습니다.
매개변수 | |
---|---|
utcEpochTime | long : epoch 이후의 장치 시간(초)입니다. |
timeUnit | TimeUnit : 주어진 utcEpochTime에 대한 시간 단위 TimeUnit . |
보고 | |
---|---|
boolean | 장치가 소프트 재시작되면 true |
던지기 | |
---|---|
DeviceNotAvailableException |
비활성화AdbRoot
public boolean disableAdbRoot ()
adb 루트를 끕니다.
adb 루트를 비활성화하면 기기가 adb에서 연결 해제될 수 있습니다. 이 방법은 장치를 사용할 수 있을 때까지 차단됩니다.보고 | |
---|---|
boolean | 성공하면 true . |
던지기 | |
---|---|
DeviceNotAvailableException |
비활성화키가드
public void disableKeyguard ()
키가드를 비활성화하려고 시도합니다.
먼저 입력 디스패치가 준비될 때까지 기다립니다. 이는 장치가 BOOT_COMPLETE를 비동기적으로 보고하는 것과 거의 동시에 발생합니다. 현재 프레임워크 구현에 가끔 경쟁 조건이 있기 때문입니다. 그런 다음 키가드를 해제하라는 명령이 전송됩니다(비보안 키가드에서만 작동).
던지기 | |
---|---|
DeviceNotAvailableException |
비활성화네트워크모니터
public boolean disableNetworkMonitor ()
장치에서 네트워크 모니터링을 비활성화합니다.
보고 | |
---|---|
boolean | 모니터링이 성공적으로 비활성화된 경우 true . 실패하면 false . |
던지기 | |
---|---|
DeviceNotAvailableException |
Wi-Fi 연결 해제
public boolean disconnectFromWifi ()
Wi-Fi 네트워크 연결을 끊습니다.
알려진 네트워크 목록에서 모든 네트워크를 제거하고 Wi-Fi를 비활성화합니다.보고 | |
---|---|
boolean | Wi-Fi 네트워크 연결이 성공적으로 끊어지면 true . 연결 해제에 실패하면 false . |
던지기 | |
---|---|
DeviceNotAvailableException |
파일이 존재합니까?
public boolean doesFileExist (String deviceFilePath, int userId)
특정 사용자에 대해 장치에 파일이 있는지 확인하는 도우미 메서드입니다.
매개변수 | |
---|---|
deviceFilePath | String : 확인할 장치의 파일 절대 경로 |
userId | int : 파일 존재 여부를 확인할 사용자 ID |
보고 | |
---|---|
boolean | 파일이 존재하면 true , 그렇지 않으면 false . |
던지기 | |
---|---|
DeviceNotAvailableException |
파일이 존재합니까?
public boolean doesFileExist (String deviceFilePath)
장치에 파일이 있는지 확인하는 도우미 메서드입니다.
매개변수 | |
---|---|
deviceFilePath | String : 확인할 장치의 파일 절대 경로 |
보고 | |
---|---|
boolean | 파일이 존재하면 true , 그렇지 않으면 false . |
던지기 | |
---|---|
DeviceNotAvailableException |
덤프힙
public File dumpHeap (String process, String devicePath)
system_server에서 힙 덤프를 시도합니다. 덤프된 파일을 정리하는 것은 호출자의 책임입니다.
매개변수 | |
---|---|
process | String : 덤프할 장치 프로세스의 이름입니다. |
devicePath | String : 덤프를 넣을 장치의 경로입니다. 권한이 허용되는 위치여야 합니다. |
보고 | |
---|---|
File | 보고서가 포함된 ERROR(/File) 입니다. 실패한 경우 Null입니다. |
던지기 | |
---|---|
DeviceNotAvailableException |
활성화AdbRoot
public boolean enableAdbRoot ()
adb 루트를 켭니다. "enable-root" 설정이 "false"이면 메시지를 기록하고 루트를 활성화하지 않고 반환됩니다.
adb 루트를 활성화하면 기기가 adb에서 연결 해제될 수 있습니다. 이 방법은 장치를 사용할 수 있을 때까지 차단됩니다.보고 | |
---|---|
boolean | 성공하면 true . |
던지기 | |
---|---|
DeviceNotAvailableException |
활성화네트워크모니터
public boolean enableNetworkMonitor ()
장치에서 네트워크 모니터링을 활성화합니다.
보고 | |
---|---|
boolean | 모니터링이 성공적으로 활성화되면 true 입니다. 실패하면 false . |
던지기 | |
---|---|
DeviceNotAvailableException |
실행Adb명령
public String executeAdbCommand (long timeout, String... cmdArgs)
지정된 시간 제한을 사용하여 adb 명령을 시스템 명령으로 실행하는 도우미 메서드입니다.
대신에 가능한 경우 executeShellCommand(String)
사용해야 합니다. 해당 메서드는 더 나은 실패 감지 및 성능을 제공하기 때문입니다.
매개변수 | |
---|---|
timeout | long : 장치가 응답하지 않는 것으로 간주되기까지의 시간(밀리초), 시간 초과가 없는 경우 0L |
cmdArgs | String : 실행할 adb 명령어 및 인수 |
보고 | |
---|---|
String | 명령의 표준 출력. 명령 실행에 실패한 경우 null . |
던지기 | |
---|---|
DeviceNotAvailableException |
실행Adb명령
public String executeAdbCommand (long timeout,envMap, String... cmdArgs)
지정된 시간 제한을 사용하여 adb 명령을 시스템 명령으로 실행하는 도우미 메서드입니다.
대신에 가능한 경우 executeShellCommand(String)
사용해야 합니다. 해당 메서드는 더 나은 실패 감지 및 성능을 제공하기 때문입니다.
매개변수 | |
---|---|
timeout | long : 장치가 응답하지 않는 것으로 간주되기까지의 시간(밀리초), 시간 초과가 없는 경우 0L |
envMap | |
cmdArgs | String : 실행할 adb 명령어 및 인수 |
보고 | |
---|---|
String | 명령의 표준 출력. 명령 실행에 실패한 경우 null . |
던지기 | |
---|---|
DeviceNotAvailableException |
실행Adb명령
public String executeAdbCommand (String... cmdArgs)
adb 명령을 시스템 명령으로 실행하는 도우미 메서드입니다.
대신에 가능한 경우executeShellCommand(String)
사용해야 합니다. 해당 메서드는 더 나은 실패 감지 및 성능을 제공하기 때문입니다.매개변수 | |
---|---|
cmdArgs | String : 실행할 adb 명령어 및 인수 |
보고 | |
---|---|
String | 명령의 표준 출력. 명령 실행에 실패한 경우 null . |
던지기 | |
---|---|
DeviceNotAvailableException |
ExecuteFastboot명령
public CommandResult executeFastbootCommand (String... cmdArgs)
기본 시간 제한이 2분인 시스템 명령으로 fastboot 명령을 실행하는 도우미 메서드입니다.
기기가 이미 fastboot 모드에 있을 때 사용될 것으로 예상됩니다.
매개변수 | |
---|---|
cmdArgs | String : 실행할 fastboot 명령 및 인수 |
보고 | |
---|---|
CommandResult | 명령의 출력을 포함하는 CommandResult |
던지기 | |
---|---|
DeviceNotAvailableException |
ExecuteFastboot명령
public CommandResult executeFastbootCommand (long timeout, String... cmdArgs)
fastboot 명령을 시스템 명령으로 실행하는 도우미 메서드입니다.
기기가 이미 fastboot 모드에 있을 때 사용될 것으로 예상됩니다.매개변수 | |
---|---|
timeout | long : 명령이 만료되기 전의 시간(밀리초) |
cmdArgs | String : 실행할 fastboot 명령 및 인수 |
보고 | |
---|---|
CommandResult | 명령의 출력을 포함하는 CommandResult |
던지기 | |
---|---|
DeviceNotAvailableException |
실행LongFastboot명령
public CommandResult executeLongFastbootCommand (String... cmdArgs)
장기 실행 fastboot 명령을 시스템 명령으로 실행하는 도우미 방법입니다.
더 긴 시간 제한을 사용한다는 점을 제외하면executeFastbootCommand(String)
와 동일합니다.매개변수 | |
---|---|
cmdArgs | String : 실행할 fastboot 명령 및 인수 |
보고 | |
---|---|
CommandResult | 명령의 출력을 포함하는 CommandResult |
던지기 | |
---|---|
DeviceNotAvailableException |
실행LongFastboot명령
public CommandResult executeLongFastbootCommand (envVarMap, String... cmdArgs)
시스템 환경 변수를 사용하여 장기 실행 fastboot 명령을 시스템 명령으로 실행하는 도우미 방법입니다.
더 긴 시간 초과를 사용한다는 점을 제외하면 executeFastbootCommand(String)
와 동일합니다.
매개변수 | |
---|---|
envVarMap | |
cmdArgs | String : 실행할 fastboot 명령 및 인수 |
보고 | |
---|---|
CommandResult | 명령의 출력을 포함하는 CommandResult |
던지기 | |
---|---|
DeviceNotAvailableException |
실행쉘명령
public String executeShellCommand (String command)
adb 쉘 명령어를 실행하고 출력을 String
으로 반환하는 도우미 메서드입니다.
매개변수 | |
---|---|
command | String : 실행할 adb 쉘 명령어 |
보고 | |
---|---|
String | 쉘 출력 |
던지기 | |
---|---|
DeviceNotAvailableException |
실행쉘명령
public void executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts)
명령 동작을 제어하기 위한 추가 매개변수와 함께 adb 쉘 명령을 실행합니다.
매개변수 | |
---|---|
command | String : 실행할 adb 쉘 명령어 |
receiver | IShellOutputReceiver : 쉘 출력을 전달할 IShellOutputReceiver 입니다. |
maxTimeToOutputShellResponse | long : 명령이 응답을 출력하지 않도록 허용되는 최대 시간입니다. timeUnit 에 지정된 단위 |
timeUnit | TimeUnit : maxTimeToOutputShellResponse 의 단위 |
retryAttempts | int : 예외로 인해 실패한 경우 재 시도 명령에 최대 횟수입니다. retryAttempts 성공하지 않고 수행되면 DevicenotResponsiveException이 발생합니다. |
던지기 | |
---|---|
DeviceNotAvailableException |
ExecuteshellCommand
public void executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeoutForCommand, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts)
명령 동작을 제어하기 위해 더 많은 매개 변수가있는 ADB Shell 명령을 실행합니다.
매개변수 | |
---|---|
command | String : 실행할 ADB 쉘 명령 |
receiver | IShellOutputReceiver : 쉘 출력을 직접 IShellOutputReceiver . |
maxTimeoutForCommand | long : 명령이 완료 될 수있는 최대 시간 초과; timeUnit 에 지정된 단위 |
maxTimeToOutputShellResponse | long : 명령이 응답을 출력 할 수없는 최대 시간; timeUnit 에 지정된 단위 |
timeUnit | TimeUnit : maxTimeToOutputShellResponse 용 장치 |
retryAttempts | int : 예외로 인해 실패한 경우 재 시도 명령에 최대 횟수입니다. retryAttempts 성공하지 않고 수행되면 DevicenotResponsiveException이 발생합니다. |
던지기 | |
---|---|
DeviceNotAvailableException |
ExecuteshellCommand
public void executeShellCommand (String command, IShellOutputReceiver receiver)
주어진 ADB 쉘 명령을 실행하여 명령이 실패하면 여러 번 다시 시도합니다.
기본값이있는 더 간단한 형태의executeShellCommand(String, com.android.ddmlib.IShellOutputReceiver, long, TimeUnit, int)
.매개변수 | |
---|---|
command | String : 실행할 ADB 쉘 명령 |
receiver | IShellOutputReceiver : 쉘 출력을 직접 IShellOutputReceiver . |
던지기 | |
---|---|
DeviceNotAvailableException |
Executeshellv2Command
public CommandResult executeShellV2Command (String cmd)
ADB 쉘 명령을 실행하고 명령 상태 출력, STDOUT 및 STDERR로 올바르게 채워진 CommandResult
으로 결과를 반환하는 도우미 메소드.
매개변수 | |
---|---|
cmd | String : 실행 해야하는 명령. |
보고 | |
---|---|
CommandResult | CommandResult 의 결과. |
던지기 | |
---|---|
DeviceNotAvailableException |
Executeshellv2Command
public CommandResult executeShellV2Command (String cmd, OutputStream pipeToOutput)
ADB 쉘 명령을 실행하고 명령 상태 출력 및 stderr로 올바르게 채워진 CommandResult
으로 결과를 반환하는 도우미 메소드. STDOUT는 지정된 스트림으로 향합니다.
매개변수 | |
---|---|
cmd | String : 실행 해야하는 명령. |
pipeToOutput | OutputStream : STD 출력이 리디렉션되거나 Null이 ERROR(/OutputStream) . |
보고 | |
---|---|
CommandResult | CommandResult 의 결과. |
던지기 | |
---|---|
DeviceNotAvailableException |
Executeshellv2Command
public CommandResult executeShellV2Command (String cmd, File pipeAsInput)
ADB 쉘 명령을 실행하고 명령 상태 출력, STDOUT 및 STDERR로 올바르게 채워진 CommandResult
으로 결과를 반환하는 헬퍼 메소드.
매개변수 | |
---|---|
cmd | String : 실행 해야하는 명령. |
pipeAsInput | File : 명령에 입력 또는 null로 파이프로 연결되는 ERROR(/File) . |
보고 | |
---|---|
CommandResult | CommandResult 의 결과. |
던지기 | |
---|---|
DeviceNotAvailableException |
Executeshellv2Command
public CommandResult executeShellV2Command (String cmd, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
명령 동작을 제어하기 위해 더 많은 매개 변수가있는 ADB Shell 명령을 실행합니다.
매개변수 | |
---|---|
cmd | String : 실행할 ADB 쉘 명령 |
maxTimeoutForCommand | long : 명령이 완료 될 수있는 최대 시간 초과; timeUnit 에 지정된 단위 |
timeUnit | TimeUnit : maxTimeToOutputShellResponse 용 장치 |
retryAttempts | int : 예외로 인해 실패한 경우 재 시도 명령에 최대 횟수입니다. retryAttempts 성공하지 않고 수행되면 DevicenotResponsiveException이 발생합니다. |
보고 | |
---|---|
CommandResult |
던지기 | |
---|---|
DeviceNotAvailableException |
Executeshellv2Command
public CommandResult executeShellV2Command (String cmd, long maxTimeoutForCommand, TimeUnit timeUnit)
명령 동작을 제어하기 위해 더 많은 매개 변수가있는 ADB Shell 명령을 실행합니다.
매개변수 | |
---|---|
cmd | String : 실행할 ADB 쉘 명령 |
maxTimeoutForCommand | long : 명령이 완료 될 수있는 최대 시간 초과; timeUnit 에 지정된 단위 |
timeUnit | TimeUnit : maxTimeToOutputShellResponse 용 장치 |
보고 | |
---|---|
CommandResult |
던지기 | |
---|---|
DeviceNotAvailableException |
Executeshellv2Command
public CommandResult executeShellV2Command (String cmd, File pipeAsInput, OutputStream pipeToOutput, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
명령 동작을 제어하기 위해 더 많은 매개 변수가있는 ADB Shell 명령을 실행합니다.
매개변수 | |
---|---|
cmd | String : 실행할 ADB 쉘 명령 |
pipeAsInput | File : 명령에 입력 또는 null로 파이프로 연결되는 ERROR(/File) . |
pipeToOutput | OutputStream : STD 출력이 리디렉션되거나 Null이 ERROR(/OutputStream) . |
maxTimeoutForCommand | long : 명령이 완료 될 수있는 최대 시간 초과; timeUnit 에 지정된 단위 |
timeUnit | TimeUnit : maxTimeToOutputShellResponse 용 장치 |
retryAttempts | int : 예외로 인해 실패한 경우 재 시도 명령에 최대 횟수입니다. retryAttempts 성공하지 않고 수행되면 DevicenotResponsiveException이 발생합니다. |
보고 | |
---|---|
CommandResult |
던지기 | |
---|---|
DeviceNotAvailableException |
Executeshellv2Command
public CommandResult executeShellV2Command (String cmd, File pipeAsInput, OutputStream pipeToOutput, OutputStream pipeToError, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
명령 동작을 제어하기 위해 더 많은 매개 변수가있는 ADB Shell 명령을 실행합니다.
매개변수 | |
---|---|
cmd | String : 실행할 ADB 쉘 명령 |
pipeAsInput | File : 명령에 입력 또는 null로 파이프로 연결되는 ERROR(/File) . |
pipeToOutput | OutputStream : STD 출력이 리디렉션되거나 Null이 ERROR(/OutputStream) . |
pipeToError | OutputStream : STD 오류가 리디렉션되거나 NULL이있는 ERROR(/OutputStream) . |
maxTimeoutForCommand | long : 명령이 완료 될 수있는 최대 시간 초과; timeUnit 에 지정된 단위 |
timeUnit | TimeUnit : maxTimeToOutputShellResponse 용 장치 |
retryAttempts | int : 예외로 인해 실패한 경우 재 시도 명령에 최대 횟수입니다. retryAttempts 성공하지 않고 수행되면 DevicenotResponsiveException이 발생합니다. |
보고 | |
---|---|
CommandResult |
던지기 | |
---|---|
DeviceNotAvailableException |
FASTBOOTWIPEPARTITION
public CommandResult fastbootWipePartition (String partition)
장치의 파티션을 지우는 도우미 방법.
getUseFastbootErase()
true
이면 Fastboot Erase가 파티션을 지우는 데 사용됩니다. 그런 다음 장치는 다음에 장치 부츠를 부팅 할 때 파일 시스템을 생성해야합니다. 그렇지 않으면 FastBoot 형식이 사용되어 장치에 새 파일 시스템이 생성됩니다. 장치가 이미 Fastboot 모드에있을 때 사용될 것으로 예상됩니다.매개변수 | |
---|---|
partition | String : 닦는 파티션 |
보고 | |
---|---|
CommandResult | 명령 출력을 포함하는 명령 |
던지기 | |
---|---|
DeviceNotAvailableException |
getActiveApexes
publicgetActiveApexes ()
장치에서 활성화 된 정점에 대한 정보를 가져옵니다.
보고 | |
---|---|
현재 장치에서 활성화 된 ApexInfo 의 ERROR(/Set) |
던지기 | |
---|---|
DeviceNotAvailableException |
getAllSettings
publicgetAllSettings (String namespace)
요청 된 네임 스페이스의 키 값 쌍을 반환합니다.
매개변수 | |
---|---|
namespace | String : { "System", "Secure", "Global"} 중 하나 여야합니다. |
보고 | |
---|---|
키 값 쌍의지도. NULL IF 네임 스페이스가 지원되지 않습니다. |
던지기 | |
---|---|
DeviceNotAvailableException |
getAllocationState
public DeviceAllocationState getAllocationState ()
장치의 현재 할당 상태를 반환하십시오
보고 | |
---|---|
DeviceAllocationState |
getAndroidId
public String getAndroidId (int userId)
userID와 관련된 Android-ID를 찾아서 찾을 수없는 경우 NULL을 찾아 반환하십시오.
매개변수 | |
---|---|
userId | int |
보고 | |
---|---|
String |
던지기 | |
---|---|
DeviceNotAvailableException |
getAndroidId
publicgetAndroidIds ()
일치하는 사용자 ID를 찾은 Android ID의 맵을 만듭니다. 각 사용자 ID 가이 기능과 관련된 Android ID를 찾을 수있는 보험이 없으므로 일부 사용자 ID는 NULL과 일치 할 수 있습니다.
보고 | |
---|---|
Android ID의지도를 찾았습니다. |
던지기 | |
---|---|
DeviceNotAvailableException |
getapilevel
public int getApiLevel ()
장치 API 레벨을 얻으십시오. defaults UNKNOWN_API_LEVEL
에 대한 기본값.
보고 | |
---|---|
int | 장치의 API 레벨을 나타내는 정수 |
던지기 | |
---|---|
DeviceNotAvailableException |
getAppPackage정보
public PackageInfo getAppPackageInfo (String packageName)
장치에 설치된 패키지에 대한 정보를 가져옵니다.
매개변수 | |
---|---|
packageName | String |
보고 | |
---|---|
PackageInfo | 정보를 검색 할 수없는 경우 PackageInfo 또는 null |
던지기 | |
---|---|
DeviceNotAvailableException |
getAppPackageInfos
publicgetAppPackageInfos ()
장치에 설치된 패키지의 정보를 가져옵니다.
보고 | |
---|---|
장치에 설치된 PackageInfo 의 ERROR(/List) . |
던지기 | |
---|---|
DeviceNotAvailableException |
GetBaseBandversion
public String getBasebandVersion ()
이 장치의 BaseBand (Radio) 버전을 얻는 편의 방법. 라디오 버전을 얻는 것은 장치에 따라 다르므로 모든 장치에 대한 올바른 정보를 반환하지 않을 수 있습니다. 이 메소드는 GSM.Version.BaseBand Propery에 의존하여 올바른 버전 정보를 반환합니다. 이는 일부 CDMA 장치의 경우 정확하지 않으며 여기에서 반환 된 버전은 FastBoot에서보고 된 버전과 일치하지 않을 수 있으며 CDMA 라디오의 버전을 반환하지 않을 수 있습니다. TL; DR이 메소드는 gsm.version.baseband 속성이 fastboot getvar version-baseband
에서 반환 한 버전과 동일 인 경우 정확한 버전 만보고합니다.
보고 | |
---|---|
String | String 베이스 밴드 버전 또는 null 결정할 수없는 경우 (장치가 없거나 버전 문자열이 없음) 읽을 수 없습니다) |
던지기 | |
---|---|
DeviceNotAvailableException |
getbattery
public Integer getBattery ()
배터리 레벨을 사용할 수없는 경우 장치의 현재 배터리 레벨을 반환합니다.
보고 | |
---|---|
Integer |
GetBooleanProperty
public boolean getBooleanProperty (String name, boolean defaultValue)
주어진 속성의 부울 값을 반환합니다.
매개변수 | |
---|---|
name | String : 속성 이름 |
defaultValue | boolean : 부동산이 비어 있거나 존재하지 않는 경우 반환 할 기본값. |
보고 | |
---|---|
boolean | 속성에 "1" , "y" , "yes" , "on" 또는 "true" 가있는 경우, 속성의 값 false "0" , "n" , "no" , "off" 인 경우 true . "false" 또는 그렇지 않으면 defaultValue . |
던지기 | |
---|---|
DeviceNotAvailableException |
getboothistory
publicgetBootHistory ()
헬퍼 방법은 부팅 시간과 부팅 이유가있는 부팅 기록 맵을 수집합니다.
보고 | |
---|---|
부팅 시간지도 (Epoch 이후 두 번째로 UTC 시간) 및 부팅 이유 |
던지기 | |
---|---|
DeviceNotAvailableException |
getboothistorysince
publicgetBootHistorySince (long utcEpochTime, TimeUnit timeUnit)
Helper Method는 장치에서 Epoch와 지정된 시간 단위 이후 주어진 시간 이후 부팅 시간 및 부팅 이유로 부팅 기록 맵을 수집합니다. 밀리 초의 현재 장치 Utcepochtime은 method getDeviceDate()
에 의해 얻을 수 있습니다.
매개변수 | |
---|---|
utcEpochTime | long : Epoch 이후 장치 시간. |
timeUnit | TimeUnit : 시간 단위 TimeUnit . |
보고 | |
---|---|
부팅 시간지도 (Epoch 이후 두 번째로 UTC 시간) 및 부팅 이유 |
던지기 | |
---|---|
DeviceNotAvailableException |
GetBootloaderVersion
public String getBootloaderVersion ()
이 장치의 BootLoader 버전을 얻는 편의 방법.
장치의 현재 상태에서 부트 로더 버전을 검색하려고 시도합니다. (즉, 장치가 FastBoot 모드에있는 경우 FastBoot에서 버전을 검색하려고 시도합니다)보고 | |
---|---|
String | String 부트 로더 버전 또는 찾을 수없는 경우 null |
던지기 | |
---|---|
DeviceNotAvailableException |
getbugreport
public InputStreamSource getBugreport ()
장치에서 버그보고를 검색합니다.
이것의 구현은 SDCard (또는 SDCard가 아직 장착되지 않은 경우)없이 장치에서 계속 작동 할 수 있습니다.
보고 | |
---|---|
InputStreamSource | InputStreamSource 는 주문시 버그보고 내용을 생성 할 수 있습니다. 실패의 경우 InputStreamSource 빈 ERROR(/InputStream) 생성합니다. |
getbugreportz
public InputStreamSource getBugreportz ()
장치에서 BugReportz를 검색합니다. Zip Format Bugreport에는 기본 버그보고 및 디버깅에 유용한 기타 로그 파일이 포함되어 있습니다.
'ADB 버전'> 1.0.36에만 지원됩니다
보고 | |
---|---|
InputStreamSource | BugReportz가 포함 된 zip 파일의 InputStreamSource , 고장시 NULL을 반환합니다. |
getbuildalias
public String getBuildAlias ()
장치가 현재 실행중인 빌드의 별칭을 검색하십시오.
빌드 별명은 일반적으로 빌드 ID보다 더 읽기 쉬운 문자열입니다 (일반적으로 넥서스 빌드의 경우 숫자). 예를 들어, 최종 Android 4.2 릴리스에는 Alias JDQ39를 빌드하고 ID 573038을 빌드했습니다.
보고 | |
---|---|
String | 빌드 별명 또는 검색 할 수없는 경우 빌드 ID로 돌아 가기 |
던지기 | |
---|---|
DeviceNotAvailableException |
getbuildflavor
public String getBuildFlavor ()
장치의 빌드 맛을 검색하십시오.
보고 | |
---|---|
String | 검색 할 수없는 경우 빌드 맛 또는 무효 |
던지기 | |
---|---|
DeviceNotAvailableException |
GetBuildid
public String getBuildId ()
빌드 검색 장치가 현재 실행 중입니다.
보고 | |
---|---|
String | 빌드 ID 또는 IBuildInfo#UNKNOWN_BUILD_ID 검색 할 수없는 경우 |
던지기 | |
---|---|
DeviceNotAvailableException |
GetBuildSigningkeys
public String getBuildSigningKeys ()
장치 이미지에 서명하는 데 사용되는 키 유형을 반환합니다.
일반적으로 Android 기기는 테스트 키 (ASP 예 : ASP) 또는 릴리스 키 (개별 장치 제조업체에 의해 제어)와 서명 할 수 있습니다.
보고 | |
---|---|
String | 서명 키를 찾으면 널 null. |
던지기 | |
---|---|
DeviceNotAvailableException |
getCachedDeviceScriptor
public DeviceDescriptor getCachedDeviceDescriptor ()
장치가 할당 된 경우 캐시 된 DeviceDescriptor
반환합니다. 그렇지 않으면 현재 DeviceDescriptor
반환합니다.
보고 | |
---|---|
DeviceDescriptor |
getCachedDeviceScriptor
public DeviceDescriptor getCachedDeviceDescriptor (boolean shortDescriptor)
장치가 할당 된 경우 캐시 된 DeviceDescriptor
반환합니다. 그렇지 않으면 현재 DeviceDescriptor
반환합니다.
매개변수 | |
---|---|
shortDescriptor | boolean : 디스크립터를 최소 정보로 제한할지 여부 |
보고 | |
---|---|
DeviceDescriptor |
GetChildren
public String[] getChildren (String path)
권한으로 인해 때때로 작동하지 않는 IFileEntry
사용하는 대안.
매개변수 | |
---|---|
path | String : 검색을 수행 할 장치의 경로입니다. |
보고 | |
---|---|
String[] | 장치의 경로에 모든 파일을 포함하는 문자열 배열. |
던지기 | |
---|---|
DeviceNotAvailableException |
getCurrentFoldableState
public DeviceFoldableState getCurrentFoldableState ()
일부 문제가 발생하면 장치의 현재 접이식 상태를 반환하거나 NULL을 반환합니다.
보고 | |
---|---|
DeviceFoldableState |
던지기 | |
---|---|
DeviceNotAvailableException |
getCurrentUser
public int getCurrentUser ()
현재 실행중인 사용자의 ID를 반환하십시오. 오류의 경우 -10000을 반환하십시오.
보고 | |
---|---|
int |
던지기 | |
---|---|
DeviceNotAvailableException |
getDevicedate
public long getDeviceDate ()
장치 날짜를 Epoch 이후 밀리 초로 반환하십시오.
보고 | |
---|---|
long | 장치의 날짜는 Epoch 형식입니다. |
던지기 | |
---|---|
DeviceNotAvailableException |
getDeviceDescriptor
public DeviceDescriptor getDeviceDescriptor ()
장치 정보에서 DeviceDescriptor
반환하여 실제 장치 객체를 전달하지 않고 정보를 얻으십시오.
보고 | |
---|---|
DeviceDescriptor |
getDeviceDescriptor
public DeviceDescriptor getDeviceDescriptor (boolean shortDescriptor)
장치 정보에서 DeviceDescriptor
반환하여 실제 장치 객체를 전달하지 않고 정보를 얻으십시오.
매개변수 | |
---|---|
shortDescriptor | boolean : 디스크립터를 최소 정보로 제한할지 여부 |
보고 | |
---|---|
DeviceDescriptor |
getDevicetimeOffset
public long getDeviceTimeOffset (Date date)
장치와 주어진 ERROR(/Date)
사이의 시차를 얻으려면 도우미. 내부적으로 Epoch 시간을 사용하십시오.
매개변수 | |
---|---|
date | Date |
보고 | |
---|---|
long | 밀리 초의 차이 |
던지기 | |
---|---|
DeviceNotAvailableException |
getemulatoroutput
public InputStreamSource getEmulatorOutput ()
에뮬레이터 stdout과 stderr의 스트림을 얻으십시오
보고 | |
---|---|
InputStreamSource | 에뮬레이터 출력 |
getemulatorProcess
public Process getEmulatorProcess ()
이 에뮬레이터에 해당하는 Process
반환하십시오.
보고 | |
---|---|
Process | Process 또는 null |
getExecuteshellCommandLog
public final File getExecuteShellCommandLog ()
모든 executeShellCommand(String)
로그가 포함 된 로그.
보고 | |
---|---|
File |
getexternalstorefreespace
public long getExternalStoreFreeSpace ()
장치 외부 스토리지의 여유 공간 양을 결정하는 도우미 방법.
보고 | |
---|---|
long | KB의 여유 공간의 양 |
던지기 | |
---|---|
DeviceNotAvailableException |
getFastboot경로
public String getFastbootPath ()
사용중인 Fastboot Binary의 경로를 반환합니다. Fastboot 기능을 활성화하려면 여전히 isFastbootEnabled()
필요합니다.
보고 | |
---|---|
String |
GetFastBootProductType
public String getFastbootProductType ()
편의 방법이 장치의 제품 유형을 패스트 부츠 모드에있을 때.
이 방법은 장치가 FastBoot에있는 경우에만 사용해야합니다. 이 경우 일반적인getProductType()
메소드보다 약간 더 안전한 변형이 있습니다.이 경우 장치가 장치가 잘못된 상태에 있거나 응답하지 않으면 장치를 Fastboot로 복구하는 것을 알고 있기 때문입니다.보고 | |
---|---|
String | String 제품 유형 이름 또는 null 결정할 수없는 경우 |
던지기 | |
---|---|
DeviceNotAvailableException |
getfastbootproductvariant
public String getFastbootProductVariant ()
편의 방법이 장치의 제품 유형을 패스트 부츠 모드에있을 때.
이 방법은 장치가 FastBoot에있는 경우에만 사용해야합니다. 이 경우 일반적인getProductType()
메소드보다 약간 더 안전한 변형이 있습니다.이 경우 장치가 장치가 잘못된 상태에 있거나 응답하지 않으면 장치를 Fastboot로 복구하는 것을 알고 있기 때문입니다.보고 | |
---|---|
String | String 제품 유형 이름 또는 null 결정할 수없는 경우 |
던지기 | |
---|---|
DeviceNotAvailableException |
getfastbootserialnumber
public String getFastbootSerialNumber ()
Fastboot 모드 일련 번호를 반환합니다.
보고 | |
---|---|
String |
getfastbootvariable
public String getFastbootVariable (String variableName)
장치에서 주어진 Fastboot 변수 값을 검색하십시오.
매개변수 | |
---|---|
variableName | String : 변수 이름 |
보고 | |
---|---|
String | 존재하지 않는 경우 속성 값 또는 null |
던지기 | |
---|---|
DeviceNotAvailableException |
getfastbootversion
public String getFastbootVersion ()
사용중인 Fastboot Binary의 버전 문자열을 반환합니다. 또는 뭔가 잘못되면 널.
보고 | |
---|---|
String |
getfileentry
public IFileEntry getFileEntry (String path)
장치의 원격 파일에 대한 참조를 검색하십시오.
매개변수 | |
---|---|
path | String : 검색 할 파일 경로. '/'에 대한 절대 경로 또는 경로 일 수 있습니다. (즉, "/system"및 "system"구문이 모두 지원됩니다) |
보고 | |
---|---|
IFileEntry | 주어진 path 에서 파일을 찾을 수없는 경우 IFileEntry 또는 null |
던지기 | |
---|---|
DeviceNotAvailableException |
getfileentry
public IFileEntry getFileEntry (FileListingService.FileEntry entry)
비 뿌리 경로에서 FileEntry
얻는 비공식 도우미. FixMe : FileEntry 시스템을 리팩터하여 모든 경로에서 사용할 수 있도록합니다. (비 루트조차도).
매개변수 | |
---|---|
entry | FileListingService.FileEntry : ddmlib가 요구하는 것처럼 FileEntry 루트가 필요하지는 않습니다. |
보고 | |
---|---|
IFileEntry | FileEntry를 나타내는 FileNentRyWrapper. |
던지기 | |
---|---|
| com.android.tradefed.device.devicenotavailableException |
DeviceNotAvailableException |
getFoldableStates
publicgetFoldableStates ()
장치의 접이식 상태 목록을 반환합니다. "cmd device_state print-states"로 얻을 수 있습니다.
보고 | |
---|---|
던지기 | |
---|---|
DeviceNotAvailableException |
getidevice
public IDevice getIDevice ()
관련 ddmlib IDevice
에 대한 참조를 반환합니다.
IDevice
DDMS에 의해 할당 될 수 있습니다. 따라서 발신자는 IDevice
에 대한 언급을 유지해서는 안됩니다. 그 참조는 오래 될 수 있기 때문입니다.보고 | |
---|---|
IDevice | IDevice |
getInstalledPackageNames
publicgetInstalledPackageNames ()
장치에있는 응용 프로그램 패키지 이름을 가져 오십시오.
보고 | |
---|---|
현재 장치에 설치된 String 패키지 이름의 ERROR(/Set) . |
던지기 | |
---|---|
DeviceNotAvailableException |
getIntProperty
public long getIntProperty (String name, long defaultValue)
장치에서 주어진 속성의 정수 값을 반환합니다.
매개변수 | |
---|---|
name | String : 속성 이름 |
defaultValue | long : 부동산이 비어 있거나 존재하지 않는 경우 반환 할 기본값. |
보고 | |
---|---|
long | 속성 값 또는 defaultValue 속성이 비어 있거나 존재하지 않거나 정수 값이없는 경우. |
던지기 | |
---|---|
DeviceNotAvailableException |
getipaddress
public String getIpAddress ()
장치의 IP 주소를 가져옵니다.
보고 | |
---|---|
String | 장치의 IP 주소 또는 장치가 IP 주소가없는 경우 null |
던지기 | |
---|---|
DeviceNotAvailableException |
getKeyguard상태
public KeyguardControllerState getKeyguardState ()
객체를 반환하여 키 가드의 현재 상태를 얻거나 지원되지 않으면 NULL을 가져옵니다.
보고 | |
---|---|
KeyguardControllerState | 키 가드 상태의 스냅 샷을 포함하는 KeyguardControllerState 및 키 가드 쿼리가 지원되지 않으면 NULL을 반환합니다. |
던지기 | |
---|---|
DeviceNotAvailableException |
getLastExpectedReboottimEmillis
public long getLastExpectedRebootTimeMillis ()
Tradefed API가 System.currentTimeMillis()
에 의해 반환 된 이후로 Milliseconds로 재부팅을 트리거 한 마지막 시간을 반환합니다.
보고 | |
---|---|
long |
GetLaunchapilevel
public int getLaunchApiLevel ()
장치에서 처음 시작된 API 레벨을 가져옵니다. defaults UNKNOWN_API_LEVEL
에 대한 기본값.
보고 | |
---|---|
int | 처음 시작된 API 수준의 장치를 나타내는 정수 |
던지기 | |
---|---|
DeviceNotAvailableException |
getLogcat
public InputStreamSource getLogcat ()
LOGCAT 데이터의 스냅 샷 스트림을 가져옵니다.
두 가지 모드로 작동합니다.
TestDeviceOptions.getMaxLogcatDataSize()
바이트의 현재 내용의 현재 내용 LogCat Capture로 돌아갑니다.보고 | |
---|---|
InputStreamSource |
getLogcat
public InputStreamSource getLogcat (int maxBytes)
캡처 된 LOGCAT 데이터의 마지막 maxBytes
의 스냅 샷 스트림을 가져옵니다.
전체 getLogcat()
스냅 샷을 얻는 데있어 잠재적으로 큰 디스크 공간 페널티를 발생시키지 않고 캡처 된 LOGCAT 데이터의 빈번한 스냅 샷을 캡처하려는 경우에 유용합니다.
매개변수 | |
---|---|
maxBytes | int : 반환 할 최대 데이터 금액. 메모리에 편안하게 맞을 수있는 금액이어야합니다. |
보고 | |
---|---|
InputStreamSource |
GetLogcatDump
public InputStreamSource getLogcatDump ()
장치의 현재 로그 캣 덤프를 가져옵니다. getLogcat()
과 달리이 메소드는 항상 logcat의 정적 덤프를 반환합니다.
장치에 도달 할 수없는 경우 아무것도 반환되지 않을 것이라는 단점이 있습니다.
보고 | |
---|---|
InputStreamSource | logcat 데이터의 InputStreamSource . LogCat 데이터를 캡처하지 않으면 빈 스트림이 반환됩니다. |
GetLogcatsince
public InputStreamSource getLogcatSince (long date)
제공된 날짜를 시작하는 캡처 된 로그 캣 데이터의 스냅 샷 스트림을 잡습니다. 장치의 시간은 getDeviceDate()
사용해야합니다.
매개변수 | |
---|---|
date | long : 현재까지 스냅 샷을 시작할시기의 Epoch 형식 이후 밀리 초입니다. ( '날짜 +%s'를 사용하여 얻을 수 있습니다) |
보고 | |
---|---|
InputStreamSource |
getMacAddress
public String getMacAddress ()
장치의 MAC 주소를 반환하고 장치에서 쿼리에 실패하면 NULL을 반환합니다.
보고 | |
---|---|
String |
getMainUserId
public Integer getMainUserId ()
기본 사용자 ID를 반환합니다.
보고 | |
---|---|
Integer | 메인 사용자가있는 경우 메인 사용자가 있고 주 사용자가없는 경우 NULL. |
던지기 | |
---|---|
DeviceNotAvailableException |
getMainlineModuleInfo
publicgetMainlineModuleInfo ()
장치에 설치된 메인 라인 모듈에 대한 정보를 얻으십시오.
보고 | |
---|---|
현재 장치에 설치된 String 메인 라인 모듈의 ERROR(/Set) . |
던지기 | |
---|---|
DeviceNotAvailableException |
getMaxNumberOfRunningUsers지원됨
public int getMaxNumberOfRunningUsersSupported ()
동시에 운영되는 사용자 수의 최대 수를 얻으십시오. 기본값은 0까지.
보고 | |
---|---|
int | 동시에 실행하는 사용자의 수를 나타내는 정수 |
던지기 | |
---|---|
DeviceNotAvailableException |
getMaxNumberOfUsers지원됨
public int getMaxNumberOfUsersSupported ()
지원되는 최대 사용자 수를 얻으십시오. 기본값은 0까지.
보고 | |
---|---|
int | 지원되는 사용자의 수를 나타내는 정수 |
던지기 | |
---|---|
DeviceNotAvailableException |
getMicroDroidprocess
public Process getMicrodroidProcess ()
보고 | |
---|---|
Process | Microdroid VM의 프로세스를 반환합니다. TestDevice가 미세 연도체가 아닌 경우 NULL을 반환합니다. |
getmonitor
public IDeviceStateMonitor getMonitor ()
장치와 관련된 IDeviceStateMonitor
반환하십시오.
보고 | |
---|---|
IDeviceStateMonitor |
getmountpoint
public String getMountPoint (String mountName)
마운트 포인트를 반환합니다.
IDevice
의 캐시 된 정보를 사용할 수없는 경우 장치를 직접 쿼리하십시오. TODO :이 동작을 IDevice#getMountPoint(String)
로 옮깁니다.매개변수 | |
---|---|
mountName | String : 마운트 포인트의 이름 |
보고 | |
---|---|
String | 마운트 포인트 또는 null |
getMountPointInfo
public ITestDevice.MountPointInfo getMountPointInfo (String mountpoint)
지정된 MountPoint 경로에 해당하는 MountPointInfo
반환하거나 해당 경로에 장착되지 않았거나 다른 방식으로 MountPoint로 표시되지 않는 경우 null
.
매개변수 | |
---|---|
mountpoint | String |
보고 | |
---|---|
ITestDevice.MountPointInfo | "/proc/mounts"의 정보를 포함하는 MountPointInfo 의 ERROR(/List) |
던지기 | |
---|---|
DeviceNotAvailableException |
getMountPointInfo
publicgetMountPointInfo ()
장치의 /Proc /Mounts에있는 구문 분석 버전의 정보를 반환합니다.
보고 | |
---|---|
"/proc/mounts"의 정보를 포함하는 MountPointInfo 의 ERROR(/List) |
던지기 | |
---|---|
DeviceNotAvailableException |
getOptions
public TestDeviceOptions getOptions ()
장치의 테스트 옵션을 가져 오십시오.
보고 | |
---|---|
TestDeviceOptions | 테스트중인 장치와 관련된 TestDeviceOptions . |
getPartitionFreespace
public long getPartitionFreeSpace (String partition)
장치 파티션에서 여유 공간의 양을 결정하는 도우미 방법.
매개변수 | |
---|---|
partition | String |
보고 | |
---|---|
long | KB의 여유 공간의 양 |
던지기 | |
---|---|
DeviceNotAvailableException |
getPrimaryUserId
public Integer getPrimaryUserId ()
기본 사용자 ID를 반환합니다.
보고 | |
---|---|
Integer | 기본 사용자가있는 경우 기본 사용자의 userID이고 기본 사용자가없는 경우 NULL. |
던지기 | |
---|---|
DeviceNotAvailableException |
getProcessByName
public ProcessInfo getProcessByName (String processName)
헬퍼 메소드는 "pidof"및 "stat"명령을 실행하고 주어진 프로세스의 PID 및 프로세스 시작 시간으로 ProcessInfo
객체를 반환합니다.
매개변수 | |
---|---|
processName | String : Proces Name String. |
보고 | |
---|---|
ProcessInfo | 주어진 프로세스 이름의 ProcessInfo |
던지기 | |
---|---|
DeviceNotAvailableException |
getProcessPid
public String getProcessPid (String process)
무언가 잘못되면 서비스의 PID를 반환하거나 NULL을 반환합니다.
매개변수 | |
---|---|
process | String : Proces Name String. |
보고 | |
---|---|
String |
던지기 | |
---|---|
DeviceNotAvailableException |
GetProductType
public String getProductType ()
이 장치의 제품 유형을 얻는 편의 방법.
장치가 ADB 또는 Fastboot 모드에 있으면이 메소드가 작동합니다.보고 | |
---|---|
String | String 제품 유형 이름. 무효가되지 않습니다 |
던지기 | |
---|---|
DeviceNotAvailableException |
생산성 분량
public String getProductVariant ()
이 장치의 제품 변형을 얻는 편의 방법.
장치가 ADB 또는 Fastboot 모드에 있으면이 메소드가 작동합니다.보고 | |
---|---|
String | String 제품 변형 이름 또는 null 결정할 수없는 경우 |
던지기 | |
---|---|
DeviceNotAvailableException |
GetProperty
public String getProperty (String name)
장치에서 주어진 속성 값을 검색하십시오.
매개변수 | |
---|---|
name | String : 속성 이름 |
보고 | |
---|---|
String | 존재하지 않는 경우 속성 값 또는 null |
던지기 | |
---|---|
DeviceNotAvailableException |
getRecoveryMode
public ITestDevice.RecoveryMode getRecoveryMode ()
장치에 사용 된 현재 복구 모드를 가져옵니다.
보고 | |
---|---|
ITestDevice.RecoveryMode | 장치에 사용 된 현재 복구 모드. |
getScreenshot
public InputStreamSource getScreenshot (String format)
장치에서 스크린 샷을 가져옵니다. 더 작은 크기에 대한 JPEG 인코딩을 사용하여 GetScreenshot (형식)을 사용하는 것이 좋습니다.
매개변수 | |
---|---|
format | String : 지원되는 PNG, JPEG |
보고 | |
---|---|
InputStreamSource | 스크린 샷을 형식으로 InputStreamSource 스크린 샷이 성공하지 못한 경우 null . |
던지기 | |
---|---|
DeviceNotAvailableException |
getScreenshot
public InputStreamSource getScreenshot (long displayId)
표시된 디스플레이 ID에서 스크린 샷을 가져옵니다. 형식은 PNG입니다.
TODO : '형식'및 'Rescale'을 지원하기 위해 위의 구현을 확장합니다.
매개변수 | |
---|---|
displayId | long : 스크린 샷을 얻을 화면의 디스플레이 ID. |
보고 | |
---|---|
InputStreamSource | 스크린 샷을 형식으로 InputStreamSource 스크린 샷이 성공하지 못한 경우 null . |
던지기 | |
---|---|
DeviceNotAvailableException |
getScreenshot
public InputStreamSource getScreenshot (String format, boolean rescale)
장치에서 스크린 샷을 가져옵니다. 더 작은 크기에 대한 JPEG 인코딩과 함께 getScreenshot(String)
사용하는 것이 좋습니다.
매개변수 | |
---|---|
format | String : 지원되는 PNG, JPEG |
rescale | boolean : 결과 이미지의 크기를 줄이기 위해 스크린 샷을 저장 해야하는 경우 |
보고 | |
---|---|
InputStreamSource | 스크린 샷을 형식으로 InputStreamSource 하거나 스크린 샷이 성공하지 못한 경우 null . |
던지기 | |
---|---|
DeviceNotAvailableException |
getScreenshot
public InputStreamSource getScreenshot ()
장치에서 스크린 샷을 가져옵니다.
보고 | |
---|---|
InputStreamSource | 스크린 샷의 PNG 형식의 InputStreamSource 또는 스크린 샷이 성공하지 못한 경우 null . |
던지기 | |
---|---|
DeviceNotAvailableException |
getSetting
public String getSetting (int userId, String namespace, String key)
요청 된 설정의 값을 반환하십시오. 네임 스페이스는 다음 중 하나 여야합니다. { "System", "Secure", "Global"}
매개변수 | |
---|---|
userId | int |
namespace | String |
key | String |
보고 | |
---|---|
String | 네임 스페이스와 관련된 값 : 사용자의 키. 찾을 수없는 경우 NULL. |
던지기 | |
---|---|
DeviceNotAvailableException |
getSetting
public String getSetting (String namespace, String key)
getSetting(int, String, String)
참조하고 시스템 사용자에서 수행합니다.
매개변수 | |
---|---|
namespace | String |
key | String |
보고 | |
---|---|
String |
던지기 | |
---|---|
DeviceNotAvailableException |
getSimoperator
public String getSimOperator ()
사용할 수 없거나 장치를 사용할 수없는 경우 SIM 카드 운영자 또는 NULL을 반환하십시오.
보고 | |
---|---|
String |
GetSimstate
public String getSimState ()
사용할 수 없거나 장치를 사용할 수없는 경우 SIM 카드 상태 또는 NULL을 반환하십시오.
보고 | |
---|---|
String |
GetTombstones
publicgetTombstones ()
장치에서 묘비 목록을 가져 와서 반환하십시오. 루트가 필요합니다.
메소드는 최상의 효과이므로 하나의 묘비가 풀리지 않으면 어떤 이유로 든 목록에서 누락됩니다. DeviceNotAvailableException
만이 방법을 조기에 종료합니다.
보고 | |
---|---|
묘비가없는 경우 비어있는 묘비 파일 목록. |
던지기 | |
---|---|
DeviceNotAvailableException |
GetTotalMemory
public long getTotalMemory ()
내부 오류의 경우 총 물리적 메모리 크기를 바이트 또는 -1로 반환합니다.
보고 | |
---|---|
long |
getUninstallablePackageNames
publicgetUninstallablePackageNames ()
제거 할 수있는 응용 프로그램 패키지 이름을 가져 오십시오. 이는 현재 비 시스템 패키지 및 업데이트 된 시스템 패키지로 정의됩니다.
보고 | |
---|---|
현재 장치에 설치된 설치 가능한 String 패키지 이름의 ERROR(/Set) . |
던지기 | |
---|---|
DeviceNotAvailableException |
getusefastbooterase
public boolean getUseFastbootErase ()
FastBoot 지우기 또는 Fastboot 형식을 사용하여 장치의 파티션을 닦아 낼지 여부를 가져옵니다.
보고 | |
---|---|
boolean | FastBoot 지우기가 사용되거나 Fastboot 형식 false 사용되는 경우 true . |
getUserFlags
public int getUserFlags (int userId)
주어진 사용자의 플래그를 찾고 반환하십시오. 플래그는 Android 오픈 소스 프로젝트의 "Android.content.pm.userinfo"클래스에 정의되어 있습니다.
매개변수 | |
---|---|
userId | int |
보고 | |
---|---|
int | 다른 경우에 -10000을 찾은 경우 userID와 관련된 플래그. |
던지기 | |
---|---|
DeviceNotAvailableException |
getUserInfos
publicgetUserInfos ()
장치에서 UserInfo
로 useid의 맵을 가져옵니다. 장치의 출력이 예상대로 예상되지 않으면 DeviceRuntimeException
던집니다.
보고 | |
---|---|
userinfo 객체의 목록. |
던지기 | |
---|---|
DeviceNotAvailableException |
getUser일련번호
public int getUserSerialNumber (int userId)
다른 경우에 -10000을 찾은 경우 userID와 관련된 일련 번호를 반환하십시오.
매개변수 | |
---|---|
userId | int |
보고 | |
---|---|
int |
던지기 | |
---|---|
DeviceNotAvailableException |
핸드 라이브로 위치
public IManagedTestDevice.DeviceEventResponse handleAllocationEvent (DeviceEvent event)
주어진 DeviceEvent를 처리하십시오. 장치를 새로운 상태로 전환 할 수 있습니다. 모든 국가 전환에 대해 IDeviceMonitor
에게 알릴 것입니다.
이 장치를 새로운 할당 상태로 전환하거나 전환 할 수있는 DeviceEvent를 처리하십시오.
매개변수 | |
---|---|
event | DeviceEvent |
보고 | |
---|---|
IManagedTestDevice.DeviceEventResponse |
기능 있음
public boolean hasFeature (String feature)
장치에서 기능을 사용할 수 있는지 확인하십시오.
매개변수 | |
---|---|
feature | String : 어떤 형식이 "기능 : |
보고 | |
---|---|
boolean | 기능이 발견되면 true, 그렇지 않으면 false. |
던지기 | |
---|---|
DeviceNotAvailableException |
설치패키지
public String installPackage (File packageFile, boolean reinstall, String... extraArgs)
장치에 Android 패키지를 설치하십시오.
매개변수 | |
---|---|
packageFile | File : 설치할 APK 파일 |
reinstall | boolean : 다시 설치 해야하는 true |
extraArgs | String : 선택적 추가 인수를 전달합니다. 사용 가능한 옵션은 'ADB Shell PM -H'를 참조하십시오. |
보고 | |
---|---|
String | 오류 코드가있는 String 또는 성공하면 null . |
던지기 | |
---|---|
DeviceNotAvailableException |
설치패키지
public String installPackage (File packageFile, boolean reinstall, boolean grantPermissions, String... extraArgs)
장치에 Android 패키지를 설치하십시오.
참고 : 설치 시간에 런타임 권한 부여를 명시 적으로 제어 해야하는 사용 사례만이 기능을 호출해야합니다.
매개변수 | |
---|---|
packageFile | File : 설치할 APK 파일 |
reinstall | boolean : 다시 설치 해야하는 true |
grantPermissions | boolean : 모든 런타임 권한을 설치 시간에 부여 해야하는 경우 |
extraArgs | String : 선택적 추가 인수를 전달합니다. 사용 가능한 옵션은 'ADB Shell PM -H'를 참조하십시오. |
보고 | |
---|---|
String | 오류 코드가있는 String 또는 성공하면 null . |
던지기 | |
---|---|
DeviceNotAvailableException |
installPackageForUser
public String installPackageForUser (File packageFile, boolean reinstall, int userId, String... extraArgs)
주어진 사용자를 위해 장치에 Android 패키지를 설치하십시오.
매개변수 | |
---|---|
packageFile | File : 설치할 APK 파일 |
reinstall | boolean : 다시 설치 해야하는 true |
userId | int : 설치할 정수 사용자 ID. |
extraArgs | String : 선택적 추가 인수를 전달합니다. 사용 가능한 옵션은 'ADB Shell PM -H'를 참조하십시오. |
보고 | |
---|---|
String | 오류 코드가있는 String 또는 성공하면 null . |
던지기 | |
---|---|
DeviceNotAvailableException |
installPackageForUser
public String installPackageForUser (File packageFile, boolean reinstall, boolean grantPermissions, int userId, String... extraArgs)
주어진 사용자를 위해 장치에 Android 패키지를 설치하십시오.
참고 : 설치 시간에 런타임 권한 부여를 명시 적으로 제어 해야하는 사용 사례만이 기능을 호출해야합니다.
매개변수 | |
---|---|
packageFile | File : 설치할 APK 파일 |
reinstall | boolean : 다시 설치 해야하는 true |
grantPermissions | boolean : 모든 런타임 권한을 설치 시간에 부여 해야하는 경우 |
userId | int : 설치할 정수 사용자 ID. |
extraArgs | String : 선택적 추가 인수를 전달합니다. 사용 가능한 옵션은 'ADB Shell PM -H'를 참조하십시오. |
보고 | |
---|---|
String | 오류 코드가있는 String 또는 성공하면 null . |
던지기 | |
---|---|
DeviceNotAvailableException |
유효하지 않은 프로페퍼 티카
public void invalidatePropertyCache ()
ISADBTCP
public boolean isAdbTcp ()
보고 | |
---|---|
boolean |
isAppEnumeration지원됨
public boolean isAppEnumerationSupported ()
장치의 플랫폼이 앱 열거를 지원하는지 확인하십시오
보고 | |
---|---|
boolean | 앱 열거가 지원되는 경우 true 그렇지 않으면 false |
던지기 | |
---|---|
DeviceNotAvailableException |
isbypasslowtargetsdkblocksupported
public boolean isBypassLowTargetSdkBlockSupported ()
장치의 플랫폼이 앱 설치의 낮은 대상 SDK 블록 우회를 지원하는지 확인하십시오.
보고 | |
---|---|
boolean | 바이 패스 낮은 대상 SDK 블록이 지원되는 경우 true 그렇지 않으면 false |
던지기 | |
---|---|
DeviceNotAvailableException |
isdeviceencrypted
public boolean isDeviceEncrypted ()
장치가 암호화 된 경우 반환합니다.
보고 | |
---|---|
boolean | 장치가 true 된 경우. |
던지기 | |
---|---|
DeviceNotAvailableException |
isdirectory
public boolean isDirectory (String path)
장치의 경로가 디렉토리 인 경우 true를 반환하십시오. 그렇지 않으면 false.
매개변수 | |
---|---|
path | String |
보고 | |
---|---|
boolean |
던지기 | |
---|---|
DeviceNotAvailableException |
Isenableadbroot
public boolean isEnableAdbRoot ()
보고 | |
---|---|
boolean | ADB 루트를 장치에서 true 해야하는 경우 |
Isencryptionsupported
public boolean isEncryptionSupported ()
장치에서 암호화가 지원되는 경우 반환합니다.
보고 | |
---|---|
boolean | 장치가 true 를 지원하는 경우. |
던지기 | |
---|---|
DeviceNotAvailableException |
실행 가능합니다
public boolean isExecutable (String fullPath)
장치의 파일 경로가 실행 파일 인 경우 true를 반환합니다. 그렇지 않으면 false.
매개변수 | |
---|---|
fullPath | String |
보고 | |
---|---|
boolean |
던지기 | |
---|---|
DeviceNotAvailableException |
Isfastbootenabled
public boolean isFastbootEnabled ()
장치에 FastBoot을 사용할 수있는 경우 반환하십시오.
보고 | |
---|---|
boolean |
isheadless
public boolean isHeadless ()
장치가 헤드리스 인 경우 (화면 없음), 그렇지 않으면 False를 반환하십시오.
보고 | |
---|---|
boolean |
던지기 | |
---|---|
DeviceNotAvailableException |
isheadlesssystemusermode
public boolean isHeadlessSystemUserMode ()
장치가 헤드리스 시스템 사용자 모드를 사용하는지 여부를 반환합니다.
보고 | |
---|---|
boolean |
던지기 | |
---|---|
DeviceNotAvailableException |
ISMAINUSERPERMANENTADMIN
public boolean isMainUserPermanentAdmin ()
기본 사용자가 영구 관리자인지 여부를 반환합니다.
보고 | |
---|---|
boolean |
던지기 | |
---|---|
DeviceNotAvailableException |
다중 사용자 지원됨
public boolean isMultiUserSupported ()
다중 사용자가 지원되는지 결정합니다.
보고 | |
---|---|
boolean | 다중 사용자가 지원되는 경우 true 그렇지 않으면 false |
던지기 | |
---|---|
DeviceNotAvailableException |
isPackageInstalled입니다.
public boolean isPackageInstalled (String packageName, String userId)
주어진 패키지 이름과 주어진 사용자 ID에 대해 장치를 쿼리하여 해당 사용자에 대해 현재 설치되어 있는지 확인하십시오.
매개변수 | |
---|---|
packageName | String : 설치되어 있는지 확인하는 패키지. |
userId | String : 패키지를 확인하는 사용자 ID가 설치되어 있습니다. NULL이면 1 차 사용자 제로가 사용됩니다. |
보고 | |
---|---|
boolean | 패키지가 설치된 것으로보고 된 경우. 그렇지 않으면 거짓. |
던지기 | |
---|---|
DeviceNotAvailableException |
isPackageInstalled입니다.
public boolean isPackageInstalled (String packageName)
주어진 패키지 이름에 대해 장치를 쿼리하여 현재 설치되어 있는지 확인하십시오.
매개변수 | |
---|---|
packageName | String |
보고 | |
---|---|
boolean | 패키지가 설치된 것으로보고 된 경우. 그렇지 않으면 거짓. |
던지기 | |
---|---|
DeviceNotAvailableException |
isruntimepermissionsupported
public boolean isRuntimePermissionSupported ()
장치의 플랫폼이 런타임 권한 부여를 지원하는지 확인하십시오
보고 | |
---|---|
boolean | 런타임 권한이 지원되는 경우 true, 그렇지 않으면 false. |
던지기 | |
---|---|
DeviceNotAvailableException |
isstatebootloaderorfastbootd
public boolean isStateBootloaderOrFastbootd ()
장치가 TestDeviceState#FASTBOOT
또는 TestDeviceState.FASTBOOTD
에 있으면 TRUE를 반환합니다.
보고 | |
---|---|
boolean |
isUserRunning
public boolean isUserRunning (int userId)
주어진 사용자가 실행 중인지 확인하십시오.
매개변수 | |
---|---|
userId | int |
보고 | |
---|---|
boolean | 사실 사용자가 실행중인 경우 다른 모든 경우에 거짓. |
던지기 | |
---|---|
DeviceNotAvailableException |
isUserSecondary
public boolean isUserSecondary (int userId)
지정된 사용자가 플래그에 따라 보조 사용자인지 여부를 반환하십시오.
매개변수 | |
---|---|
userId | int |
보고 | |
---|---|
boolean | 사용자가 2 차이면, 그렇지 않으면 false. |
던지기 | |
---|---|
DeviceNotAvailableException |
issuservisible
public boolean isUserVisible (int userId)
주어진 사용자가 표시되는지 확인합니다.
"보이는"사용자는 "인간"사용자와 상호 작용하는 사용자이므로 출시 활동 (일반적으로 기본 디스플레이)을 시작할 수 있습니다.
매개변수 | |
---|---|
userId | int |
보고 | |
---|---|
boolean |
던지기 | |
---|---|
DeviceNotAvailableException |
isuservisibleondisplay
public boolean isUserVisibleOnDisplay (int userId, int displayId)
주어진 디스플레이에서 주어진 사용자가 표시되는지 확인합니다.
"보이는"사용자는 "인간"사용자와 상호 작용하는 사용자이므로 해당 디스플레이에서 시작 활동을 시작할 수 있습니다.
매개변수 | |
---|---|
userId | int |
displayId | int |
보고 | |
---|---|
boolean |
던지기 | |
---|---|
DeviceNotAvailableException |
isvisible backgroundusersondefaultdisplayspported
public boolean isVisibleBackgroundUsersOnDefaultDisplaySupported ()
장치가 ERROR(/java.android.view.Display#DEFAULT_DISPLAY)
의 백그라운드에서 사용자가 표시를 시작할 수 있는지 여부를 반환합니다.
그렇다면 startVisibleBackgroundUser(int, int, boolean)
호출하고 listDisplayIdsForStartingVisibleBackgroundUsers()
가 반환 한 디스플레이를 전달할 수 있습니다 ( ERROR(/java.android.view.Display#DEFAULT_DISPLAY)
).
보고 | |
---|---|
boolean |
던지기 | |
---|---|
DeviceNotAvailableException |
isvisible backgroundusersssupported
public boolean isVisibleBackgroundUsersSupported ()
장치가 백그라운드에서 보이도록 시작할 수 있는지 여부를 반환합니다.
그렇다면 startVisibleBackgroundUser(int, int, boolean)
호출하고 listDisplayIdsForStartingVisibleBackgroundUsers()
에서 반환 한 디스플레이를 전달할 수 있습니다.
보고 | |
---|---|
boolean |
던지기 | |
---|---|
DeviceNotAvailableException |
iswifienabled
public boolean isWifiEnabled ()
Wi -Fi가 활성화되어 있는지 테스트하십시오.
장치에서 Wi -Fi가 활성화되어 있는지 확인합니다. Wi -Fi에서 실행되지 않아야하는 테스트, 예를 들어 모바일 데이터 테스트를 수행하기 전에 WiFi 상태를 주장하는 데 유용합니다.보고 | |
---|---|
boolean | Wi -Fi가 활성화 된 경우 true . 비활성화 된 경우 false |
던지기 | |
---|---|
DeviceNotAvailableException |
목록디스플레이 ID
publiclistDisplayIds ()
"DumpSys SurfaceFlinger"에서보고 한대로 장치에서 사용 가능한 디스플레이 ID 목록을 수집하십시오.
보고 | |
---|---|
디스플레이 목록. 기본값은 항상 기본 표시 0을 반환합니다. |
던지기 | |
---|---|
DeviceNotAvailableException |
ListDisplayIdsForStartIngibleBackgroundUsers
publiclistDisplayIdsForStartingVisibleBackgroundUsers ()
start a user visible in the background
데 사용할 수있는 디스플레이 목록을 가져옵니다.
보고 | |
---|---|
던지기 | |
---|---|
DeviceNotAvailableException |
목록사용자
publiclistUsers ()
장치에서 사용자 목록을 가져옵니다. 장치의 출력이 예상대로 예상되지 않으면 DeviceRuntimeException
던집니다.
보고 | |
---|---|
사용자 ID 목록. |
던지기 | |
---|---|
DeviceNotAvailableException |
로건
public boolean logAnrs (ITestLogger logger)
장치에서 ANR을 수집하고 로그합니다.
매개변수 | |
---|---|
logger | ITestLogger : anrs를 기록하는 ITestLogger . |
보고 | |
---|---|
boolean | 로깅이 성공적이면 사실, 그렇지 않으면 거짓. |
던지기 | |
---|---|
DeviceNotAvailableException |
logbugreport
public boolean logBugreport (String dataName, ITestLogger listener)
도우미 방법으로 버그 보고서를 가져 와서 기자에게 로그인하십시오.
매개변수 | |
---|---|
dataName | String : 버그보고가보고 될 이름. |
listener | ITestLogger : Bugreport를 기록하는 ITestLogger . |
보고 | |
---|---|
boolean | 로깅이 성공적이면 사실, 그렇지 않으면 거짓. |
logondevice
public void logOnDevice (String tag, Log.LogLevel level, String format, Object... args)
장치의 logcat에 메시지를 기록하십시오. 이것은 로깅이 실패하더라도 던지지 않는 안전한 전화입니다.
매개변수 | |
---|---|
tag | String : 로그 캣에 메시지를 기록하는 태그. |
level | Log.LogLevel : logcat에서 메시지의 디버그 레벨. |
format | String : 메시지 형식. |
args | Object : 문자열을 통해 대체 할 args. |
비 블로킹 드레 보트
public void nonBlockingReboot ()
장치를 재부팅하라는 명령을 발행하고 명령을 완료하고 더 이상 ADB에 장치가 표시되지 않는 경우.
던지기 | |
---|---|
DeviceNotAvailableException |
사후의 곤경
public void postAdbRootAction ()
장치가 ADB 루트 후 및 장치가 온라인으로 돌아 오기 전에 특정 작업을 수행 해야하는 경우 재정의하십시오. 기본 구현에는 추가 작업이 포함되어 있지 않습니다. 이 단계에서 ADB 루트는 활성화되지 않습니다.
던지기 | |
---|---|
| com.android.tradefed.device.devicenotavailableException |
DeviceNotAvailableException |
PostAdBunrootAction
public void postAdbUnrootAction ()
장치가 ADB Unroot 후 및 장치가 온라인으로 돌아 오기 전에 몇 가지 특정 작업을 수행 해야하는지 재정의하십시오. 기본 구현에는 추가 작업이 포함되어 있지 않습니다. 이 단계에서 ADB 루트는 비활성화되지 않습니다.
던지기 | |
---|---|
| com.android.tradefed.device.devicenotavailableException |
DeviceNotAvailableException |
PostbootSetup
public void postBootSetup ()
모든 부팅 후 해당 테스트 장치를 구성하기 위해 지침을 수행하십시오.
장치가 완전히 부팅/사용 가능한 후에 호출해야합니다. 정상적인 상황에서는이 방법을 명시 적으로 호출 할 필요가 없습니다. 구현은 재부팅을 수행 할 때 이러한 단계를 자동으로 수행해야 하므로이 단계는 이러한 단계를 자동으로 수행해야합니다. 호출해야 할 곳은 다른 이벤트로 인해 장치를 재부팅 할 때입니다 (예 : Fastboot 업데이트 명령이 완료된 경우)던지기 | |
---|---|
DeviceNotAvailableException |
postInvocationTearDown
public void postInvocationTearDown (Throwable exception)
장치별로 필요한 추가 단계는 호출이 완료된 후 실행될 수있는 필수 정리.
매개변수 | |
---|---|
exception | Throwable 있는 경우 : 호출 실패로 제기 된 최종 예외. |
preinvocationSetup
public void preInvocationSetup (IBuildInfo info, MultiMap<String, String> attributes)
호출 흐름 전에 장치에서 실행될 장치별로 필요한 설정에 대한 추가 단계.
매개변수 | |
---|---|
info | IBuildInfo : 장치의 IBuildInfo . |
attributes | MultiMap : 호출 컨텍스트에 저장된 속성 |
던지기 | |
---|---|
DeviceNotAvailableException | |
TargetSetupError |
풀 디르
public boolean pullDir (String deviceFilePath, File localDir)
장치에서 디렉토리 내용을 재귀 적으로 가져옵니다.
매개변수 | |
---|---|
deviceFilePath | String : 원격 소스의 절대 파일 경로 |
localDir | File : 파일을 끌어 올리는 로컬 디렉토리 |
보고 | |
---|---|
boolean | 파일이 성공적으로 당겨지면 true . 그렇지 않으면 false . |
던지기 | |
---|---|
DeviceNotAvailableException |
풀 파일
public boolean pullFile (String remoteFilePath, File localFile)
파일 끄기 장치를 검색합니다.
매개변수 | |
---|---|
remoteFilePath | String : 장치에서 파일의 절대 경로. |
localFile | File : 내용을 저장할 로컬 파일. 비어 있으면 내용이 교체됩니다. |
보고 | |
---|---|
boolean | 파일이 성공적으로 검색된 경우 true . 그렇지 않으면 false . |
던지기 | |
---|---|
DeviceNotAvailableException |
풀 파일
public File pullFile (String remoteFilePath, int userId)
파일 끄기 장치를 검색하고 로컬 임시 ERROR(/File)
에 저장하고 해당 File
반환합니다.
매개변수 | |
---|---|
remoteFilePath | String : 장치에서 파일의 절대 경로. |
userId | int : 사용자 ID에서 가져올 |
보고 | |
---|---|
File | 장치 파일의 내용을 포함하는 ERROR(/File) 또는 사본에 null 경우 (호스트 파일 시스템의 문제 포함) |
던지기 | |
---|---|
DeviceNotAvailableException |
풀 파일
public File pullFile (String remoteFilePath)
파일 끄기 장치를 검색하고 로컬 임시 ERROR(/File)
에 저장하고 해당 File
반환합니다.
매개변수 | |
---|---|
remoteFilePath | String : 장치에서 파일의 절대 경로. |
보고 | |
---|---|
File | 장치 파일의 내용을 포함하는 ERROR(/File) 또는 사본에 null 경우 (호스트 파일 시스템의 문제 포함) |
던지기 | |
---|---|
DeviceNotAvailableException |
풀 파일
public boolean pullFile (String remoteFilePath, File localFile, int userId)
파일 끄기 장치를 검색합니다.
매개변수 | |
---|---|
remoteFilePath | String : 장치에서 파일의 절대 경로. |
localFile | File : 내용을 저장할 로컬 파일. 비어 있으면 내용이 교체됩니다. |
userId | int : 사용자 ID에서 가져올 |
보고 | |
---|---|
boolean | 파일이 성공적으로 검색된 경우 true . 그렇지 않으면 false . |
던지기 | |
---|---|
DeviceNotAvailableException |
PullFileConcents
public String pullFileContents (String remoteFilePath)
파일 끄기 장치를 검색하고 내용을 반환합니다.
매개변수 | |
---|---|
remoteFilePath | String : 장치에서 파일의 절대 경로. |
보고 | |
---|---|
String | 장치 파일의 내용을 포함하는 String 또는 사본에 null 경우 (호스트 파일 시스템의 문제 포함) |
던지기 | |
---|---|
DeviceNotAvailableException |
풀 파일 외과
public File pullFileFromExternal (String remoteFilePath)
장치의 외부 스토리지에서 파일을 검색하는 편의 방법으로 로컬 임시 ERROR(/File)
에 저장하고 해당 File
에 대한 참조를 반환합니다.
매개변수 | |
---|---|
remoteFilePath | String : 장치의 외부 스토리지 Mountpoint와 관련하여 장치의 파일로가는 경로 |
보고 | |
---|---|
File | A ERROR(/File) containing the contents of the device file, or null if the copy failed for any reason (including problems with the host filesystem) |
던지기 | |
---|---|
DeviceNotAvailableException |
pushDir
public boolean pushDir (File localFileDir, String deviceFilePath,excludedDirectories)
Recursively push directory contents to device while excluding some directories that are filtered.
매개변수 | |
---|---|
localFileDir | File : the local directory to push |
deviceFilePath | String : the absolute file path of the remote destination |
excludedDirectories |
보고 | |
---|---|
boolean | true if file was pushed successfully. 그렇지 않으면 false . |
던지기 | |
---|---|
DeviceNotAvailableException |
pushDir
public boolean pushDir (File localFileDir, String deviceFilePath)
Recursively push directory contents to device.
매개변수 | |
---|---|
localFileDir | File : the local directory to push |
deviceFilePath | String : the absolute file path of the remote destination |
보고 | |
---|---|
boolean | true if file was pushed successfully. 그렇지 않으면 false . |
던지기 | |
---|---|
DeviceNotAvailableException |
pushFile
public boolean pushFile (File localFile, String remoteFilePath, boolean evaluateContentProviderNeeded)
Variant of pushFile(File, String)
which can optionally consider evaluating the need for the content provider.
매개변수 | |
---|---|
localFile | File : the local file to push |
remoteFilePath | String : the remote destination absolute file path |
evaluateContentProviderNeeded | boolean : whether to check if we need the content provider |
보고 | |
---|---|
boolean | true if file was pushed successfully. 그렇지 않으면 false . |
던지기 | |
---|---|
DeviceNotAvailableException |
pushFile
public boolean pushFile (File localFile, String remoteFilePath)
Push a file to device. By default using a content provider.
매개변수 | |
---|---|
localFile | File : the local file to push |
remoteFilePath | String : the remote destination absolute file path |
보고 | |
---|---|
boolean | true if file was pushed successfully. 그렇지 않으면 false . |
던지기 | |
---|---|
DeviceNotAvailableException |
pushString
public boolean pushString (String contents, String remoteFilePath)
Push file created from a string to device
매개변수 | |
---|---|
contents | String : the contents of the file to push |
remoteFilePath | String : the remote destination absolute file path |
보고 | |
---|---|
boolean | true if string was pushed successfully. 그렇지 않으면 false . |
던지기 | |
---|---|
DeviceNotAvailableException |
reboot
public void reboot (String reason)
Reboots the device into adb mode with given reason
to be persisted across reboot.
Blocks until device becomes available.
Last reboot reason can be obtained by querying sys.boot.reason
propety.
매개변수 | |
---|---|
reason | String : a reason for this reboot, or null if no reason is specified. |
던지기 | |
---|---|
DeviceNotAvailableException |
reboot
public void reboot ()
Reboots the device into adb mode.
Blocks until device becomes available.던지기 | |
---|---|
DeviceNotAvailableException |
rebootIntoBootloader
public void rebootIntoBootloader ()
Reboots the device into bootloader mode.
Blocks until device is in bootloader mode.던지기 | |
---|---|
DeviceNotAvailableException |
rebootIntoFastbootd
public void rebootIntoFastbootd ()
Reboots the device into fastbootd mode.
Blocks until device is in fastbootd mode.
던지기 | |
---|---|
DeviceNotAvailableException |
rebootIntoRecovery
public void rebootIntoRecovery ()
Reboots the device into adb recovery mode.
Blocks until device enters recovery던지기 | |
---|---|
DeviceNotAvailableException |
rebootIntoSideload
public void rebootIntoSideload ()
Reboots the device into adb sideload mode (note that this is a special mode under recovery)
Blocks until device enters sideload mode
던지기 | |
---|---|
DeviceNotAvailableException |
rebootIntoSideload
public void rebootIntoSideload (boolean autoReboot)
Reboots the device into adb sideload mode (note that this is a special mode under recovery)
Blocks until device enters sideload mode
매개변수 | |
---|---|
autoReboot | boolean : whether to automatically reboot the device after sideload |
던지기 | |
---|---|
DeviceNotAvailableException |
rebootUntilOnline
public void rebootUntilOnline ()
An alternate to reboot()
that only blocks until device is online ie visible to adb.
던지기 | |
---|---|
DeviceNotAvailableException |
rebootUntilOnline
public void rebootUntilOnline (String reason)
An alternate to reboot()
that only blocks until device is online ie visible to adb.
매개변수 | |
---|---|
reason | String : a reason for this reboot, or null if no reason is specified. |
던지기 | |
---|---|
DeviceNotAvailableException |
rebootUserspace
public void rebootUserspace ()
Reboots only userspace part of device.
Blocks until device becomes available.
경고. Userspace reboot is currently under active development, use it on your own risk.
던지기 | |
---|---|
DeviceNotAvailableException |
rebootUserspaceUntilOnline
public void rebootUserspaceUntilOnline ()
An alternate to rebootUserspace()
()} that only blocks until device is online ie visible to adb.
던지기 | |
---|---|
DeviceNotAvailableException |
recoverDevice
public boolean recoverDevice ()
Attempts to recover device communication.
보고 | |
---|---|
boolean | True if recovery attempted and successful, returns False if recovery was skipped |
던지기 | |
---|---|
DeviceNotAvailableException | if device is no longer available |
registerDeviceActionReceiver
public void registerDeviceActionReceiver (IDeviceActionReceiver deviceActionReceiver)
Registers a IDeviceActionReceiver
for this device.
All registered IDeviceActionReceiver
s will be notified before a device action starts and after the device action ends.
매개변수 | |
---|---|
deviceActionReceiver | IDeviceActionReceiver : A IDeviceActionReceiver which will be registered. |
remountSystemReadOnly
public void remountSystemReadOnly ()
Make the system partition on the device read-only. May reboot the device.
던지기 | |
---|---|
DeviceNotAvailableException |
remountSystemWritable
public void remountSystemWritable ()
Make the system partition on the device writable. May reboot the device.
던지기 | |
---|---|
DeviceNotAvailableException |
remountVendorReadOnly
public void remountVendorReadOnly ()
Make the vendor partition on the device read-only. May reboot the device.
던지기 | |
---|---|
DeviceNotAvailableException |
remountVendorWritable
public void remountVendorWritable ()
Make the vendor partition on the device writable. May reboot the device.
던지기 | |
---|---|
DeviceNotAvailableException |
제거관리자
public boolean removeAdmin (String componentName, int userId)
Remove given device admin in given user and return true
if it is successful, false
otherwise.
매개변수 | |
---|---|
componentName | String : of device admin to be removed. |
userId | int : of user that the device admin lives in. |
보고 | |
---|---|
boolean | True if it is successful, false otherwise. |
던지기 | |
---|---|
DeviceNotAvailableException |
소유자 제거
public void removeOwners ()
Remove all existing device profile owners with the best effort.
던지기 | |
---|---|
DeviceNotAvailableException |
사용자 제거
public boolean removeUser (int userId)
Remove a given user from the device.
매개변수 | |
---|---|
userId | int : of the user to remove |
보고 | |
---|---|
boolean | true if we were successful in removing the user, false otherwise. |
던지기 | |
---|---|
DeviceNotAvailableException |
resetContentProviderSetup
public void resetContentProviderSetup ()
Reset the flag for content provider setup in order to trigger it again.
runInstrumentationTests
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner, ITestLifeCycleReceiver... listeners)
Convenience method for performing ERROR(/#runInstrumentationTests(com.android.ddmlib.testrunner.IRemoteAndroidTestRunner,Collection))
with one or more listeners passed as parameters.
매개변수 | |
---|---|
runner | IRemoteAndroidTestRunner : the IRemoteAndroidTestRunner which runs the tests |
listeners | ITestLifeCycleReceiver : the test result listener(s) |
보고 | |
---|---|
boolean | true if test command completed. false if it failed to complete, but recovery succeeded |
던지기 | |
---|---|
DeviceNotAvailableException |
runInstrumentationTests
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner,listeners)
Runs instrumentation tests, and provides device recovery.
If connection with device is lost before test run completes, and recovery succeeds, all listeners will be informed of testRunFailed and "false" will be returned. The test command will not be rerun. It is left to callers to retry if necessary.
If connection with device is lost before test run completes, and recovery fails, all listeners will be informed of testRunFailed and DeviceNotAvailableException will be thrown.
매개변수 | |
---|---|
runner | IRemoteAndroidTestRunner : the IRemoteAndroidTestRunner which runs the tests |
listeners |
보고 | |
---|---|
boolean | true if test command completed. false if it failed to complete due to device communication exception, but recovery succeeded |
던지기 | |
---|---|
DeviceNotAvailableException |
runInstrumentationTestsAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId,listeners)
Same as ERROR(ITestDevice#runInstrumentationTests(IRemoteAndroidTestRunner, Collection)/com.android.tradefed.device.ITestDevice#runInstrumentationTests(com.android.ddmlib.testrunner.IRemoteAndroidTestRunner,Collection) ITestDevice#runInstrumentationTests(IRemoteAndroidTestRunner, Collection))
but runs the test for the given user.
매개변수 | |
---|---|
runner | IRemoteAndroidTestRunner |
userId | int |
listeners |
보고 | |
---|---|
boolean |
던지기 | |
---|---|
DeviceNotAvailableException |
runInstrumentationTestsAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, ITestLifeCycleReceiver... listeners)
Same as ITestDevice#runInstrumentationTests(IRemoteAndroidTestRunner, ITestLifeCycleReceiver...)
but runs the test for a given user.
매개변수 | |
---|---|
runner | IRemoteAndroidTestRunner |
userId | int |
listeners | ITestLifeCycleReceiver |
보고 | |
---|---|
boolean |
던지기 | |
---|---|
DeviceNotAvailableException |
setConfiguration
public void setConfiguration (IConfiguration configuration)
사용 중인 IConfiguration
삽입합니다.
매개변수 | |
---|---|
configuration | IConfiguration |
setConnectionAvdInfo
public final void setConnectionAvdInfo (GceAvdInfo avdInfo)
매개변수 | |
---|---|
avdInfo | GceAvdInfo |
setDate
public void setDate (Date date)
Sets the date on device
Note: setting date on device requires root
매개변수 | |
---|---|
date | Date : specify a particular date; will use host date if null |
던지기 | |
---|---|
DeviceNotAvailableException |
setDeviceOwner
public boolean setDeviceOwner (String componentName, int userId)
Set a device admin component as device owner in given user.
매개변수 | |
---|---|
componentName | String : of device admin to be device owner. |
userId | int : of the user that the device owner lives in. |
보고 | |
---|---|
boolean | True if it is successful, false otherwise. |
던지기 | |
---|---|
DeviceNotAvailableException |
setDeviceState
public void setDeviceState (TestDeviceState deviceState)
Update the device's state.
매개변수 | |
---|---|
deviceState | TestDeviceState : the TestDeviceState |
setEmulatorOutputStream
public void setEmulatorOutputStream (SizeLimitedOutputStream output)
For emulator set SizeLimitedOutputStream
to log output
매개변수 | |
---|---|
output | SizeLimitedOutputStream : to log the output |
setEmulatorProcess
public void setEmulatorProcess (Process p)
Sets the Process
, when this device is an emulator.
매개변수 | |
---|---|
p | Process |
setFastbootEnabled
public void setFastbootEnabled (boolean fastbootEnabled)
Set the fastboot option for the device. Should be set when device is first allocated.
매개변수 | |
---|---|
fastbootEnabled | boolean : whether fastboot is available for the device or not |
setFastbootPath
public void setFastbootPath (String fastbootPath)
Sets the path to the fastboot binary that should be used. Still requires isFastbootEnabled()
to be true, to have fastboot functions enabled.
매개변수 | |
---|---|
fastbootPath | String |
setIDevice
public void setIDevice (IDevice newDevice)
Update the IDevice associated with this ITestDevice.
The new IDevice must refer the same physical device as the current reference. This method will be called if DDMS has allocated a new IDevice매개변수 | |
---|---|
newDevice | IDevice : the IDevice |
setLogStartDelay
public void setLogStartDelay (int delay)
Sets the time in ms to wait before starting logcat capture for a online device.
매개변수 | |
---|---|
delay | int : the delay in ms |
setOptions
public void setOptions (TestDeviceOptions options)
Set the TestDeviceOptions
for the device
매개변수 | |
---|---|
options | TestDeviceOptions |
setProperty
public boolean setProperty (String propKey, String propValue)
Sets the given property value on the device. Requires adb root is true.
매개변수 | |
---|---|
propKey | String : The key targeted to be set. |
propValue | String : The property value to be set. |
보고 | |
---|---|
boolean | returns True if the setprop command was successful, False otherwise. |
던지기 | |
---|---|
DeviceNotAvailableException |
setRecovery
public void setRecovery (IDeviceRecovery recovery)
Set the IDeviceRecovery
to use for this device. Should be set when device is first allocated.
매개변수 | |
---|---|
recovery | IDeviceRecovery : the IDeviceRecovery |
setRecoveryMode
public void setRecoveryMode (ITestDevice.RecoveryMode mode)
Set the current recovery mode to use for the device.
Used to control what recovery method to use when a device communication problem is encountered. Its recommended to only use this method sparingly when needed (for example, when framework is down, etc매개변수 | |
---|---|
mode | ITestDevice.RecoveryMode : whether 'recover till online only' mode should be on or not. |
설정설정
public void setSetting (String namespace, String key, String value)
See setSetting(int, String, String, String)
and performed on system user.
매개변수 | |
---|---|
namespace | String |
key | String |
value | String |
던지기 | |
---|---|
DeviceNotAvailableException |
설정설정
public void setSetting (int userId, String namespace, String key, String value)
Add a setting value to the namespace of a given user. Some settings will only be available after a reboot. namespace must be one of: {"system", "secure", "global"}
매개변수 | |
---|---|
userId | int |
namespace | String |
key | String |
value | String |
던지기 | |
---|---|
DeviceNotAvailableException |
setTestLogger
public void setTestLogger (ITestLogger testLogger)
Injects the ITestLogger
instance
매개변수 | |
---|---|
testLogger | ITestLogger |
setUseFastbootErase
public void setUseFastbootErase (boolean useFastbootErase)
Set whether to use fastboot erase or fastboot format to wipe a partition on the device.
매개변수 | |
---|---|
useFastbootErase | boolean : true if fastboot erase should be used or false if fastboot format should be used. |
startLogcat
public void startLogcat ()
Start capturing logcat output from device in the background.
Will have no effect if logcat output is already being captured. Data can be later retrieved via getLogcat. When the device is no longer in use,stopLogcat()
must be called. startLogcat()
and stopLogcat()
do not normally need to be called when within a TF invocation context, as the TF framework will start and stop logcat. 시작사용자
public boolean startUser (int userId)
Starts a given user in the background if it is currently stopped. If the user is already running in the background, this method is a NOOP.
매개변수 | |
---|---|
userId | int : of the user to start in the background |
보고 | |
---|---|
boolean | true if the user was successfully started in the background. |
던지기 | |
---|---|
DeviceNotAvailableException |
시작사용자
public boolean startUser (int userId, boolean waitFlag)
Starts a given user in the background if it is currently stopped. If the user is already running in the background, this method is a NOOP. Possible to provide extra flag to wait for the operation to have effect.
매개변수 | |
---|---|
userId | int : of the user to start in the background |
waitFlag | boolean : will make the command wait until user is started and unlocked. |
보고 | |
---|---|
boolean | true if the user was successfully started in the background. |
던지기 | |
---|---|
DeviceNotAvailableException |
startVisibleBackgroundUser
public boolean startVisibleBackgroundUser (int userId, int displayId, boolean waitFlag)
Starts a given user in the background, visible in the given display (ie, allowing the user to launch activities in that display).
NOTE: this command doesn't check if the user exists, display is available, device supports such feature
, etc.
매개변수 | |
---|---|
userId | int : of the user to start in the background |
displayId | int : display to start user visible on |
waitFlag | boolean : will make the command wait until user is started and unlocked. |
보고 | |
---|---|
boolean | true if the user was successfully started visible in the background. |
던지기 | |
---|---|
DeviceNotAvailableException |
stopEmulatorOutput
public void stopEmulatorOutput ()
Close and delete the emulator output.
stopLogcat
public void stopLogcat ()
Stop capturing logcat output from device, and discard currently saved logcat data.
Will have no effect if logcat output is not being captured.중지사용자
public boolean stopUser (int userId)
Stops a given user. If the user is already stopped, this method is a NOOP. Cannot stop current and system user.
매개변수 | |
---|---|
userId | int : of the user to stop. |
보고 | |
---|---|
boolean | true if the user was successfully stopped. |
던지기 | |
---|---|
DeviceNotAvailableException |
중지사용자
public boolean stopUser (int userId, boolean waitFlag, boolean forceFlag)
Stop a given user. Possible to provide extra flags to wait for the operation to have effect, and force terminate the user. Cannot stop current and system user.
매개변수 | |
---|---|
userId | int : of the user to stop. |
waitFlag | boolean : will make the command wait until user is stopped. |
forceFlag | boolean : will force stop the user. |
보고 | |
---|---|
boolean | true if the user was successfully stopped. |
던지기 | |
---|---|
DeviceNotAvailableException |
switchToAdbTcp
public String switchToAdbTcp ()
Switch device to adb-over-tcp mode.
보고 | |
---|---|
String | the tcp serial number or null if device could not be switched |
던지기 | |
---|---|
DeviceNotAvailableException |
switchToAdbUsb
public boolean switchToAdbUsb ()
Switch device to adb over usb mode.
보고 | |
---|---|
boolean | true if switch was successful, false otherwise. |
던지기 | |
---|---|
DeviceNotAvailableException |
스위치사용자
public boolean switchUser (int userId)
Switch to another userId with a default timeout. switchUser(int, long)
.
매개변수 | |
---|---|
userId | int |
보고 | |
---|---|
boolean | True if the new userId matches the userId provider. False otherwise. |
던지기 | |
---|---|
DeviceNotAvailableException |
스위치사용자
public boolean switchUser (int userId, long timeout)
Switch to another userId with the provided timeout as deadline. Attempt to disable keyguard after user change is successful.
매개변수 | |
---|---|
userId | int |
timeout | long : to wait before returning false for switch-user failed. |
보고 | |
---|---|
boolean | True if the new userId matches the userId provider. False otherwise. |
던지기 | |
---|---|
DeviceNotAvailableException |
syncFiles
public boolean syncFiles (File localFileDir, String deviceFilePath)
Incrementally syncs the contents of a local file directory to device.
Decides which files to push by comparing timestamps of local files with their remote equivalents. Only 'newer' or non-existent files will be pushed to device. Thus overhead should be relatively small if file set on device is already up to date. Hidden files (with names starting with ".") will be ignored. Example usage: syncFiles("/tmp/files", "/sdcard") will created a /sdcard/files directory if it doesn't already exist, and recursively push the /tmp/files contents to /sdcard/files.매개변수 | |
---|---|
localFileDir | File : the local file directory containing files to recursively push. |
deviceFilePath | String : the remote destination absolute file path root. All directories in thos file path must be readable. ie pushing to /data/local/tmp when adb is not root will fail |
보고 | |
---|---|
boolean | true if files were synced successfully. 그렇지 않으면 false . |
던지기 | |
---|---|
DeviceNotAvailableException |
takeBugreport
public Bugreport takeBugreport ()
Take a bugreport and returns it inside a Bugreport
object to handle it. Return null in case of issue. File referenced in the Bugreport object need to be cleaned via Bugreport.close()
.
보고 | |
---|---|
Bugreport |
제거패키지
public String uninstallPackage (String packageName)
Uninstall an Android package from device.
매개변수 | |
---|---|
packageName | String : the Android package to uninstall |
보고 | |
---|---|
String | a String with an error code, or null if success. |
던지기 | |
---|---|
DeviceNotAvailableException |
uninstallPackageForUser
public String uninstallPackageForUser (String packageName, int userId)
Uninstall an Android package from device for a given user.
매개변수 | |
---|---|
packageName | String : the Android package to uninstall |
userId | int : the integer user id to uninstall for. |
보고 | |
---|---|
String | a String with an error code, or null if success. |
던지기 | |
---|---|
DeviceNotAvailableException |
unlockDevice
public boolean unlockDevice ()
Unlocks the device if the device is in an encrypted state.
This method may restart the framework but will not callpostBootSetup()
. Therefore, the device might not be fully ready to be tested when this method returns.보고 | |
---|---|
boolean | true if successful or if the device is unencrypted. |
던지기 | |
---|---|
DeviceNotAvailableException |
waitForBootComplete
public boolean waitForBootComplete (long timeOut)
Blocks until the device's boot complete flag is set.
매개변수 | |
---|---|
timeOut | long : time in msecs to wait for the flag to be set |
보고 | |
---|---|
boolean | true if device's boot complete flag is set within the timeout |
던지기 | |
---|---|
DeviceNotAvailableException |
waitForDeviceAvailable
public boolean waitForDeviceAvailable ()
Waits for the device to be responsive and available for testing. Uses default timeout.
보고 | |
---|---|
boolean | True if device is available, False if recovery is disabled and unavailable. |
던지기 | |
---|---|
DeviceNotAvailableException |
waitForDeviceAvailable
public boolean waitForDeviceAvailable (long waitTime)
Waits for the device to be responsive and available for testing.
매개변수 | |
---|---|
waitTime | long : the time in ms to wait |
보고 | |
---|---|
boolean | True if device is available, False if recovery is disabled and unavailable. |
던지기 | |
---|---|
DeviceNotAvailableException |
waitForDeviceAvailableInRecoverPath
public boolean waitForDeviceAvailableInRecoverPath (long waitTime)
Waits for the device to be responsive and available without considering recovery path.
매개변수 | |
---|---|
waitTime | long |
보고 | |
---|---|
boolean | True if device is available, False if unavailable. |
던지기 | |
---|---|
DeviceNotAvailableException |
waitForDeviceBootloader
public void waitForDeviceBootloader ()
Blocks until device is visible via fastboot. Use default timeout.
던지기 | |
---|---|
DeviceNotAvailableException |
waitForDeviceInRecovery
public boolean waitForDeviceInRecovery (long waitTime)
Blocks for the device to be in the 'adb recovery' state (note this is distinct from IDeviceRecovery
).
매개변수 | |
---|---|
waitTime | long : the time in ms to wait |
보고 | |
---|---|
boolean | true if device boots into recovery before time expires. false otherwise |
waitForDeviceInSideload
public boolean waitForDeviceInSideload (long waitTime)
Blocks for the device to be in the 'adb sideload' state
매개변수 | |
---|---|
waitTime | long : the time in ms to wait |
보고 | |
---|---|
boolean | true if device boots into sideload before time expires. false otherwise |
waitForDeviceNotAvailable
public boolean waitForDeviceNotAvailable (long waitTime)
Blocks for the device to be not available ie missing from adb
매개변수 | |
---|---|
waitTime | long : the time in ms to wait |
보고 | |
---|---|
boolean | true if device becomes not available before time expires. false otherwise |
waitForDeviceOnline
public void waitForDeviceOnline ()
Blocks until device is visible via adb. Uses default timeout
Note the device may not necessarily be responsive to commands on completion. UsewaitForDeviceAvailable()
instead.던지기 | |
---|---|
DeviceNotAvailableException |
waitForDeviceOnline
public void waitForDeviceOnline (long waitTime)
Blocks until device is visible via adb.
Note the device may not necessarily be responsive to commands on completion. UsewaitForDeviceAvailable()
instead.매개변수 | |
---|---|
waitTime | long : the time in ms to wait |
던지기 | |
---|---|
DeviceNotAvailableException |
waitForDeviceShell
public boolean waitForDeviceShell (long waitTime)
Waits for device to be responsive to a basic adb shell command.
매개변수 | |
---|---|
waitTime | long : the time in ms to wait |
보고 | |
---|---|
boolean | true if device becomes responsive before waitTime elapses. |
보호된 방법
addExtraConnectionBuilderArgs
protected void addExtraConnectionBuilderArgs (DefaultConnection.ConnectionBuilder builder)
매개변수 | |
---|---|
builder | DefaultConnection.ConnectionBuilder |
buildAdbShellCommand
protected String[] buildAdbShellCommand (String command, boolean forceExitStatusDetection)
Builds the OS command for the given adb shell command session and args
매개변수 | |
---|---|
command | String |
forceExitStatusDetection | boolean |
보고 | |
---|---|
String[] |
checkApiLevelAgainst
protected void checkApiLevelAgainst (String feature, int strictMinLevel)
매개변수 | |
---|---|
feature | String |
strictMinLevel | int |
createRebootDeviceAction
protected NativeDevice.RebootDeviceAction createRebootDeviceAction (NativeDevice.RebootMode rebootMode, String reason)
Create a RebootDeviceAction
to be used when performing a reboot action.
매개변수 | |
---|---|
rebootMode | NativeDevice.RebootMode : 이 재부팅 모드입니다. |
reason | String : 이번 재부팅을 위한 것입니다. |
보고 | |
---|---|
NativeDevice.RebootDeviceAction | the created RebootDeviceAction . |
doAdbReboot
protected void doAdbReboot (NativeDevice.RebootMode rebootMode, String reason)
adb 재부팅을 수행합니다.
매개변수 | |
---|---|
rebootMode | NativeDevice.RebootMode : 이 재부팅 모드입니다. |
reason | String : 이번 재부팅을 위한 것입니다. |
던지기 | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
ensureRuntimePermissionSupported
protected void ensureRuntimePermissionSupported ()
helper method to throw exception if runtime permission isn't supported
던지기 | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
getApiLevelSafe
protected int getApiLevelSafe ()
보고 | |
---|---|
int |
initializeConnection
protected void initializeConnection (IBuildInfo info, MultiMap<String, String> attributes)
매개변수 | |
---|---|
info | IBuildInfo |
attributes | MultiMap |
던지기 | |
---|---|
DeviceNotAvailableException | |
TargetSetupError |
internalGetProperty
protected String internalGetProperty (String propName, String fastbootVar, String description)
Fetch a device property, from the ddmlib cache by default, and falling back to either `adb shell getprop` or `fastboot getvar` depending on whether the device is in Fastboot or not.
매개변수 | |
---|---|
propName | String : The name of the device property as returned by `adb shell getprop` |
fastbootVar | String : The name of the equivalent fastboot variable to query. if null , fastboot query will not be attempted |
description | String : A simple description of the variable. First letter should be capitalized. |
보고 | |
---|---|
String | A string, possibly null or empty, containing the value of the given property |
던지기 | |
---|---|
DeviceNotAvailableException |
isInRebootCallback
protected boolean isInRebootCallback ()
Returns whether reboot callbacks is currently being executed or not. All public api's for reboot should be disabled if true.
보고 | |
---|---|
boolean |
isNewer
protected boolean isNewer (File localFile, IFileEntry entry)
Return true
if local file is newer than remote file. IFileEntry
being accurate to the minute, in case of equal times, the file will be considered newer.
매개변수 | |
---|---|
localFile | File |
entry | IFileEntry |
보고 | |
---|---|
boolean |
notifyRebootEnded
protected void notifyRebootEnded ()
Notifies all IDeviceActionReceiver
about reboot end event.
던지기 | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
notifyRebootStarted
protected void notifyRebootStarted ()
Notifies all IDeviceActionReceiver
about reboot start event.
던지기 | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
performDeviceAction
protected boolean performDeviceAction (String actionDescription, NativeDevice.DeviceAction action, int retryAttempts)
Performs an action on this device. Attempts to recover device and optionally retry command if action fails.
매개변수 | |
---|---|
actionDescription | String : a short description of action to be performed. Used for logging purposes only. |
action | NativeDevice.DeviceAction : the action to be performed |
retryAttempts | int : the retry attempts to make for action if it fails but recovery succeeds |
보고 | |
---|---|
boolean | true if action was performed successfully |
던지기 | |
---|---|
DeviceNotAvailableException | if recovery attempt fails or max attempts done without success |
postAdbReboot
protected void postAdbReboot ()
Possible extra actions that can be taken after a reboot.
던지기 | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
사전 PostBoot 설정
protected void prePostBootSetup ()
각 장치 유형(AndroidNativeDevice, TestDevice)이 특정 부팅 후 설정에 대해 이 메서드를 재정의할 수 있도록 허용합니다.
던지기 | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
pullFileInternal
protected boolean pullFileInternal (String remoteFilePath, File localFile)
매개변수 | |
---|---|
remoteFilePath | String |
localFile | File |
보고 | |
---|---|
boolean |
던지기 | |
---|---|
DeviceNotAvailableException |
setClock
protected void setClock (Clock clock)
Set the Clock instance to use.
매개변수 | |
---|---|
clock | Clock |
setMicrodroidProcess
protected void setMicrodroidProcess (Process process)
Marks the TestDevice as microdroid and sets its CID.
매개변수 | |
---|---|
process | Process : Process of the Microdroid VM. |
setTestDeviceOptions
protected void setTestDeviceOptions (deviceOptions)
매개변수 | |
---|---|
deviceOptions |
simpleFastbootCommand
protected CommandResult simpleFastbootCommand (long timeout,envVarMap, String[] fullCmd)
Executes a simple fastboot command with environment variables and report the status of the command.
매개변수 | |
---|---|
timeout | long |
envVarMap | |
fullCmd | String |
보고 | |
---|---|
CommandResult |
simpleFastbootCommand
protected CommandResult simpleFastbootCommand (long timeout, String[] fullCmd)
Executes a simple fastboot command and report the status of the command.
매개변수 | |
---|---|
timeout | long |
fullCmd | String |
보고 | |
---|---|
CommandResult |
waitForDeviceNotAvailable
protected boolean waitForDeviceNotAvailable (String operationDesc, long time)
Wait to see the device going unavailable (stop reporting to adb).
매개변수 | |
---|---|
operationDesc | String : The name of the operation that is waiting for unavailable. |
time | long : The time to wait for unavailable to occur. |
보고 | |
---|---|
boolean | True if device did become unavailable. |
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2023-12-01(UTC)