在Xcode中构建阶段后运行Applescript

时间:2014-09-19 11:50:39

标签: ios xcode cordova applescript

我有一个打开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"。似乎所有的权限都没问题。

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

enter image description here

导致错误:

enter image description here

1 个答案:

答案 0 :(得分:5)

" 添加运行脚本构建阶段"需要shell命令或shell脚本的路径。

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

osascript "/the path of/auto_opendevtools.applescript"
相关问题