#
#  Misc Tools
#

# set a path to script tools
export PATH=~/scripts:$PATH

# 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 =)
# 
# *** 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'
# 
