Android Debug Bridge Tips


Android Debug Bridge Tips

ADB Tips

Visit the Android Debug Bridge Developer Site for indepth information -

# install a custom launcher: 
adb install -r MatrixDD.apk


# set and start launcher (e.g. the one above):
adb shell cmd package set-home-activity
adb shell am start -n


# reset launcher back to the Android phone launcher:
adb shell cmd package set-home-activity
adb shell am start -n


# run an app:
adb shell am start -n <package-name>/<activity-name>
# e.g. adb shell am start -n


# list 3rd party installed packages:
adb shell cmd package list packages -3


# find activity of an installed package: (from an apk: aapt dump badging yourapp.apk)
adb shell cmd package resolve-activity --brief <package-name>


# uninstall a package e.g. Vysor:
adb uninstall com.koushikdutta.vysor


# turn bluetooth on:
adb root
adb shell service call bluetooth_manager 6

# use 8 to turn off

# for wifi use: adb shell svc wifi enable # or disable
adb unroot


# power down:
adb shell reboot -p


# check battery level:
adb shell "dumpsys battery | grep level"


# adb over wifi (setup wifi connection first):
# find ip address:
adb shell "ifconfig wlan0 | grep 'inet addr:'"

# restart adb over wifi:
adb tcpip 5555

# connect over wifi: (you can now disconnect usb cable)
adb connect <ip address>:5555

# to revert to usb:
adb usb # or just reboot


Re: Android Debug Bridge Tips

I forgot to add the following keyboard input adb command:


adb shell input keyevent 23

   useful for selecting a popup dialog to set focus on or to 'click' on a selection or button


   to navigate to a button use the following key codes (includes volume control)


19 -->  "KEYCODE_DPAD_UP" 


In summary you can use adb commands to avoid having to use or install Vysor. 

You can also automate standard Android UI navigation with scripts. 


Eventually all of the Android UI popup dialogs will be in VR, but for now (e.g. for a rom update) you can navigate and click on buttons with the keycodes above and just use adb from the command line.


Re: Android Debug Bridge Tips

 Thanks for the wonderful job and just an add on for the installation of the apps with and without multi-devices connected:

adb install example.apk (for the installation in the memory of the device)

adb install -s example (for the installation in the SD-Card of the device)