[教程] Mac 一键安装APK到设备上,使用Applescri

2020-08-20  本文已影响0人  懒人吃货一个
Using Automator Applescript open iTerm to run adb install apk
使用 Automator[自动运行],Applescript脚本 Automator安装.apk Applescript安装.apk
使用Applescript打开iTerm2 安装apk

1、打开自动操作

image.png

2、新建快速操作

image.png

3、选择类型

image.png

4、拖入

image.png

5、粘贴这段代码

image.png
tell application "Finder"
    set theFile to selection
    set apkPath to POSIX path of (theFile as alias)
    if application "iTerm" is running then
        tell application "iTerm"
            set newWindow to (create window with default profile)
            tell current session of newWindow
                write text "adb install -r " & apkPath
            end tell
        end tell
    else
        activate application "iTerm"
        write text "adb install -r " & apkPath
    end if
end tell

当然命令替换成你自己想改的也可以,不想用iTerm,可以自己换成 terminal

6、保存一下

image.png

7、选择apk文件,右键运行服务,安装APK

image.png

8、安装中......

image.png
上一篇 下一篇

猜你喜欢

热点阅读