Running an older iOS version in the iPhone simulator - iphone

I want to test my application on older iOS versions. I am using weak linking for new frameworks and branches in the code for different OS version. But after some complaints from users running iOS 3.1.2, I need to do some testing myself. I don't have a separate iPhone for every iOS version.
So, how can I run an older version of iOS in the iPhone simulator?
That's a really basic question and there might be a duplicate somewhere, but I wasn't able to find it. Any help is much appreciated.

If you can download (or have a backup of) the older SDK that relates to the older OS you want to run on, I believe the general advice is to install the other SDK to a different path (say, Developer/olderSDK and this way you can have both SDK's (and simulators) installed side by side.

Related

How to deploy code on Xcode 4 to newer ios

I have a very old Mac which is currently running Mac OSX Lion. It has Xcode 4 on it, and I created an app using that. Is it possible to deploy this app onto a newer iPhone? If not, do have any options to reuse the code on a newer version of Xcode?
If you want to deploy app on a device running iOS version more current than your Xcode supports, you won’t be able to launch it directly from Xcode. Just build the app for a generic device and then install the app manually. E.g. https://stackoverflow.com/a/35044362/1271826.
Just to warn you, while you can often install apps built on old Xcode versions on contemporary devices, occasionally there are little OS changes that break apps (and going back this many OS/SDK versions increases the probability of that). If this happens, without a contemporary Xcode version it will be exceedingly difficult to debug/diagnose the issue. Also, needless to say, you won’t be able to take advantage of contemporary device features (like bigger screens or whatever).
One final caveat: You won’t be able to distribute this app to the App Store until you build the app using a contemporary SDK version, generally achieved by building using a recent Xcode version. Review the Apple’s Developer News for references to minimum SDK versions.
Xcode 4 did not have Swift built-in, iirc, so your code is likely to be Objective-C.
You will have to update stuff, but nothing major like the conversion from Swift 1 to 5 would require.

Limitations of an old version of iPhone SDK

I have a mac with OSX version 10.5.6 and I'm wondering about the limits of developing iPhone apps with it.
Since I need to install an old SDK, will the apps I make still be possible to use on new iPhones? What kind of features will I miss out on, by using an old SDK? Are there any major changes in the new version of Xcode that will make it reduntant or unprogressive for me to learn an old SDK?
You will not be able to submit an app to the App Store unless it has been compiled against the latest iOS SDK (iOS 5.1 at this time, iOS 6 soon.) This does not mean it needs to use the features in the latest SDK, but you must have used that SDK when compiling. Apple will automatically reject apps compiled against an older SDK.
If you don't care about the App Store and just want to play around, you can do so with an old SDK but it might not allow you to attach the debugger to a device running a newer version of iOS.
Since I need to install an old SDK, will the apps I make still be
possible to use on new iPhones?
The code is for the most part is still the same. Your apps will work on all iPhones, iPads, and iPod touches.
What kind of features will I miss out on, by using an old SDK?
Faster Compiling, Code suggestions, and a few other things that won't prevent you from making iOS apps in the future.
Are there any major changes in the new version of Xcode that will make it reduntant or unprogressive for me to learn an old SDK?
No
Good luck!

How do I Ensure my Application's iOS Deployment Target will be Usable for that SDK?

I would like to set my iPhone App's iOS Deployment Target to the minimum possible SDK, which appears to be iOS 3.0 in Xcode version 3.2.6. Thus far, the base SDK I have been running against has been the latest (iOS 4.3). How can ensure that I am not using any newer features (i.e. since iOS 3.0) in my code, and that the application will not crash for the older iOS versions? Do I just need to find and install the older iOS SDK? If so, where may I find these version controlled SDKs?
Thanks,
Jeremy
You could try to run it on a device with the older sdk (we keep devices around with 3.1.3 for instance). However, you won't be able to find a downloadable version of the old OS from Apple.
If you don't have a versioned device around, the best way would be to look at any "suspicious" pieces of code that might have new features and make sure they are available in your base OS version (using the class references)
Yes, it's a bad system, but now you can start to keep old sdks around (i always make a copy onto a local storage device before I install a new version). As for restoring your device: I think you have to have made a backup at some time (i'm not 100% sure). But if you could I think it would be in organizer on Xcode and I guess you could check in iTunes too.

