From 58129149a308eb1c01a574633b51568cbfde3c3c Mon Sep 17 00:00:00 2001 From: JohnE Date: Wed, 19 Sep 2018 21:02:38 -0700 Subject: [PATCH] FIX: updated the android alias script to be cleaner --- .bash_android_tools | 7 +++++-- scripts/adbnet.sh | 12 ++++-------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.bash_android_tools b/.bash_android_tools index 8681f8d..08b7688 100644 --- a/.bash_android_tools +++ b/.bash_android_tools @@ -34,6 +34,9 @@ alias adconv="dd if=myAppBackup.ab bs=24 skip=1 | $OSSL zlib -d > myAppBackup.ta # # VMWare Multiple Device Tricks =) # +# *** SEE ~/scripts/adbnet.sh to set aliases for ADB +# # alias the multi-connected devices -alias adb1='adb -s 192.168.123.131' -alias adb2='adb -s 192.168.123.132' +# alias adb1='adb -s 192.168.123.131' +# alias adb2='adb -s 192.168.123.132' +# diff --git a/scripts/adbnet.sh b/scripts/adbnet.sh index a2b2c07..971d262 100755 --- a/scripts/adbnet.sh +++ b/scripts/adbnet.sh @@ -9,6 +9,7 @@ # alias adb2='adb -s 192.168.123.132' # allow aliases to be created in "interactive shells" +# this doesn't seem to work on OS X shopt -s expand_aliases PARAM1=$1 @@ -47,8 +48,6 @@ echo_error() { echo "***" } -#!/bin/bash - # Test an IP address for validity: # Usage: # valid_ip IP_ADDRESS @@ -76,15 +75,13 @@ function valid_ip() create_adb_aliases() { if [[ -n $PARAM2 ]]; then if [ $PARAM2 == "-f" ]; then - set -x for NUM in $(seq 1 9) do - # `alias adb$NUM=\"adb -s $PARAM1$NUM\"` + # this will echo all commands, turn on echo + set -x alias adb${NUM}="adb -s ${PARAM1}${NUM}" - # alias "adb${NUM}=adb -s ${PARAM1}${NUM}" - # alias "adb${NUM}"="\`adb -s ${PARAM1}${NUM}\`" + set +x done - set +x else echo_error "-f needs to be second parameter to force the execution" fi @@ -96,7 +93,6 @@ create_adb_aliases() { for NUM in $(seq 1 9) do echo " alias adb$NUM=\"adb -s ${PARAM1}${NUM}\"" - # echo "adb${NUM}=adb -s ${PARAM1}${NUM}" done fi