Removing iOS SDKs from OSX - iphone

This isn't a programming question but it's about the SDKs and the IDE. I've accumulated a ton of different XCode installs over the past couple of years and now my hard drive is nearly full. With each SDK clocking in at around 5 gigs, and my storage space getting low, I have a couple of questions
3 Questions:
Can I remove old ones?
Where are they stored?
Does the newest SDK overwrite base classes from previous SDKs? (Does NSString.h now reside in two different SDKs or will the newest one take precedence?
What about beta 1, beta 2, beta 3 SDK versions? Does installing the GM/official eliminate the beta version from my Mac?
Most importantly, Can I still target 3.0 if I install the 4.2 SDK? (I understand the difference between base SDK and target SDK)
I want to clean my hard drive and I have about 18 GB remaining on a 160 GB drive. I'd like to just start over and reinstall OSX, download a fresh SDK, but I still have apps that are targeted to 3.1.2 and I don't want to be forced to only support 4.0.
Thank you

Can I remove old ones?
Sure.
Where are they stored?
/Developer/Platforms/iPhone*/Developer/SDKs/ usually.
Does the newest SDK overwrite base classes from previous SDKs? (Does NSString.h now reside in two different SDKs or will the newest one take precedence?
No, you're fine to delete them. Each SDK is self contained.
What about beta 1, beta 2, beta 3 SDK versions? Does installing the GM/official eliminate the beta version from my Mac?
Sometimes, you can choose to reinstall them though
Most importantly, Can I still target 3.0 if I install the 4.2 SDK? (I understand the difference between base SDK and target SDK)
Yes

As of May 2016:
Where are they stored?
/Library/Developer/CoreSimulator/Profiles/Runtimes
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/CoreSimulator/Profiles/Runtimes

You can choose to install Xcode in a different directory rather than have it overwrite your current version. See Can I have multiple Xcode versions installed? for details. Each installation stands on its own. Just be sure you know which one you're launching when opening your project.

Related

xcode 11 xcode 10 compatibility

I have several projects developed in Xcode 10, but now Apple is saying (April 2020) that will not accept apps developed in Xcode 10, only Xcode 11. Is there any compatibility problem ? All my projects will compile properly in Xcode 11 ?
Is there any compatibility problem ? All my projects will compile properly in Xcode 11 ?
Try it and see? You don't really have a choice in the matter if Apple is going to stop accepting your Xcode 10 apps, so you might as well get started.
You can have multiple versions of Xcode installed at the same time. The best plan is to download Xcode from the developer site instead of the App Store, and rename each one with its version (e.g. Xcode-10.1, Xcode 11.4, etc.) so that they can all exist in your /Applications folder at the same time.
Xcode 11 will happily open your Xcode 10 projects, and everything should be fine. You may need to update some project settings to whatever Xcode 11 recommends, and your code will probably benefit from updates for the latest macOS or iOS versions.
What Apple will require is that apps be built with the latest versions of their platform's SDKs in order to be submitted and approved to be distributed through the App Store. They have extended the deadline for this to June 30, 2020 at the time I'm writing this (as you can see here).
This means that you need to make sure your project can be built using the latest SDK major versions. Make sure to open and build your projects using Xcode 11, which has the latests SDKs embedded in it. If your project fails to build, it can usually be because of 2 things:
The new SDKs API have changed and code that you wrote a while back might now be invalid. Go through the issues found by Xcode and update your code to make it work with the latest API.
The Swift language itself might have changed and code that you wrote a while back might now be invalid. These type of issues can be avoided by setting a specific Swift version to be used on your project in its build settings. Migrating your codebase to the latest Swift version (the one that's bundled with Xcode) might not be mandatory, but I'd recommend you do it if it involves just minor changes.
if after doing this, your project can be built, you should be good to go.

iOS beta releases, separate from current stable development?

I remember reading something once, but could not find it now while searching, if there are things I need to worry about when installing an iOS beta.
If I install the iOS 6 beta, do I need to worry about it overwriting my current Xcode 4.2 (iOS 5.1) development? Or does it install it in a separate location automatically? Or is that all I need to do, in that I need to put it in a separate location when installing instead of the default location?
If I put a device on iOS 6 beta, it cannot be downgraded back to 5.1 right?
Are those the only things I need to worry about? Thanks!
As Apple states in the Xcode 4.5 Developer Preview Release Notes[1]: Xcode 4.5 comes as a single app bundle that can simply be dragged to the Applications folder. You can start it from there and it will not install or overwrite any existing developer tools like previous Xcode versions.
Apple states that
Devices updated to iOS 6 beta can not be restored to earlier versions of iOS. Registered development devices will be able to upgrade to future beta releases and the final iOS 6 software.
But you may be able to downgrade your iOS device as long as version 5.1 is the official version served by apple by putting your device in the DFU mode. When Apple pushes iOS 6 for everyone you may be able to downgrade your device with TinyUmbrella[2]. This worked with previous versions but there is no guarantee it will work this time.
[1] http://adcdownload.apple.com//Developer_Tools/xcode_4.5_developer_preview/xcode_45dp_rn.pdf (an iOS Developer account may be needed to view this file)
[2] http://thefirmwareumbrella.blogspot.com/
I know that an iOS device running beta cannot be downgraded per the iOS Dev Center:
Devices updated to iOS 6 beta can not be restored to earlier versions of iOS. Registered development devices will be able to upgrade to future beta releases and the final iOS 6 software.
And yes, I believe you can install multiple versions of Xcode at a time, including betas. The installer should ask you where to put it.
There's nothing else you need to worry about, but if you put the beta iOS software on your device, make sure you use a device dedicated to development or back up everything.
This is creeping on NDA territory, but in general:
Beta versions of Xcode cannot be used to submit apps to the App Store.
Sometimes you can install two copies of dev tools on the same machine. In the past it hasn't always worked properly; now that all of Xcode is contained in the app bundle, maybe it will work more smoothly.
The safest thing to do is get an external hard disk, install Mac OS X on it, and then boot from it and install the beta tools on it. Then you can safely play around without messing up the release version.

Switch between Xcode 4.0.2 and 4.2

I am developing an app with Xcode 4.0.2 and iOS 4.3. Now I would like to upgrade to Xcode 4.2 and iOS 5 so that I could make my app ready when iOS 5 releases in October.
I am told by Apple's website that I should not submit apps that are built by Xcode 4.2 and should do it with the older Xcode 4.0.2, since the Xcode 4.2 and iOS 5 thing is still in beta.
But in the following few weeks I still need to have newer versions of my app submitted to App Store. So my question is,
If I upgrade my Xcode to 4.2, is it possible for me to switch back to Xcode 4.0.2?
If yes, how?
Thanks in advance!
You can simply install two versions of Xcode at the same time. During the installation it will let you choose the destination folder; you can pick another folder. For example, I use /Developer/Xcode (4.2). (However, if you did install 4.2 over 4.0.2, I don't think you would have a problem if you just ran the 4.0.2 installer again to downgrade.)
Taken from About Xcode.pdf (<Xcode>/About\ Xcode.pdf)
Installation
The Xcode installer will create the folder /Developer on the root of your boot partition, and place the Xcode developer tools and SDKs in this folder. If you have a previous version of Xcode you would like to preserve, you can copy the existing installation from /Developer to another folder to prevent having it updated automatically by the installer.
I would be cautious of this note (possible problems from incompatibility of tools???)
NOTE: The Xcode installer also installs system components and UNIX command line tools in a shared location on your Mac. Only one version of these components can exist on a computer at a time, and the last installed version replaces any previously installed set.
I always make sure I have a bootable drive with a decent working copy of xcode ready for releases in case I need to push a quick fix.
You can install 2 XCode in different folders.
Then you can switch back and forth.
Can I have multiple Xcode versions installed?

install iphone sdks side by side

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.

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