无法安装使用productbuild创建的OSX软件包
我对整个 mac 开发和部署领域都很陌生。我正在尝试创建一个 OSX 应用程序并使用 Itunes Connect 和应用程序加载器将其上传到应用程序商店。我使用 Mac OSX 版本 10.6.8
我已经使用以下方式对我的应用程序进行了协同设计:
codesign -s "3rd Party Mac Developer Application: <company name>" <my app name>.app
然后我使用以下方式构建了一个安装程序包:
productbuild --component <my app name>.app /Applications --sign "3rd Party Mac Developer Installer: <company name>" <my app name>.pkg
在协同设计和产品构建期间,我没有收到任何错误,并且应用程序运行没有问题。
不幸的是我无法安装该软件包。如果我在命令行中使用以下命令运行 pkg:
sudo installer -store -pkg <my app name>.pkg -target /
我得到以下输出:
installer: <my app name>.pkg has valid signature for submission
installer: Installation Check: Passed
installer: Volume Check: Passed
installer: Bundle <my bundle name> will be relocated to <path to my app>/<my app name>.app
installer: Starting install
installer: Install 0.0% complete
installer: Install 5.0% complete
[...]
installer: Install 95.0% complete
installer: Install failed: Beim Extrahieren von Dateien aus dem Paket <my app name>.pkg“ ist ein Fehler aufgetreten.
该错误意味着“提取软件包文件时出错...”
installer.log 中有关失败安装的条目:
Install Failed: PKG: extracting "<my bundle name>"
Error Domain=PKInstallErrorDomain Code=110 UserInfo=0x1004687b0 "Beim Extrahieren von Dateien aus dem Paket „<my app name>.pkg“ ist ein Fehler aufgetreten." Underlying Error=(Error Domain=BOMCopierFatalError Code=0 UserInfo=0x10c9af710 "Der Vorgang konnte nicht abgeschlossen werden. cpio read error: Unknown error: 0") {
NSFilePath = "/var/folders/zz/zzzivhrRnAmviuee+++++++++++/Cleanup At Startup/PKInstallSandbox-tmp/Root/Applications";
NSLocalizedDescription = "Beim Extrahieren von Dateien aus dem Paket \U201e<my App name>.pkg\U201c ist ein Fehler aufgetreten.";
NSURL = "#<my bundle name>.pkg -- file://localhost/<path to my app>/<my app name>.pkg#Distribution";
NSUnderlyingError = "Error Domain=BOMCopierFatalError Code=0 UserInfo=0x10c9af710 \"Der Vorgang konnte nicht abgeschlossen werden. cpio read error: Unknown error: 0\"";
我猜它有一些问题处理 cpio 读取错误,但我在这里迷路了......
Im quite new to the whole mac development- and deployment world. Im trying to create an OSX app and upload it to the appstore using Itunes Connect and the Application Loader. Im using Mac OSX Version 10.6.8
I have codesigned my App using:
codesign -s "3rd Party Mac Developer Application: <company name>" <my app name>.app
Then I've built a Installer Package using:
productbuild --component <my app name>.app /Applications --sign "3rd Party Mac Developer Installer: <company name>" <my app name>.pkg
During codesign and productbuild i get no errors and the Application runs without problems.
Unfortunately I am unable to install the package. If I run the pkg in the commandline using:
sudo installer -store -pkg <my app name>.pkg -target /
I get following output:
installer: <my app name>.pkg has valid signature for submission
installer: Installation Check: Passed
installer: Volume Check: Passed
installer: Bundle <my bundle name> will be relocated to <path to my app>/<my app name>.app
installer: Starting install
installer: Install 0.0% complete
installer: Install 5.0% complete
[...]
installer: Install 95.0% complete
installer: Install failed: Beim Extrahieren von Dateien aus dem Paket <my app name>.pkg“ ist ein Fehler aufgetreten.
The error means "Error during the extraction of files of the package ..."
The entry in the installer.log regarding the faild install:
Install Failed: PKG: extracting "<my bundle name>"
Error Domain=PKInstallErrorDomain Code=110 UserInfo=0x1004687b0 "Beim Extrahieren von Dateien aus dem Paket „<my app name>.pkg“ ist ein Fehler aufgetreten." Underlying Error=(Error Domain=BOMCopierFatalError Code=0 UserInfo=0x10c9af710 "Der Vorgang konnte nicht abgeschlossen werden. cpio read error: Unknown error: 0") {
NSFilePath = "/var/folders/zz/zzzivhrRnAmviuee+++++++++++/Cleanup At Startup/PKInstallSandbox-tmp/Root/Applications";
NSLocalizedDescription = "Beim Extrahieren von Dateien aus dem Paket \U201e<my App name>.pkg\U201c ist ein Fehler aufgetreten.";
NSURL = "#<my bundle name>.pkg -- file://localhost/<path to my app>/<my app name>.pkg#Distribution";
NSUnderlyingError = "Error Domain=BOMCopierFatalError Code=0 UserInfo=0x10c9af710 \"Der Vorgang konnte nicht abgeschlossen werden. cpio read error: Unknown error: 0\"";
I guess it has something to do with the cpio read error, but Im lost here ...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
问题是 installd 在磁盘上的其他位置找到您的 .app 并得出结论它已经安装,但已重新定位。它在你的构建目录中找到它,对吧?至少这是我的情况。
解决方案是:
这样,在安装过程中(当您启动安装程序时)将不会在磁盘上的任何位置找到正在安装的完全相同的二进制文件(已存档)。 installd 不会关心可以在 ~/Library/Developer/Xcode/DerivedData/ 或磁盘上其他任何位置找到的应用程序的调试版本。
The problem is that installd finds your .app somewhere else on the disk and concludes it's already installed, but relocated. It finds it in your build dir, right? At least this was my case.
A solution to this would be to:
This way, the exact same binary that's being installed (when you start your installer), will not be found anywhere on the disk during installation (it's archived). And installd will not care for the debug build of the app that can be found in ~/Library/Developer/Xcode/DerivedData/ or anywhere else on the disk.
好的,重建应用程序并将其打包到不同的文件夹中就可以了。我仍然不确定问题是什么,但至少我现在可以继续。
Okay, rebuilding the app and packaging it in a different folder did the trick. Im still not sure what the problem was, but at least I can continue now.