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.

Some references for more information :

Android Android Commands Android Java Applications Application Libraries Bash / Shell Scripts Bluetooth driver Build Frameworks Commands and Packages Core Kernel C Programs Development Environment Setup Documents / Books Errors & Failures File Systems Framebuffer / Display Driver git Go Language Programs Hardware Platforms Home JAVA Programs Kernel & Device Drivers Kernel Booting and Porting Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL NDK / Middleware / HAL Network Driver OS Concepts PHP Procfs Filesystem Programming Languages RaspberryPi Scripting and Automation Search Engine Optimisation ( SEO ) Socurce Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Userspace Utilities Web design and development Wordpress Yocto / Bitbake / Openembedded
Tags: ,

Leave a Reply