mortenjust / androidtool-mac

One-click screenshots, video recordings, app installation for iOS and Android
Apache License 2.0
5.43k stars 325 forks source link

Debugging scripts #68

Closed redwarp closed 8 years ago

redwarp commented 8 years ago

Cool tool, love it. I'm currently working on a script to activate wireless debugging. The script works as is, but I modified it to work with AndroidTool like that:

#!/bin/bash
declare -a arr
thisdir=$1 # $1 is the bundle resources path directly from the calling script file
serial=$2 #
adb=$thisdir/adb

adb kill-server
wait
adb -s $serial tcpip 5555
wait
sleep 5s
adb_shell_ip_addrs=$(adb -s $serial shell ip route)
adb_shell_ip_addrs=$(echo "$adb_shell_ip_addrs" | awk {'if( NF >=9){print $9;}'})
adb -s $serial connect ${adb_shell_ip_addrs}:5555
wait

The problem is: this doesn't work! Do you have a recommendation to debug the script, or have some logs, when running it from AndroidTool?

mortenjust commented 8 years ago

The script doesn't have your PATH, so you need to use $adb instead of adb. Let me know how it goes!

redwarp commented 8 years ago

Thanks! It work indeed. It would still be good to have a console output somewhere when we run the scripts, or maybe just the ability to run AndroidTool from a console and see the output.

mortenjust commented 8 years ago

Yes, very much agree. Opened #69 for that

mortenjust commented 8 years ago

This is now in release 1.4. Let me know if it works for you

https://github.com/mortenjust/androidtool-mac/releases/tag/1.4

redwarp commented 8 years ago

Thanks, you rock