I finally did it. I am in a Mac environment, so I used Applescript to simplify setting some variables, but this can be done directly from the terminal.
set apkref to "install -r /path/to/your/app.apk"
set appref to "shell am start -a android.intent.action.MAIN -n
com.example.app/com.example.app.MainActivity"
set sourceref to "/path/to/android/tools/"
set devices to do shell script sourceref & "adb devices | grep \"[device]$\" |
sed 's/.device/\\ /' | sed 's/^/\\adb -s /' | sed 's@$@\\" & apkref &
" \\&" & "@' | sed 's@^@\\" & sourceref & "@'
| sed -E -e :a -e '$!N; s/\\n/ /g; ta'"
do shell script devices
set devices to do shell script sourceref & "adb devices | grep \"[device]$\" |
sed 's/.device/\\ /' | sed 's/^/\\adb -s /' | sed 's@$@\\" & appref &
" \\&" & "@' | sed 's@^@\\" & sourceref & "@'
| sed -E -e :a -e '$!N; s/\\n/ /g; ta'"
do shell script devices
, . sed , .
script apk , adb. , adb - -r. , , . & &, , .
script .
, - sed, .
, Automator logcat adb (, ctrl + c logcat, ).
, Automator, Eclipse Mac OS X . , .
Growl Automator, , adb .