install iphone sdks side by side - iphone

Im trying to get my xCode to contain all iPhone sdk's from 4 back to 2. But when I download the DMG files, it seems to only allow me to have an xCode with SDK versions 2 - 3.1 OR 3.2 - 4, not all together.
How can I install the SDK's into one xCode so I can build for all different OS versions?
Thanks
EDIT::
Ok so I know I can set the base SDK in xcode, but the options I have are only 3.2 or 4.0, I cant seem to install the 3.1 or earlier SDK's how can this be done?
Final Edit::
Ok got it solved, basically you only need to have an older version of xcode installed to get earlier simulators running, otherwise the articles given to me in my answers as well as others were very helpful:
http://www.clarkcox.com/blog/2009/06/23/sdks-and-deployment-targets/
Install xCode 3.2.3 w/ iPhone SDK 4, get "Base SDK missing", can't see other SDKs
How To Make iPhone App compatible with multiple SDK (firmware) versions
http://cocoawithlove.com/2010/07/tips-tricks-for-conditional-ios3-ios32.html (possibly the best one)

Is there any particular reason you need to do this? Are you trying to develop applications that will run on iOS 4.x and older versions (3.x)? You can still develop applications which will run on iOS 3.1.x with the iOS 4.x sdk.
Take a look at the following article: http://www.clarkcox.com/blog/2009/06/23/sdks-and-deployment-targets/

I tried the same thing some time ago, and it seems some minor SDK versions are automatically removed during the install process...
You may tried to copy them before installing the other XCode versions, and re-install them just after.
They are located in /Library/Platforms/iPhoneOS.platform/Developer/SDKs/ and /Library/Platforms/iPhoneSimulator.platform/Developer/SDKs/.
Note that you can also choose to install each XCode version in a separate directory.
You will lose a lot of hard disk space, and you'll have multiple versions of XCode, each one with different SDK versions.

Related

Installing new and old versions of Xcode

So I saw this post: http://mobiledevelopertips.com/xcode/download-and-install-older-versions-of-xcode-xcode-previous-releases.html
(new location: at iosdevelopertips.com)
about downloading older versions of Xcode. Up to now, I have always just downloaded the newest version of Xcode from the App Store and let it do its thing. Recently on one computer that has Xcode 4.5 installed on it, I noticed that if I create a new project, I only get the iOS 6.0 simulators, not the 5.0 or 5.1.
My first question is, do I need older versions of Xcode to build apps for older OS (e.g. iOS 4, iOS 5.0, 5.1, etc)?
If so, what's the best way of installing these older versions of Xcode. I see that they have the command line tools to download as well. I'm not sure how all that stuff works.
What's the best way to update to the latest Xcode but keeping the old Xcode around? On a different machine that had Xcode 4.4.1 installed, I thought I could download Xcode 4.5 from the ADC website and install it. I downloaded it, double-clicked on the .dmg, then double-clicked on the Xcode file. This then installed Xcode 4.5 without asking me where I wanted it installed so I could keep the older version of Xcode (assuming that I need it as stated in my 1st question).
Thanks!
To answer your questions:
1) Yes. I renname Xcode to add the version number (i.e. Xcode_441.app)
2) I keep an archive of all versions of Xcode that I have downloaded so they are available after Apple pulls them from their download site.
3) Renaming them works for me, and I usually grab the direct download, when available, instead of getting it from the MAS. Try renaming Xcode before doing an install.
You are welcome.
It's possible to have multiple XCode installations by customizing the install path. Also note that the new 4.x install model is app bundles under Applications which are self contained so it's possible to just rename the old before installing the new XCode. You can also download the newest (4.5) from the developer site.
You can also add the old simulators by going to XCode preferences in 4.5.
Look under XCode, preferences, downloads. XCode 4.5 offers the 5.0 and 5.1 simulators for download. The same place that you download the command line tools.
For example, I added the 5.0 Simulator to my XCode 4.5 installation to go along with the 6.0 Simulator:
I noticed that if I create a new project, I only get the iOS 6.0 simulators, not the 5.0 or 5.1.
Choose your project target and in Summary tab, set the lowest Deployment Target for your app (I think the default value is 6.0 in Xcode 4.5).
My first question is, do I need older versions of Xcode to build apps for older OS (e.g. iOS 4, iOS 5.0, 5.1, etc)?
If you've updated from old version of Xcode, you can use the old SDK & simulator in new version.
If so, what's the best way of installing these older versions of Xcode. I see that they have the command line tools to download as well. I'm not sure how all that stuff works.
Actually, different versions of Xcode can stay happily with each other. It is a App Bundle right now.
third question
Just drag the new version of Xcode to Application folder. That's done. :)

Is there a way to install older iOS SDKs in Xcode?

