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.
Related
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!
I am a little curious what happens in the following situation. You have an existing app on the iTunes store (with customers) that uses iOS4, you then release an update to the app that uses a newer iOS.
folks that have upgraded to the "newer iOS" will get the update.
What will happen to those that have not updated, will they still be able to use their old iOS4 version?
Your "deployment target" is what matters. Setting the deployment target allows your app to set it's minimum required OS version. Many developers like to set that as far back as possible, unless your app depends on a features only available in a new iOS version.
Lets say you have an app compiled with the iOS 4 SDK and set 3.0 as the deployment target.
Users with iOS 3 or iOS 4 (and iOS 5) can download your app and use it.
Now you release an update compiled with the iOS 5 SDK and set 4.0 as your deployment target.
Users with iOS 4 or iOS 5 can download or upgrade your app and use it.
Users with iOS 3 that have purchased your app already cannot upgrade, but they can continue to use their existing installed version.
Users with iOS 3 that have not purchased your app yet will now have no way to do so.
Apple will only keep exactly one version of your app on the app store.
Unless they download the newer version, they will of course still be able to use the old one. It's possible however that they download the update unintentionally via iTunes on the desktop. The App Store on the device itself would check if the device's OS version is compatible with the app being downloaded, but iTunes does not, so it would replace the old version in the iTunes library, leading to the app being removed from the device when the user syncs it (because the downloaded version cannot be installed).
So, for existing apps, you should keep your deployment target as low as possible and decide at runtime which additional features of a new OS version you can use. This way, you can keep compatibility with older OS versions, but still provide additional features to those who have upgraded.
Usually (although not always), new OSes are the same as the previous ones but with new features. Older versions of apps often work with the latest OS but don't take advantage of the new features. The only problem users usually have is crash problems but it all depends on which APIs you use in your app.
Additionally, updates are never 'forced' upon a user - they are always optional. When it is a case that the app only works on a version of iOS which is higher than what the user has, then the update will not be offered to the user at all. They will still be able to use the older version that they have installed on their device. Apps have no expiry date.
If you want to retain compatibility for as many iOS versions as possible, you can set your iOS deployment target to the minimum OS you want your app to be compatible on. The SDK version number should not matter, but to support the latest iOS features, you would need the latest iOS SDK.
You will still have to check your APIs compatibility with the version you are targeting as a minimum OS. Look here and search for "API Diffs". Each document lists changes to the API for that iOS version. This will lists new and removed APIs as of that version. For example, UIPrintPaper, which is listed in the iOS 4.1 to 4.2 API diffs document, is a new API to iOS 4.2. So, when running on iOS 4.1 or earlier, the app will crash when calling that API. Using #if __IPHONE_OS_VERSION_MAX_ALLOWED <= __IPHONE_4_1 around your UIPrintPaper snipper will fix that problem.
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.
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.
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.