iPhone App Run Different iOS

I am getting a fat binary when I go to upload, and I want to make sure that my application can run across 3.0, well even 2.0. Is there a specific way to make sure that this will show when I go to upload. I am not using any specific iOS 4 features, and I only have iOS 4 in my xCode. How can I test different iOS version?
The only way as I could think of is test your app on real old OS version devices. Since Apple prefers its users to upgrade to new OS version as soon as possible, they don't actually provide an official way for developers to test such backward compatibility.
Another relevant questions would be, "can I downgrade my device OS version to an old one, so that I can test my app on them?" I once did a research on SO and other Apple forums, and the result I got was NO, we developers don't have a way to "officially" downgrade our device OS version. Yes there are exceptions, you can try jail-breaking and then downgrading.
For jail-breaking / downgrading your OS version, check this post, A TimeMachine taking my iDevice back to 3.1.2? .
Edited: It's actually pretty easy to make sure that users with old OS versions can downloaded and install your app. All you need to do is set the Deployment Target in Xcode to the lowest OS version you want (iOS 3.0 would be the lowest in Xcode 3.2.5).
However, you need to bear in mind that such Deployment Target only ensures that your app can be downloaded and installed on such old version OS devices. They don't ensure compatibility during runtime. You still need to test your app on real old OS devices to ensure compatibility.
I dont think u need to worry about app version 3.0 below because it is not supported anymore. but how to test on different version, make sure change the iOS deployment target as Thomas refered.
There is no currently supported way to do this.
No current Simulator or Xcode tool will ensure that an app is completely compatible with an OS version older than the SDK used. The 2.0 SDK is not compatible with the current development tools. There is no officially supported way to downgrade a device.
Furthermore, Apple no longer even accepts app submissions that have a deployment target lower than 3.0.
Even most old 1st gen devices, if you can find one on eBay, have been upgraded to iOS 3.1.3. But if you have access to an old device running iOS 3.1.3, you can use that for testing. Many developers keep an old used iPod Touch around for just his purpose.
People with devices running something older than 3.1.3 are not only a really tiny percentage of the installed base, but are very unlikely to be still buying apps for that device. Even large developers with staff and legacy hardware available for this testing rarely waste the time on this market.
Look into Project -> Edit Project Settings -> iOS Deployment Target: 3.13. And then build?
Edit according to comment: You still need to ENSURE your code is within the runtime scope, i.e. do checks like 'respondstoselector' before calling methods in question.

Developing for 2.2.1 SDK on Snow Leopard

I’ve installed Snow Leopard, have Xcode 3.2 and 3.0 iPhone SDK. I want my applications to run on 2.2.1, but the SDK is nowhere to be found in Xcode. I’ve set the deploy target to 2.2.1, but still I cannot be sure I am not using any 3.0-isms. (I’ve sent a sample application to my friend who still has 2.2.1 and it does not run, so it looks I really do use some 3.0 specific API.) How can make sure that my applications will run on 2.2.1? (Simulator also lists only 3.0 as version option.) I’d hate to check my sources manually for every call that might not have existed in 2.2.1.
See my question.
However, I think this is a bad situation that Apple has created for us. There really is no way to test against 2.x.x, if you, like me, have no iPhone 2.2s to test against. I actually bought a new 3Gs just so I could use the old 3G for testing. Stupidly though, when iTunes came up one day and asked if I wanted my phone updated to 3.0.1, I said yes, without realizing which phone I was updating.
I have tried, to no avail, to downgrade to 2.2.1, doing all the things like holding the home button and power for 10 seconds, etc., but I keep getting a baseband loading error.
I know Apple is trying hard to push everyone to 3.0, but not having the stats on how many users are still on the older OS, it seems prudent to keep supporting that OS. They should at least have kept 2.2.x support for the Simulator. I hate to release a 2.2.1 app based on whether I think I am using 3.0 calls or not, without actually testing it on 2.2.1.
OK, SDK 3.1 was released yesterday (September 9) and also contains SDK 2.2.1. You cannot build for the Simulator, only for the device, but most of the glaring 3.0-isms will appear as compile errors, which makes testing much easier.
Uninstall the SDK or Developer folder completley.
using Terminal execute: /Library/uninstall-devtools --mode=all, then restart, re-install new SDK.