Principle and environment

APK installations are implemented primarily through the ADB install command, while macOS has Automator that allows you to customize a number of workflows to perform scripts and other operations. Add an install APK to the right click of the access implementation.

Environment:

  • macOS
  • Installation of theadbThe command orandroidSdkEnvironment variables are configured
  • The mobile developer option ADB can be debugged
  • In the endadb devicesCheck whether the device is available

steps

  1. Automatic operation found in the program to open

  1. Select Quick Operation

  1. Select run AppleScript to add the script

Tell application “Terminal” in the script means to open the Terminal. Change it if you have iterm2 installed

on run {input, parameters}
	tell application "Terminal"
		set thePath to POSIX path of input as string
		do script "adb install -r " & thePath
		activate
	end tell
end run
Copy the code

Note: When saving, the file name is the right menu name for example: install APK

use

Find the APK file, right click -> Services -> Install APK to automatically open the terminal to execute the installation command, according to your needs can be arbitrarily changed

If you don’t like to click the trouble to add shortcuts

conclusion

In this way, you can add a lot of interesting operations to macOS and make things more efficient. The hard part is that you need to learn appleScript and expect people to share their scripts.

  • Note: If you want to uninstall APK, go to Settings – Keyboard – Shortcut keys – Services – Install APK – ‘right-click the display location and delete’.