【问题标题】:Running an Applescript after build phase in Xcode在 Xcode 中构建阶段后运行 Applescript
【发布时间】:2019-03-24 01:00:18
【问题描述】:

我有一个可以打开 Safari 开发者工具的 Applescript。这使我免于每次构建 Cordova / Phonegap 应用程序时单击“开发”->“检查”-> index.html 的麻烦。

我现在想在构建项目并在模拟器中打开它时调用这个 Applescript。

我已尝试按照https://developer.apple.com/library/ios/recipes/xcode_help-project_editor/Articles/AddingaRunScriptBuildPhase.html 中的说明添加构建阶段并添加脚本。

但是,当我在 XCode 中构建项目时出现错误:"auto_opendevtools.applescript: bad interpreter: Permission denied"。似乎所有的权限都很好。

我是如何在构建阶段输入脚本的:

导致错误:

【问题讨论】:

    标签: ios xcode cordova applescript


    【解决方案1】:

    “Add Run Script Build Phase”需要一个shell命令或shell脚本的路径。

    要从 shell 脚本运行 AppleScript,您必须使用 osascript 命令。

    osascript "/the path of/auto_opendevtools.applescript"
    

    【讨论】:

    • 那么您应该将osascript "/the path of/auto_opendevtools.applescript 放在上面写着“Shell:”的位置,还是将其粘贴到上面那行代码的字段中?
    • @John 输入路径或将其粘贴到 Shell 字段上方的字段中
    • 或将#!/usr/bin/env osascript 放在脚本顶部
    猜你喜欢
    • 2020-09-04
    • 2010-11-23
    • 2015-01-18
    • 2012-12-28
    • 2017-01-30
    • 2010-11-24
    • 2019-04-11
    • 2015-11-26
    • 1970-01-01
    相关资源
    最近更新 更多