Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

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. it is more complex than simply running an archive, b. it is error-prone and stops development of the new version on the machine it is done, and c. there could be some bias related to the compiler changes or any other XCode change in between rendering the version hard to compile.

I could not find any help on that on StackOverflow, nor any sign of this possibility in the Archive repository in XCode. Should I file a feature request @ Apple?

like image 890
Resh32 Avatar asked Mar 15 '13 08:03

Resh32


People also ask

Can I run an iOS app on a simulator?

After you create a project, you can build and run your app on a simulated or real device without needing to lay out the user interface or write code. You may connect a real device to your Mac using a cable, or for iOS or tvOS apps, connect it over Wi-Fi after you pair it with Xcode.

Can we install IPA file in simulator?

Just like an APK (Android Application Package) file can be installed on Android devices, an IPA file can be used for testing iOS applications. You can even push it to the app stores to publish your app. You can think of an IPA file like a simple ZIP file.


4 Answers

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. Code built for the simulator is compiled for x86 processors, so that it can run on Macs.

like image 120
jnpdx Avatar answered Oct 18 '22 20:10

jnpdx


One reasonably easy way to do this is through Test Flight. We routinely test new versions through Test Flight, the old ones stay there and it’s possible to return to them anytime. 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.

like image 36
zoul Avatar answered Oct 18 '22 20:10

zoul


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.

In order to do this, you must create an adhoc provisioning profil. Check Apple documentation, since it's a little complicated to explain

like image 2
Mr Bonjour Avatar answered Oct 18 '22 20:10

Mr Bonjour


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). If it was build for the simulator (meaning i386 cpu architecture) then you can't create the ipa for the device.

As far as I know, you can make an ipa out of an Xcode 4 archive using command line:

/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

like image 1
Lefteris Avatar answered Oct 18 '22 21:10

Lefteris