DeviceMonitor

public final class DeviceMonitor
extends Object

java.lang.Object
com.android.tradefed.device.server.DeviceMonitor


DeviceMonitor는 adb에 연결된 기기를 모니터링합니다.

한 스레드에서 DeviceListMonitorTask를 실행합니다. 이렇게 하면 adb 호스트에 소켓 연결 이 설정되고 ERROR(DeviceListMonitorTask.ADB_TRACK_DEVICES_COMMAND/com.android.tradefed.device.server.DeviceListMonitorTask#ADB_TRACK_DEVICES_COMMAND DeviceListMonitorTask.ADB_TRACK_DEVICES_COMMAND)가 실행됩니다. 그런 다음 기기 연결 및 기기 상태에 관한 모든 변경사항을 소켓에서 모니터링합니다. ERROR(/AndroidDebugBridge::getClientSupport)가 사용 설정되지 않으면 ERROR(/DeviceClientMonitorTask)가 실행되지 않고 기기가 등록되지 않습니다.

다른 스레드에서 ERROR(/DeviceClientMonitorTask)를 실행합니다. 이렇게 하면 등록된 기기당 adb 호스트에 소켓 연결이 설정되고 ERROR(/DeviceClientMonitorTask.ADB_TRACK_JDWP_COMMAND)가 실행됩니다. 이 연결에서 기기의 활성 클라이언트를 모니터링합니다. 참고: 단일 스레드가 모든 기기의 jdwp 연결을 모니터링합니다. adb에 대한 여러 소켓 연결 (기기당 하나)은 단일 선택기에서 다중화됩니다.

요약

중첩된 클래스

class DeviceMonitor.DeviceListComparisonResult

 

공개 생성자

DeviceMonitor(AndroidDebugBridge server)

DeviceMonitor 객체를 만들고 실행 중인 AndroidDebugBridge 객체에 연결합니다.

공개 메서드

int getConnectionAttemptCount()
IDevice[] getDevices()

기기를 반환합니다.

int getRestartAttemptCount()
boolean hasInitialDeviceList()
boolean isMonitoring()

모니터가 현재 디버그 브리지 서버에 연결되어 있는지 여부를 반환합니다.

void start()

모니터링을 시작합니다.

void stop()

모니터링을 중지합니다.

공개 생성자

DeviceMonitor

public DeviceMonitor (AndroidDebugBridge server)

DeviceMonitor 객체를 만들고 실행 중인 AndroidDebugBridge 객체에 연결합니다.

매개변수
server AndroidDebugBridge: 실행 중인 AndroidDebugBridge입니다.

공개 메서드

getConnectionAttemptCount

public int getConnectionAttemptCount ()

반환
int

getDevices

public IDevice[] getDevices ()

기기를 반환합니다.

반환
IDevice[]

getRestartAttemptCount

public int getRestartAttemptCount ()

반환
int

hasInitialDeviceList

public boolean hasInitialDeviceList ()

반환
boolean

isMonitoring

public boolean isMonitoring ()

모니터가 현재 디버그 브리지 서버에 연결되어 있는지 여부를 반환합니다.

반환
boolean

start

public void start ()

모니터링을 시작합니다.

stop

public void stop ()

모니터링을 중지합니다.