我正在为 OS X 开发一个非常简单的应用程序包。我的操作系统是 10.7.5 版。本例中的应用程序是一个 shell 脚本。
Kerkerkruip.app/Contents/Info.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>Kerkerkruip</string>
<key>CFBundleIconFile</key>
<string>Kicon.icns</string>
<key>CFBundleIdentifier</key>
<string>org.kerkerkruip.Kerkerkruip</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Kerkerkruip</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<!--<key>CFBundleSignature</key>
<string>????</string>-->
<key>CFBundleVersion</key>
<string>9.0.1</string>
<key>LSMinimumSystemVersion</key>
<string>10.4</string>
<key>NSHumanReadableCopyright</key>
<string>© 2011-2015 by the Kerkerkruip team</string>
<!--<key>NSMainNibFile</key>
<string>MainMenu</string>-->
<!--<key>NSPrincipalClass</key>
<string>NSApplication</string>-->
</dict>
</plist>
Kerkerkruip.app/Contents/MacOS/Kerkerkruip:
#!/usr/bin/env bash
echo "This is a blank script." 1>&2
exit 1
当我尝试打开应用程序时,我收到以下错误消息:
$ open Kerkerkruip.app/
The application cannot be opened because it has an incorrect executable format.
脚本设置为 +x。我在 SuperUser 上看到过这个问题,但没有任何帮助——我的脚本超过 27 个字符。
编辑:按照其他问题中的说明为我的应用程序重建启动服务数据库后,现在尝试打开它会产生:
LSOpenURLsWithRole() failed with error -10810 for the file /Users/dannii/Documents/kerkerkruip/packages/osx/Kerkerkruip.app.