Reputation: 2211
I recently upgraded my iPad to iOS 6.0, but kept my Xcode install at version 4.4.1 and iOS SDK 5.1, since we are about to package up a client app and don't want to take the risk of switching SDK's/iOS versions this late in development.
Now this iPad no longer shows up in the build target list with it's full name, it just says "iOS Device". And when I attempt to deploy on the iPad it informs me: "Xcode cannot run using the selected device. No provisioned iOS devices are available with a compatible iOS version. Connect an iOS device with a recent enough version of iOS to run your application or choose an iOS simulator as the destination." The Organizer also tells me the version of iOS on the iPad doesn't match any version of the SDK in Xcode.
This is all correct, but shouldn't I be able to deploy a 5.1 app to a device running 6.0? Apps which I've previously built using 5.1 continue to run fine on this device, why shouldn't new apps do the same? Am I having a weird issue, or is this normal behavior in Xcode?
Thanks!
Edit: Follow-up question: if I upgrade my version of Xcode to solve this problem, can I still build for the 5.1 SDK and be absolutely certain the app will work on my client's 5.1 devices? That's my main concern.
Upvotes: 1
Views: 2876
Reputation: 26652
You can still deploy the older apps but not using Xcode. Instead, you'll need to create an ipa archive and install it either via iTunes, or using a tool such as Testflight or some other over the air (OTA) distribution.
Alternatively, yes you can upgrade your version of Xcode. However, you may then have further issues as third party libraries you use may not have been compiled for armv7s. So you would then need to upgrade them. If that's the case you'll see this error from the linker:
ld: file is universal (3 slices) but does not contain a(n) armv7s slice
For more info on that specific problem see elsewhere on stackoverflow, e.g.
None of this of course stops you from working in the simulator.
However, running on the device, all in all, a good solution that works for me has been to download the Xcode 4.5 dmg. Since Xcode has become available from the App Store, it's now a self contained package. You can now have multiple versions happily coexisting on the same machine.
I do that and use Xcode 4.5 for new iOS 6 stuff whilst I continue working on older apps with 4.4.
Upvotes: 4
Reputation: 69027
First of all, try to go to Xcode Organizer (small icon in the upper right corner) and see there if you can enable your device for development (click on the device and then its details should appear). There is a chance that this will download all the necessary stuff to allow Xcode to use your newer iOS device (debugging symbols and things like that).
If this does not work, then the issue you are describing is simply related to your development environment being too old and not able to manage a device running iOS6. Anyway, this will not prevent your 5.1 app from being deployed on a device running iOS6; the only thing is you cannot do it from your old Xcode.
If all else fails, what you could try and do in manually install your 5.1 app through iTunes, as any tester external to the development team would also do. This should work.
Upvotes: 1