From d6fb29c6546e221cea23c81998a9b5a70dbaf67c Mon Sep 17 00:00:00 2001 From: JohnE Date: Fri, 27 Apr 2018 10:40:51 -0700 Subject: [PATCH] NEW: added more android alias tricks...android adb multi-device alias added --- .bash_android | 29 +---------------------------- .bash_android_tools | 36 ++++++++++++++++++++++++++++++++++++ .bash_profile | 1 + 3 files changed, 38 insertions(+), 28 deletions(-) create mode 100644 .bash_android_tools diff --git a/.bash_android b/.bash_android index df10441..6099b45 100644 --- a/.bash_android +++ b/.bash_android @@ -47,32 +47,5 @@ export PATH=$ANDROID_SDK_HOME/tools:$PATH export PATH=$ANDROID_NDK_HOME:$PATH export PATH=$ANDROID_NDK_HOME/build/tools:$PATH -### ### ### -### backup the android app -### next convert to .tar format -alias adbback='adb backup -f myAppBackup.ab' #com.corp.appName -alias adconv="dd if=myAppBackup.ab bs=24 skip=1 | $OSSL zlib -d > myAppBackup.tar" - -# App Management -# -# -# $ grep -o option specifices to only ouput matching text -# $ adb devices | grep -o -x '([\w.:]+)\sdevice$' -# $ grep '([[[:alnum:]].:]+)\sdevice$' - -# install an app on all devices -alias mkapp="adb devices | tail -n +2 | cut -sf 1 | xargs -I XoX0Xo adb -s XoX0Xo install -r $1" -# uninsall an app from all devices -alias rmapp="adb devices | tail -n +2 | cut -sf 1 | xargs -I XoX0Xo adb -s XoX0Xo uninstall $1" -# remove all the app data -alias clearapp="adb devices | tail -n +2 | cut -sf 1 | xargs -I XoX0Xo adb -s XoX0Xo shell pm clear $1" -# start an intent on all devices -alias startintent="adb devices | tail -n +2 | cut -sf 1 | xargs -I XoX0Xo adb -s XoX0Xo shell am start $1" - - -# Android IDE launches from command line (to pickup bash environment vars) -alias intellij='/Applications/IntelliJ\ IDEA\ CE.app/Contents/MacOS/idea &' -alias studio='/Applications/Android\ Studio.app/Contents/MacOS/studio &' - # 12/14/2016 had to unset the variable to get virtual devices working -#unset ANDROID_SDK_HOME \ No newline at end of file +#unset ANDROID_SDK_HOME diff --git a/.bash_android_tools b/.bash_android_tools new file mode 100644 index 0000000..d5060fd --- /dev/null +++ b/.bash_android_tools @@ -0,0 +1,36 @@ +# +# Misc Tools +# + +# Android IDE launches from command line (to pickup bash environment vars) +alias intellij='/Applications/IntelliJ\ IDEA\ CE.app/Contents/MacOS/idea &' +alias studio='/Applications/Android\ Studio.app/Contents/MacOS/studio &' + +# +# App Management +# +# +# $ grep -o option specifices to only ouput matching text +# $ adb devices | grep -o -x '([\w.:]+)\sdevice$' +# $ grep '([[[:alnum:]].:]+)\sdevice$' + +# install an app on all devices +alias mkapp="adb devices | tail -n +2 | cut -sf 1 | xargs -I XoX0Xo adb -s XoX0Xo install -r $1" +# uninsall an app from all devices +alias rmapp="adb devices | tail -n +2 | cut -sf 1 | xargs -I XoX0Xo adb -s XoX0Xo uninstall $1" +# remove all the app data +alias clearapp="adb devices | tail -n +2 | cut -sf 1 | xargs -I XoX0Xo adb -s XoX0Xo shell pm clear $1" +# start an intent on all devices +alias startintent="adb devices | tail -n +2 | cut -sf 1 | xargs -I XoX0Xo adb -s XoX0Xo shell am start $1" + +# backup the android app, next convert to .tar format +alias adbback='adb backup -f myAppBackup.ab' #com.corp.appName +alias adconv="dd if=myAppBackup.ab bs=24 skip=1 | $OSSL zlib -d > myAppBackup.tar" + + +# +# VMWare Multiple Device Tricks =) +# +# alias the multi-connected devices +alias adb1='adb -s 192.168.123.131' +alias adb2='adb -s 192.168.123.132' diff --git a/.bash_profile b/.bash_profile index 04a8786..6e3688f 100644 --- a/.bash_profile +++ b/.bash_profile @@ -9,6 +9,7 @@ source ~/.bash_servers source ~/.bash_tools source ~/.bash_dev source ~/.bash_android +source ~/.bash_android_tools source ~/.bash_python source ~/.bash_override