IShellEnabledDevice

public interface IShellEnabledDevice

com.android.ddmlib.IShellEnabledDevice


셸 명령어를 수신할 수 있는 추상 기기입니다.

요약

공개 메서드

abstract void executeShellCommand(String command, IShellOutputReceiver receiver, long maxTimeToOutputResponse, TimeUnit maxTimeUnits)

기기에서 셸 명령어를 실행하고 결과를 receiver에 전송합니다.

abstract void executeShellCommand(String command, IShellOutputReceiver receiver, long maxTimeout, long maxTimeToOutputResponse, TimeUnit maxTimeUnits)

기기에서 셸 명령어를 실행하고 결과를 receiver에 전송합니다.

abstract String getName()

이 기기의 (사람이 읽을 수 있는) 이름을 반환합니다.

abstract ListenableFuture<String> getSystemProperty(String name)

시스템 속성에 대해 잠재적인 비동기 쿼리를 실행합니다.

공개 메서드

executeShellCommand

public abstract void executeShellCommand (String command, 
                IShellOutputReceiver receiver, 
                long maxTimeToOutputResponse, 
                TimeUnit maxTimeUnits)

기기에서 셸 명령어를 실행하고 결과를 receiver에 전송합니다.

maxTimeToOutputResponse는 기기에서 명령어 출력을 예상할 때 최대 대기 시간으로 사용됩니다.
언제든지 셸 명령어가 maxTimeToOutputResponse보다 긴 기간 동안 아무것도 출력하지 않으면 메서드는 ShellCommandUnresponsiveException를 발생시킵니다.

로그 출력과 같은 명령어의 경우 메서드가 예외를 발생시키지 않고 수신자의 IShellOutputReceiver.isCancelled()true를 반환할 때까지 차단됨을 의미하는 maxTimeToOutputResponse 값 0을 사용해야 합니다.

매개변수
command String: 실행할 셸 명령어

receiver IShellOutputReceiver: 셸 명령어의 출력을 수신할 IShellOutputReceiver

maxTimeToOutputResponse long: 명령어가 응답을 출력하지 않아도 되는 최대 시간입니다. 값이 0이면 메서드가 명령 출력을 무한정 기다리며 (receiver가 실행을 취소할 때까지) 예외를 발생시키지 않습니다.

maxTimeUnits TimeUnit: 0이 아닌 maxTimeToOutputResponse 값의 단위입니다.

생성 값
TimeoutException 명령어를 전송할 때 연결이 시간 초과되는 경우
AdbCommandRejectedException adb가 명령어를 거부하는 경우
ShellCommandUnresponsiveException 셸 명령어가 maxTimeToOutputResponse보다 긴 기간 동안 출력을 전송하지 않는 경우
연결에 I/O 오류가 있는 경우

executeShellCommand

public abstract void executeShellCommand (String command, 
                IShellOutputReceiver receiver, 
                long maxTimeout, 
                long maxTimeToOutputResponse, 
                TimeUnit maxTimeUnits)

기기에서 셸 명령어를 실행하고 결과를 receiver에 전송합니다.

maxTimeToOutputResponse는 기기에서 명령어 출력을 예상할 때 최대 대기 시간으로 사용됩니다.
언제든지 셸 명령어가 maxTimeToOutputResponse보다 긴 기간 동안 아무것도 출력하지 않으면 메서드는 ShellCommandUnresponsiveException를 발생시킵니다.

로그 출력과 같은 명령어의 경우 메서드가 예외를 발생시키지 않고 수신자의 IShellOutputReceiver.isCancelled()true를 반환할 때까지 차단됨을 의미하는 maxTimeToOutputResponse 값 0을 사용해야 합니다.

매개변수
command String: 실행할 셸 명령어

receiver IShellOutputReceiver: 셸 명령어의 출력을 수신할 IShellOutputReceiver

maxTimeout long: 명령어가 반환되는 최대 제한 시간입니다. 값이 0이면 최대 제한 시간이 적용되지 않습니다.

maxTimeToOutputResponse long: 명령어가 응답을 출력하지 않아도 되는 최대 시간입니다. 값이 0이면 메서드가 명령 출력을 무한정 기다리며 (receiver가 실행을 취소할 때까지) 예외를 발생시키지 않습니다.

maxTimeUnits TimeUnit: 0이 아닌 maxTimeoutmaxTimeToOutputResponse 값의 단위입니다.

생성 값
TimeoutException 명령어를 전송할 때 연결이 시간 초과되는 경우
AdbCommandRejectedException adb가 명령어를 거부하는 경우
ShellCommandUnresponsiveException 셸 명령어가 maxTimeToOutputResponse보다 긴 기간 동안 출력을 전송하지 않는 경우
연결에 I/O 오류가 있는 경우

getName

public abstract String getName ()

이 기기의 (사람이 읽을 수 있는) 이름을 반환합니다. 일반적으로 AVD의 경우 AVD 이름이고 기기의 경우 제조업체 이름, 모델 이름, 일련번호의 조합입니다.

반환 값
String

getSystemProperty

public abstract ListenableFuture<String> getSystemProperty (String name)

시스템 속성에 대해 잠재적인 비동기 쿼리를 실행합니다.

매개변수
name String: 반환할 값의 이름입니다.

반환 값
ListenableFuture<String> ListenableFuture. ERROR(get/Future#get() get)이 null을 반환할 수 있습니다.