简体   繁体   English

我可以在模拟器中运行旧的应用程序存档吗?

[英]Can I run an old app archive in the Simulator?

When we deploy new versions of the iOS app into the App Store through XCode, an archive is generated. 当我们通过XCode将新版本的iOS应用程序部署到App Store时,会生成一个存档。

Is there a way to take an old archive and run it in the simulator? 有没有办法获取旧存档并在模拟器中运行它? I would like to do that in order to be able to easily test backward compatibility of the server-side code with all the previous versions of the app (or at least the two mostly used at that time). 我想这样做是为了能够轻松测试服务器端代码与所有以前版本的应用程序(或至少当时主要使用的两个版本)的向后兼容性。

I know that I could commit into a GIT repository and pull a specific version, but that has two problems: a. 我知道我可以提交到GIT存储库并提取特定版本,但这有两个问题:a。 it is more complex than simply running an archive, b. 它比简单地运行档案更复杂,b。 it is error-prone and stops development of the new version on the machine it is done, and c. 它很容易出错,并且在它完成的机器上停止开发新版本,并且c。 there could be some bias related to the compiler changes or any other XCode change in between rendering the version hard to compile. 可能存在一些与编译器更改有关的偏差,或者在渲染版本难以编译之间的任何其他XCode更改。

I could not find any help on that on StackOverflow, nor any sign of this possibility in the Archive repository in XCode. 我在StackOverflow上找不到任何帮助,也没有在XCode的Archive存储库中找到这种可能性的任何迹象。 Should I file a feature request @ Apple? 我应该提交功能请求@ Apple吗?

No, you can't take an archive generated for the App Store and run it in the simulator -- even if you could deal with the signing issues, etc, the archive generated for the App Store contains code compiled for ARM processors, which the i-devices have. 不,您不能为App Store生成存档并在模拟器中运行 - 即使您可以处理签名问题等,为App Store生成的存档包含为ARM处理器编译的代码, i-devices有。 Code built for the simulator is compiled for x86 processors, so that it can run on Macs. 为模拟器构建的代码是为x86处理器编译的,因此它可以在Mac上运行。

One reasonably easy way to do this is through Test Flight . 一个相当简单的方法是通过Test Flight We routinely test new versions through Test Flight, the old ones stay there and it's possible to return to them anytime. 我们通过Test Flight定期测试新版本,旧版本停留在那里,随时可以返回它们。 It's a different build than the one you finally submit to the App Store, but that's something that will always be true, as the App Store build is signed using the distribution certificate and AFAIK won't run anywhere unless installed through the store. 它与您最终提交给App Store的版本不同,但是这一切都是正确的,因为App Store版本使用分发证书进行签名,除非通过商店安装,否则AFAIK不会在任何地方运行。

You can make OTA (over the air) version of your app (then you can download those binary from a server), or simply create an ipa file and install it from iTunes. 您可以制作应用程序的OTA(无线)版本(然后您可以从服务器下载这些二进制文件),或者只需创建一个ipa文件并从iTunes安装它。

In order to do this, you must create an adhoc provisioning profil. 为此,您必须创建一个特殊配置概要文件。 Check Apple documentation, since it's a little complicated to explain 检查Apple文档,因为解释起来有点复杂

If your archive was build for a device (AdHoc or Release) you can make an ipa file and install it on a device (explanation below on how-to). 如果您的存档是为设备构建的(AdHoc或Release),您可以创建一个ipa文件并将其安装在设备上(下面有关操作方法的说明)。 If it was build for the simulator (meaning i386 cpu architecture) then you can't create the ipa for the device. 如果它是为模拟器构建的(意味着i386 cpu架构),那么你就无法为设备创建ipa。

As far as I know, you can make an ipa out of an Xcode 4 archive using command line: 据我所知,您可以使用命令行从Xcode 4存档中创建一个ipa:

/usr/bin/xcrun -sdk iphoneos PackageApplication
  "/absolute/path/to/MyApp.xcarchive/Products/Applications/MyApp.app"
  -o "/absolute/path/to/MyApp.ipa"

After you get the ipa, you can install it on physical devices, if it had been created with the correct signature, else you can re-sign it 获得ipa后,您可以将其安装在物理设备上,如果它是使用正确的签名创建的,否则您可以重新签名

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM