LoginSignup
2
1

More than 3 years have passed since last update.

adb - Android debug tool

Last updated at Posted at 2019-11-25

Enable Device Debug

  • Enable developer mode on your Android device
    1. Settings ⇒ System ⇒ About Phone ⇒ Tap "Build number" over 7 times and quickly
    2. Then you will see "You are already developer"
  • Enable debugging
    1. Go to "Developer Options" ⇒ Enable "ADB debugging"
    2. Connect Android phone to your Windows PC, then you will see a pop-up ( some phone will not show pop-up, please check notification center)
    3. Choose "Transfer files"

adb Setup

Windows

    cd C:\{adb folder path}

Mac

Check installation success

  • Type
    adb
  • If you can see below message, means adb is able to use
    Android Debug Bridge version 1.0.40
    Version 4986621
    Installed as C:\{adb folder path}\adb\adb.exe

    global options:
     -a         listen on all network interfaces, not just localhost
     -d         use USB device (error if multiple devices connected)
     -e         use TCP/IP device (error if multiple TCP/IP devices available)
     -s SERIAL  use device with given serial (overrides $ANDROID_SERIAL)
     -t ID      use device with given transport id
     -H         name of adb server host [default=localhost]
     -P         port of adb server [default=5037]
     -L SOCKET  listen on given socket for adb server [default=tcp:localhost:5037]

adb command

  • Connect your Android phone to PC/MAC, then type
    adb devices

If you see below message, means your Android phone already connected to PC, and able to use adb command

    List of devices attached
    35PDU18712000000        device
  • Send text to device
    adb shell input text "textttt"
    adb shell input keyevent TAB
    adb shell input keyevent 61
2
1
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
2
1