[教程] Mac 一键安装APK到设备上,使用Applescript打开iTerm2 安装apk

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
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容