notes/Android Shell Tutorial adb July 2014-MDMuMu53.sh
#after rooting you may or may not be root
busybox


#package manager help output

pm
#list all packages

pm list packages
#and apk

pm list all packages -f

#start program then
#ps is not enough

logcat -d|grep <package>|grep cmp|head -n1|tr '=' '\n'|grep ^com|cut -d\} -f1

#start program

am start -n <output from last comment>

#this is used to start up default programs <like xdg-open or start>
am start -a android.intent.action.VIEW
#examples mp3

am start -a android.intent.action.VIEW -d "file:///mnt/sdcard/Download/music.mp3"
killall <program> or kill pid
am start -a android.intent.action.VIEW -d http://www.filmsbykris.com

#if you just want to use Firefox regardless of default browser

am start -n org.mozilla.firefox/.App http://www.filmsbykris.com

#program data is stored in /data/data/

#example this is your contact database

#is it SQLite format 3 #you can see this by ‘head’ing  it
/data/data/com.android.providers.contacts/databases/contacts2.db 



#sendkeys
am start -n org.mozilla.firefox/.App http://www.google.com
input text 'Hello'
input text 'Hello%sWorld'


#volume loop

for i in `seq 1 10`;do input keyevent 24 & echo "Volume Up";done
for i in `seq 1 10`;do input keyevent 25 & echo "Volume Down";done

syntax highlighted by Code2HTML, v. 0.9.1