iOS4 SDK target to iOS3 device - ios

In previous version of iOS SDK, if I install a newer version of SDK, I can't target a previous version. For example, when I installed SDK 3, i can't target iOS 2 or before.
Now I want to install a new version (xcode_4.0.2_and_ios_sdk_4.3.dmg) to develop to iOS 3.2 and iOS 4.
If I install this new version, can I target to previous iOS 3?

You can specify deployment target in your project's properties. For example if you choose iOS 3.0 as deployment target the app will run on iOS 3 even if it is built with SDK 4.0 (of course it's true only if you don't use 4.0 specific features).

No. Install at Different location so that, if you want to develop applications supporting lower version you can use that older version SDK. However you can change Base SDK version of older version developed apps and can run applications on Newer version Xcode SDK.

Related

iOS deployment target change from one version to the next

I know you can change the deployment target when you build the app. Let's say I have version 1.0 of the app built with deployment target set to 6.0. If I now release version 1.1 and set deployment target to 7.0, the question is what happens to owners of iOS 6 devices running version 1.0 if they connect to itunes and sync? Will their 1.0 version be deleted or is it that they simply will not see version 1.1 available?
They will not be able to download and install version 1.1 unless they upgrade to iOS7. They will not lose version 1.0, that will remain on their device.
Users with older iOS version (in your case 6.0) will be able to continue downloading version 1.0 even after 1.1 has been released.
See the article below for more details:
App Resurection

App with deployment target of 4.0 won't install on "too old" 4.0.1 device

I have an app where the deployment target is set at iOS 4.0, yet trying to run it on a 4.0.1 device results in this:
"The version of iOS on XXX is too old for use with this version of the iOS SKD"
As the installed OS version of 4.0.1 is > than the deployment target why does it say the OS is too old.
(The app will sucesfully install/run on other devices that has 4.3, 5.n, 6.n installed)
In Xcode 4.5 (with support for the iPhone 5 / armv7s), you can only support iOS 4.3 as the lowest possible deployment target.

ios deployment target vs Base SDK

I have my Base SDK set to 5.1 and the Deployment Target set to 3.0, when I try to install the app it still says it requires a newer software version. The iPhone I'm testing with has 3.0. Should I try to back down the SDK version?

Adding Older iOS SDKs to Xcode 4.1 in Lion

I just installed Lion and Xcode 4.1. How do I add older SDKs so I can build and run in 4.1 or 4.2 in iPhone/iPad Simulator? Xcode 4.1 only comes with the iOS 4.3 SDK.
Does Lion have some sort of minimum SDK for builds?
Thanks,
Actually it is possible to add older SDKs as long as you can still get your hands on an older version of Xcode with the older SDK. It's useful too sometimes: when you do this you get to find out about unsupported constants and methods you may be using during compile rather than at runtime. Here's how to do it.
Get hold of an older version of Xcode with the older SDK. The Apple iOS Dev Center currently lists the 4.3 SDK with the Xcode 3.2.6 download.
Mount the dmg and open up the Packages folder hidden within the dmg via Terminal:
open /Volumes/Xcode\ and\ iOS\ SDK/Packages/
Double click the pkg file for the SDK version you want. I was looking for iPhoneSDK4_3.pkg but, in addition to 4.3, found packages as old as iPhoneSDK3_0.pkg. So perhaps older SDKs may still be packaged with the App Store download if you know where to find it (I didn't).
Let it install in it's own folder of choice since you won't be able to force it to install in Applications/Xcode.app/Contents/Developer (which is where the Developer folder is now)
You'll find the package installed in the Platforms folder in the volume you chose. Move the relevant SDK over to the Developer folder within Xcode.app. You'll likely have to use sudo:
sudo mv /Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
Restart Xcode and you should see the new (old) SDK listed in your options for Base SDK. Yay!
Update as of 12 Sep 2013
If the "older SDK" you're trying to add comes bundled in Xcode 4.3 or later, adding the SDK is as simple as downloading Xcode from dev center link that says "Looking for an older version of Xcode?" (currently points here), mounting the dmg, then copying the relevant files over.
In terminal, you'd do something like this (edit for the appropriate SDK version number):
cp -R /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
For SDKs from versions of Xcode prior to 4.3, the older steps are still relevant.
I found this happens to work for getting the Xcode 5 GM to compile builds that carry the old iOS 6 UI even when deployed on iOS 7 devices. Useful for fixing bugs pending a UI redesign. That said, there's got to be an easier way to get the iOS 6 UI on an iOS 7 device.
You can't. What you can do, however, is click on the top-level entry in the File Navigator. It'll take you to the application settings. Go to the tab called Build Settings, and change the iOS Deployment Target to whatever version of iOS you'd like to support from (the earliest version you support).
See "To Edit a Build Setting…": http://developer.apple.com/library/ios/documentation/ToolsLanguages/Conceptual/Xcode4UserGuide/Building/Building.html#//apple_ref/doc/uid/TP40010215-CH9-SW5
Open Xcode and open Preferences (Xcode -> Preferences menu). Click the Downloads icon and look in the Components tab. All versions from 3.0 to 5.1 should be available. Just click Install for the ones you want to use.
None of these answers worked for me for Mac OS 10.8 and XCode 4.5. But now that things are installed under the Applications folder, it's much easier to manage.
Option #1: Keeping an older copy of XCode is easy to do by renaming it before you install the new one. Then you can use Product->Preform Action->Run Without Building on the new version to test on newer devices or newer simulators.
Option #2: If you REALLY want to build with older SDKs in the newer XCode, then you can simply copy over an SDK using finder. You'll need to have an older version of XCode installed under Applications for this to work. In the following example, I just renamed XCode 4.4 to XCode_old before I installed XCode 4.5. Note: You can right click on the .app file and choose Show Contents to get to these files or just use the cp from a terminal window.
from: /Applications/Xcode_old.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk
to: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
Then, iOS 5.1 will show up under Build Settings as a Bask SDK. You can do the same thing for simulators:
from: /Applications/Xcode_old.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk
to: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/
You can't, but it will build fine for a device that is plugged in running an old version of iOS (what you should be conducting your proper testing on).
You have to run your application in the older version of Xcode that came coupled with the older iOS version. I have 3.2.5 installed under /Developer-3.2.5/. I have to say it's about 10 times faster than Xcode 4... You can download old versions here: http://iphonesdkdev.blogspot.com/2010/04/old-versions-of-iphone-sdk.html
I had a similar issue in Xcode 4.02 for Snow Leopard using SDK 4.3. I wanted to test on an iPhone 3G, but iOS4.2 is the latest (and correct version) for that device. In order to 'see' and run on that device in the Scheme, I had to change the Build Settings for iOS Deployment Target as described above. (btw you also have to have restrictions on the iPhone turned off to let Xcode install the app :) )
In addition to Steven's answer, you can find older versions of XCode - including the older SDKs:
Looking for an older version of Xcode?

How to include iOS SDK lower than 4.3 in Xcode 4.2

I just upgrade my Xcode to 4.2 because I upgraded my MacOS to Lion.
In this version of Xcode. only includes SDK 4.3, I can set the Deploy Target to 4.0 or other lower version, but different from old Xcode, I can't launched Simulators for lower SDKs.
I also tried download & install lower SDKs from old Xcode package, but seems it doesn't works.
So, in this situation, how I can publish app to support lower SDK devices?
THX~
Try opening XCode preferences, go to Downloads, and install the various debugging support options that are present.

Resources