我正在为 OS X 开发一个非常简单的应用程序包。我的操作系统版本是 10.7.5。本例中的应用程序是一个 shell 脚本。
Kerkerkruip.app/Contents/Info.plist https://github.com/i7/kerkerkruip/blob/master/packages/osx/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 https://github.com/i7/kerkerkruip/blob/master/packages/osx/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。我见过关于超级用户的这个问题 https://superuser.com/q/145675但没有任何帮助 - 我的脚本超过 27 个字符。
编辑:按照说明进行操作后在另一个问题中 https://stackoverflow.com/a/16546673/2854284为我的应用程序重建启动服务数据库,尝试打开它现在会产生:
LSOpenURLsWithRole() failed with error -10810 for the file /Users/dannii/Documents/kerkerkruip/packages/osx/Kerkerkruip.app.