TCP modeで起動
# TCPモードで起動(ポート番号は5555)
$ adb tcpip 5555
restarting in TCP mode port: 5555
# 現在のポート番号を取得
$ adb shell getprop service.adb.tcp.port
5555
IPアドレスを取得
$ adb shell ip addr show wlan0 | grep 'inet ' | cut -d ' ' -f 6 | cut -d / -f1
192.168.1.99
現在表示されているアクティビティを取得
$ adb shell dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp'
mCurrentFocus=Window{9f14bce u0 com.android.settings}
mFocusedApp=AppWindowToken{1bd74d7 token=Token{7d71c56 ActivityRecord{97ec671 u0 com.huawei.android.launcher/.unihome.UniHomeLauncher t251}}}