Android adb shell commands

Following are the adb shell commands, which I have tried and working on android device,

Get Device information such as product, model, etc from adb

Browsing the applications

  • Swipe Up
    ./out/host/linux-x86/bin/adb shell input swipe 100 100 0 0
  • Swipe Horizontal
    ./out/host/linux-x86/bin/adb shell input swipe 200 200 0 0
  • Go to Home Menu
    ./out/host/linux-x86/bin/adb shell input keyevent 3

 Logs, Install applications, packages

  • Collecting logs on desktop from device
    ./out/host/linux-x86/bin/adb shell logcat > logcat-for-debugging.txt
  • Install application
    ./out/host/linux-x86/bin/adb install Application_Name.apk

 Controlling Peripherals, debugging peripheral information

  • Turn ON Bluetooth & make it discoverable
    adb shell am start -a android.bluetooth.adapter.action.REQUEST_ENABLE
    adb shell am start -a android.bluetooth.adapter.action.REQUEST_DISCOVERABLE
    refer android bluetooth settings source code.
  • Get display information
    adb shell dumpsys display
    to get only display resolution
    ./out/host/linux-x86/bin/adb shell dumpsys display | grep mBaseDisplayInfo
  • Get the information about the hardware supported features
    $ ./out/host/linux-x86/bin/adb shell pm list features

Telephony commands

  • Call a number from command line using adb
    check “adb devices” and note down the serial number,
    ./out/host/linux-x86/bin/adb -s serial_no shell am start -a android.intent.action.CALL -d tel:telephone_number
    change serial_no & telephone_number as per your setup.
READ  How to recover data / folder deleted with rm -rf

Some references for more information :

Leave a Reply

Your email address will not be published. Required fields are marked *