Hi,
Thought I'd share my slightly modified version of
build.sh, which has some improvements:
- It extracts the proper package name from the XML manifest;
- It clears the log file (so that you avoid dumping many pages of useless info);
- It automatically starts the app using "adb shell am start";
- It adds a filter to logcat so that we capture (mostly) the messages related to our app.
#!/bin/bash
# get package name from XML manifest
PACKAGENAME=`xmllint --xpath "string(/manifest/@package)" AndroidManifest.xml`
# build .apk file in bin folder
ant debug
# uninstall previous version of app
adb uninstall $PACKAGENAME
# install new version
adb install bin/LCLExample-debug.apk
# clear log file
adb logcat -c
# start app
adb shell am start -a android.intent.action.MAIN -n $PACKAGENAME/.LCLActivity
# capture only debug messages that are related to our app
adb logcat lclapp,DEBUG,dalvikvm:I *:S