NEW: added more android alias tricks...android adb multi-device alias added
This commit is contained in:
		
							parent
							
								
									94e1eb39c0
								
							
						
					
					
						commit
						d6fb29c654
					
				| 
						 | 
					@ -47,32 +47,5 @@ export PATH=$ANDROID_SDK_HOME/tools:$PATH
 | 
				
			||||||
export PATH=$ANDROID_NDK_HOME:$PATH
 | 
					export PATH=$ANDROID_NDK_HOME:$PATH
 | 
				
			||||||
export PATH=$ANDROID_NDK_HOME/build/tools:$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
 | 
					# 12/14/2016 had to unset the variable to get virtual devices working
 | 
				
			||||||
#unset ANDROID_SDK_HOME
 | 
					#unset ANDROID_SDK_HOME
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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'
 | 
				
			||||||
| 
						 | 
					@ -9,6 +9,7 @@ source ~/.bash_servers
 | 
				
			||||||
source ~/.bash_tools
 | 
					source ~/.bash_tools
 | 
				
			||||||
source ~/.bash_dev
 | 
					source ~/.bash_dev
 | 
				
			||||||
source ~/.bash_android
 | 
					source ~/.bash_android
 | 
				
			||||||
 | 
					source ~/.bash_android_tools
 | 
				
			||||||
source ~/.bash_python
 | 
					source ~/.bash_python
 | 
				
			||||||
source ~/.bash_override
 | 
					source ~/.bash_override
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue