我在当前工作目录(CWD)中有以下目录结构:
-
MyAppBundle/MyApp.app
-
MyAppBundle.plist
MyAppBundle.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">
<array>
<dict>
<key>BundleHasStrictIdentifier</key>
<true/>
<key>BundleIsRelocatable</key>
<true/>
<key>BundleIsVersionChecked</key>
<true/>
<key>BundleOverwriteAction</key>
<string>upgrade</string>
<key>RootRelativeBundlePath</key>
<string>MyApp.app</string>
</dict>
</array>
</plist>
当我从CWD运行以下命令时:
pkgbuild --root ./MyAppBundle --component-plist 'MyAppBundle.plist' MyApp.pkg
我得到以下输出:
pkgbuild: Reading components from MyAppBundle.plist
pkgbuild: Adding component at MyApp.app
pkgbuild: error: (null)
好的,我已经想通了。如果我将--identifier <unique identifier>
添加到上面的pkgbuild
命令中,它就会起作用。