You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

GitHub Actions macOS-14 ARM64 Runner测试应用启动超时问题求助

解决GitHub Actions macOS-14 ARM64 Runner上应用启动超时问题

针对你在ARM64 Runner上遇到的应用启动挂起、AppleEvent超时问题,可尝试以下几种方案:

1. 绕过Gatekeeper安全检查

GitHub Actions的macOS Runner默认启用Gatekeeper,Ad-hoc签名的应用会触发交互验证弹窗,导致脚本挂起。可通过spctl命令将应用添加到信任列表:

- name: Test-launch the app
  run: |
    cd build
    sudo cp -R RawTherapee.app /Applications
    # 添加应用到Gatekeeper信任列表
    sudo spctl --add /Applications/RawTherapee.app
    open -a RawTherapee --no-wait
    sleep 5
    # 直接检查进程是否存在,替代Finder的AppleEvent查询
    pgrep RawTherapee && echo "RawTherapee is running" || echo "RawTherapee failed to start"

若仅为测试环境,可临时关闭Gatekeeper(不建议生产环境使用),替换上述spctl --add命令为:

sudo spctl --master-disable

2. 修改open命令避免阻塞

原open -a命令会默认等待应用启动完成,添加--no-wait参数可让命令立即返回,避免脚本挂起:

open -a RawTherapee --no-wait

3. 替换进程检查方式,规避AppleEvent超时

原脚本通过Finder的AppleEvent查询可见进程,在ARM64环境下易触发超时。改用直接查询进程的方式更可靠:

  • 用pgrep检查进程是否存在:
pgrep -x RawTherapee
  • 或用ps命令过滤:
ps aux | grep -v grep | grep RawTherapee

4. 直接启动二进制时添加超时控制

若直接启动Contents/MacOS下的主二进制,可用timeout命令限制启动等待时间,避免无限挂起:

timeout 10s /Applications/RawTherapee.app/Contents/MacOS/RawTherapee &
sleep 5
pgrep RawTherapee

额外说明

即使移除沙箱和运行时授权,ARM64架构的macOS 14在无交互环境下对未公证应用的限制仍比x86_64更严格。优先推荐「添加Gatekeeper信任+修改进程检查方式」的组合方案,既能解决安全弹窗问题,又能避免AppleEvent超时。

内容的提问来源于stack exchange,提问作者Richard Barber

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.20 16:03:18