iphone:如何从自制应用程序构建IPA文件?
我为 iOS 编写了一个小应用程序,使用了 Mac OS X 10.6.6、Xcode 3.2.5 和 iOS SDK 4.2,所有这些都在 Virtual Box machine 4.0 中运行。
现在我希望该应用程序在我的 iPhone 上运行并将其分发给一些 Beta 测试人员。因为我不是注册的苹果开发者,并且我不想向苹果支付 99 美元,所以我需要找到其他方法。
我在网上找到的第一件事是 alex Whittemore 的教程: alexwhittemore.com
我按照说明创建了一个自签名根证书,对 Xcode 程序进行了二进制修补并添加了一些脚本构建过程。之后,我从“调试”模式切换到“发布”模式,从“模拟器”模式切换到“设备”模式。构建过程以警告消息结束:
应用程序未通过协同设计验证。签名无效,或者不是用Apple提交证书签名的。 (-19011)
但我在 Release-iphoneos-folder 中仍然有一个 appname.app 文件夹,我可以通过 ssh 或 scp 将其传输到我越狱 iphone 的 /Applications/-folder 中。之后我在 iPhone 上调用“uicache”,该应用程序显示在跳板中。我还可以启动该应用程序,一切正常。
现在的问题是,我想要我的应用程序的 IPA 文件。正如我在网上读到的,IPA 文件只不过是名为“Payload”的文件夹中的 appname.app 文件夹,与两个名为 iTunesArtwork 和 iTunesMetadata.plist 的文件压缩在一起。我使用 512x512 jpeg 图像创建了 iTunesArtworks 文件,并使用我在网上找到的一些预设创建了 plist 文件。之后,appname.zip 文件必须重命名为 appname.ipa。我手动执行此过程,并通过 scp 将 IPA 文件传输到 iPhone 上安装应用程序的下载文件夹中。然后我开始 installous 并尝试安装我的应用程序 - 出现错误消息:
安装失败:无效的 ipa
我在网上搜索了此错误消息,并找到了有关更新我的 Appsync 和 Installous 的信息 -安装。我从 hackulo.us-repository 更新了这两个程序,但这没有帮助。
所以我想,我在 IPA 创建过程中做错了什么。我做了一些研究,发现可以将 appname.app-folder 拖放到 itunes 中,它会自动生成一个 IPA 文件。然后你可以在 iTunes 的某个文件夹中找到 IPA 文件。我将此文件复制到我的 iPhone 上的 installous 的下载文件夹中,并尝试再次安装此文件,但显示了相同的错误消息。
我的问题: 如果我有自签名应用程序,如何为 installous 创建有效的 IPA 文件? installous 会检查签名吗?
也许有人给我一个提示...
编辑:
我找到了解决我的问题的方法。
因为我想了解有关安装错误消息的更多信息,所以我通过 iPhone 上的 cydia 安装了“syslogtoggle”和“syslogd to /var/log/syslog”,以将详细信息记录到 /var/log/syslog。然后我尝试再次安装 IPA 文件,并在 syslog 中从 installd 守护进程收到一条消息,该消息表明 IPA 文件的最低 iOS 版本要求为 4.2,而我的 iphone 运行在 iOS 4.0 下。
*installd[163]: 00503000 verify_bundle_metadata: 系统版本低于最低操作系统版本*
有趣的是,通过 ssh 将 appname.app-folder 复制到 /Applications/ 将应用程序安装为系统应用程序没有问题,但使用错误的最小 iOS 版本参数内置。所以我使用适合我的 iPhone 的正确的最小 iOS 版本重建我的应用程序。
我尝试再次安装,但再次收到有关 IPA 无效的错误消息。这次 installd 守护进程在我的 iPhone 的系统日志中告诉我,它无法安装系统应用程序:
*installd[193]: 00503000 preflight_application_install: Can't install System or Internal apps*
这个问题很容易解决,因为我仍然将该应用程序作为系统应用程序安装在/Applications/中。我只需要删除 /Applications/appname.app 文件夹并通过 ssh 使用用户“mobile”调用“uicache”两次。然后我再次启动 installous 并尝试安装我的 IPA 文件 - 瞧:它成功了!
也许我能够帮助有类似问题的人。如果出现“无效的 ipa”等通用错误消息,通过 cydia 安装 syslog-apps 似乎是一个好主意,以便仔细查看 installous 的错误消息。
ps:我真的很生气,我的问题被主持人关闭了!只是因为有人认为我的问题“并不普遍适用于全球互联网受众”。关闭问题太愚蠢了!现在你看到了:我找到了一个解决方案,并将其发布在这里..也许它会对将来的某人有所帮助!你不应该因为过度控制用户内容而犯下与维基百科相同的错误。
I programmed a small app for iOS, and I used Mac OS X 10.6.6, Xcode 3.2.5 and iOS SDK 4.2, all running in a Virtual Box machine 4.0.
now I want the app to run on my iphone and to distribute it to some beta testers. because I'm not a registered apple developer and I don't want to pay $99 to apple, I need to find some other way.
the first thing I found on the net is the tutorial of alex whittemore:
alexwhittemore.com
I followed the instructions by creating a self sign root certificate,binary patching the Xcode program and adding some scripts to the build process. afterwards, I switched to from "debug" to "release" mode and from "simulator" to "device". the build-process ends with a warning-message:
Application failed codesign verification. The signature was invalid, or it was not signed with an Apple submission certificate. (-19011)
but I still have a appname.app folder in the Release-iphoneos-folder, which I can transfer via ssh or scp in the /Applications/-folder of my jailbroken iphone. afterwards I call "uicache" on the iphone and the app is shown in springboard. I can also start the app and everything works fine.
now is the problem, that I want an IPA file of my app. as I read on the net, an IPA file is nothing more than the appname.app folder in a folder called "Payload", zipped together with two files called iTunesArtwork and iTunesMetadata.plist. I created the iTunesArtworks file out of an 512x512 jpeg image and the plist file from some preset I found on the net. afterwards, the appname.zip file has to be renamed to appname.ipa. I did this process manually and transfered the IPA file via scp to the download-folder of my installous-app on my iphone. then I started installous and tried to install my app - there comes the error message:
installation failed: invalid ipa
I did a search on the net for this error message and found something about updating my Appsync and Installous-installation. I updated both programs from the hackulo.us-repository, but this didn't help.
so I thought, that I did something wrong during the IPA-creation-process. I did some research and found out, that it is possible to drag and drop the appname.app-folder to itunes, which automatically makes an IPA file of it. then you can find the IPA file in some folder of iTunes. I copied this file to the download folder of installous on my iphone and tried to install this file again, but the same error message is shown.
my question:
how can I make a valid IPA file for installous, if I have a self-signed app? does installous check the signature?
maybe someone has a hint for me...
EDIT:
I found a solution for my problem.
because I wanted more information on the installous-error-message, I installed "syslog toggle" and "syslogd to /var/log/syslog" via cydia on my iphone to log detailed information to /var/log/syslog. then I tried to install the IPA file again and I got a message in the syslog from the installd daemon, that the IPA file has a minimum-iOS-version requirement of 4.2, while my iphone is running under iOS 4.0.
*installd[163]: 00503000 verify_bundle_metadata: The system version is lower than the minimum OS version*
interessingly there was no problem to install the app as system application by copying the appname.app-folder via ssh to /Applications/, but with the wrong minimum-iOS-version-parameter build in. so I rebuild my app with the right minimum-iOS-version for my iphone.
I tried to install again, but again I got an error message about an invalid IPA. this time the installd daemon tells me in the syslog of my iphone, that it couldn't install an system application:
*installd[193]: 00503000 preflight_application_install: Can't install System or Internal apps*
this problem was easy to solve, because I still had the app installed as system application in /Applications/. I just needed to delete the /Applications/appname.app folder and call "uicache" twice with the user "mobile" via ssh. then I startet installous again and tried to install my IPA file - et voila: IT WORKED!!
maybe I was able to help someone with a similar problem. it seems to be a good idea to install the syslog-apps via cydia to have a closer look for the error messages of installous, if some generic error message like "invalid ipa" appears.
ps: I was really irritated, that my question was closed by the moderator! just because someone thinks, that my question is "not generally applicable to the worldwide audience of the internet." it's soooo stupid to close questions! now you see: I got a solution and I posted it here.. maybe it will help someone in the future! you shouldn't make the same fault as wikipedia by over-controlling the user content.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论