I'd like to ensure some backward compatibility for my apps by compiling them using the older SDKs to test for newer classes and methods. However, Xcode is only available with SDKs for the latest iOS versions.
I've downloaded and installed the iOS 3.1.3 SDK (using the method described here) and that works fine. My code is full (not so full :-) ) of __IPHONE_OS_VERSION_MAX_ALLOWED, __IPHONE_OS_VERSION_MIN_REQUIRED and such respondsToSelector.
This works right now for the iOS 3.1.3 SDK, but what if in the future I wanted to repeat this process with the 4.0 SDK? Is there a general process for installing older SDK versions in the latest Xcode?
You can't install old 3.1 SDKs on Xcode 4. You can set the Deployment target lower to allow testing on devices running older OS versions than your current SDK installation. The only current way to completely ensure backward compatibility, while running more recent versions of Xcode, is to keep a device that runs iOS 3.x, and test on that device. (...because it is claimed that the old Simulators/tools sometimes actually allows APIs that won't run on an actual device with an OS of the same version).
Other methods include installing the different versions of iOS developer tools in a separate Developer_XYZ directories, and or keeping around a bootable HD with the older iOS developer tool installation (say Snow Leopard with Xcode 3.x, since Lion might only support running Xcode 4.x).
For whatever reason (I had to do it to debug an Apple bug), if you still need to install an older SDK to your existing Xcode, follow these steps :
Install the older Xcode package
Copy the older Xcode SDK to the new Xcode
Example
(/old/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk to /new/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs)
Restart your 'new' Xcode
You will see the old SDK in the build setting option (base sdk)

XCode and recent iOS SDK

I am currently using XCode 3.2.2 and iOS SDK 3.2. With these I can produce binary which works on iPhone 3.1.3. If I upgrade to XCode 3.2.4 and iOS 4.1, would I still be able to build binaries for iPhone 3.1.3 device? If no, can I install both, or it's tricky?
Eiko is correct, what's more I believe that apple will no longer accept applications built with pre 4.x SDK.
To get this set up you need to change the following settings
Set the "Base SDK" in your projects settings to the newest version number of iOS whose features you may want.
Set the "iPhone OS Deployment Target" to the oldest version number of iOS that you will support.
Courtesy of CocoaWithLove
Regarding installing multiple versions, it's not tricky... just awkward. The release versions of XCode are installed into the /Developer directory. To install multiple versions you need to move the /Developer directory to something else e.g. /OldXCode and then install the new version (Which is put into /Developer)
Hope that helps
You can, and you should, always use the latest SDK.
You can easily build agains 4.1 and still target 3.x - in fact most developers do this at the moment.

Simulate iPhone 3.0 with SDK 4.0

i have xcode 3.1.3 and xcode 3.2.1 installed
For sure now I use 3.2.1 with Sdk 4 to develop new apps.
But what if I like to test a App compiled with sdk 4 on a
simulated iphone that would just have 3.0??
As BaseSDk i use 4.0 and as target 3.0
In xcode 3.1.3 i could select a simulator down to 2.x but with sdk 4.0
i only have the option 4.0 iphone or 3.2 ipad
Example> i know iAd is not supported before 4.0 so I set the
framework to weak. But just to be sure all works fine I really
would like to test my app in a simulator that simulates an iphone with 3.0
thx
chris
The new simulator does not seem to be able to run the old simulator OSs (3.2 being the oldest it'll run). I tried moving them over from old SDK installs and several variations and "no go".
You can check that you aren't using methods defined in the new SDK, when you set the base SDK to 4.0 but set the Deployment to to 3.1.3, for example. For a blog post on how to do this see this blog post, and note my comment on an easier way to do the last two steps (no need to edit the project file as a text file).
inside the iphone sdk dmg file, there should be a folder called packages. in it, you'll find packages like iPhoneSDK3_0 and iPhoneSimulator3_0. Install them to be able to use them in xcode.
Correct me if I'm wrong, but I think a device with 3.0 installed can't even run apps compiled with 3.2 or 4.0. Furthermore, Apple now only accepts iPhone apps (including updates of existing apps) linked against the 4.0 libraries, which won't run on OS version 3.0 devices.
So why do you want to test your app on a 3.0 device?
Try setting the architecture you want to build for in the Xcode project preferences and rebuilding.
If this doesn't work, completely uninstall Xcode and downgrade. You have to completely uninstall because your system must have updated the frameworks for 4.0.
Hope this helps

Linking against older iPhone OS in Xcode 3.2.3

I installed the new GM iPhone sdk. When I try to compile against iOS 3.0, it claims that libraries are
missing. What now? I think that I have the install DMG somewhere for 3.2.2, if that helps.
Always use the newest SDK available. There is little to be gained (and a lot you give up) by building against older SDKs. It limits both what APIs you can call and also prevents your code from taking advantage of the OS features on newer devices.
If you need to deploy on older OS versions, just set the Deployment Target to the earliest version you need to run on. You don't need its SDK.
Do the following
sudo /Developer/Library/uninstall-devtools –mode=all
(This will uninstall the current XCode installation)
Then install first old XCode (3.2 final) in default folder (/Developer)
Then install the new XCode (3.2.3 GM) in other folder (/DeveloperBeta)
This way you will have both. And can launch xcode from either /Developer/Applications/Xcode.app or /DeveloperBeta/Applications/Xcode.app
3.2.3 last beta did remove all other SDK's cause to many people tried to publish Apps developed with the beta SDK, which would not be accepted by Apple. With GM it will be the same