LoginSignup
3
2

More than 5 years have passed since last update.

adbコマンド集

Last updated at Posted at 2018-01-17

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}}}
3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2