install Iphone SDK 4.0 on top of 4.2 - xcode

There is a nasty bug in IOS 4.2 having to do with the tint color of the navigation bar in a split view controller.
I have the 4.2 sdk on my mac, is there a way to install 4.0 on top of it and have them both work?

The relevant SDKs live in:
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs, and
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs
In the past I've been able to keep an SDK from a previous version by simply copying the relevant folder forwards. Xcode simply spotted the old SDK and continued offering it as a Base SDK. So you'd need to install the old SDK somewhere, keep hold of the relevant iPhoneOS4.0.sdk and iPhoneSimulator4.0.sdk folders, install the new SDK and then copy the backed up folders in. If you use Time Machine, you may even be able to grab them directly from there.
However, I believe this to be an unsupported way of proceeding, so it's not necessarily guaranteed to work. And all the usual warnings about doing anything Apple don't support apply.

Related

When I attached my device to the xcode and try to build my project it's generating error

Could not locate device support files.
This iPhone 5s (Model A1457, A1518, A1528, A1530) is running iOS 10.3.1 (14E304), which may not be supported by this version of Xcode.
You need to update Xcode whenever the iOS version you want to work with is higher than the highest version that Xcode's simulator has installed. This can be done one of two ways. The simplest is to use the App Store to download/update Xcode. If the App Store doesn't show any updates, you must manually download the latest Xcode build from https://developer.apple.com/.
You will need to manually download from the Developer portal when the version of Xcode on your computer was downloaded there previously. For example, many beta testers may download the file directly instead of using the Mac App Store, since it is a beta download.
I would recommend trying to keep updates done through the App Store by downloading Xcode from there initially. The benefit to this is that it can automatically update as well as save space on your computer (Xcode is a big file, and you may not have enough space to download a new version if you still have the old version).
As of the comments, I will now write an answer. :-)
Whenever you encounter this error there might be two reasons for that:
The OS version is too old
The iPhone's/iPad's OS is too new for your Xcode version
If it is too old, you may need to download older SDKs and OS versions.
You can do so in Xcode. Go to "Preferences" -> "Components" and download the appropriate Simulator.
If the devices OS is up to date, you have to make sure your Xcode is also up to date.
Either you update Xcode through the AppStore OR (and I prefer this way, as the AppStore is used to hang up in a certain state and cannot be completed any longer until you restart the Mac, at least I had this several times).
Side note: Xcode requires multiple GB of free storage. Make sure you have enough free storage left for an update.
You can download the latest Xcode version from the https://developer.apple.com portal:
Go to Downloads:
And then select the item of interest (in your case Xcode)

Problems with Xcode 7.2.1

just install the new version of Xcode (7.2.1), he took a little longer than expected.
But when it finished and run the xcode continues with version 7.1.1
I thought it would be solved by restarting the Mac, but no.
Any idea what can be spent? or happened to me to be done?
!EDITED!
My MAC version.
My xcode options
My applications
I had exactly the same problem. I installed 4GB large 7.2.1 version of Xcode from the AppStore over an existing 7.2 version, and whichever way I was launching Xcode it was always the same old 7.2 popping up. What was worse I could not download 7.2.1 again, as AppStore app was not showing Install button anymore, but rather Launch button instead (like it was installed).
Finally I found a solution. I went to Downloads for Apple Developers site (a login to a developer account was required), I dowloaded Xcode_7.2.1.dmg 4.7GB large from there, launched an installation... which successfully replaced the older 7.2 version of Xcode.
Another answer suggests installing Xcode via a Developer Member Center download. I'd like to caution against this, and suggest an alternative approach.
Shortly before Xcode 7 became available, I upgraded an Xcode 6 installation to 6.4 by using the download. I did this to save download time for upgrading multiple machines (I put the installer on a flash drive). I subsequently discovered that using the downloaded installer broke tracking the version history in the App Store, and I was no longer able to upgrade via the App Store. Also, I was no longer notified of pending Xcode updates via the MAS "Updates" panel.
So a possible consequence for you may be that the App Store may not be able to handle your future Xcode updates, or even notify you when an update is pending.
What I ended up doing was deleting my then-current Xcode installation (I used AppDelete to get all of the components of the installation), and starting from scratch using the App Store. I recommend doing the same. Probably the best way to start is to try deleting Xcode via Launchpad. But if that doesn't work (say, it doesn't delete all versions if you still have multiple versions), try AppDelete or a similar app.
I should note that one reason I used the download to upgrade Xcode 6 was that I'd done so previously without breaking the App Store's ability to track Xcode's version history. Whether that previous behavior was a fluke, or whether the later behavior (losing the version history) was a fluke, I can't say.
If you've already installed via the Member Center installer, you can check to see if you'll have this problem by looking up Xcode in MAS. If the store shows you have the version you manually installed, then all is well (probably!). If not, either you'll have to keep track of updates by yourself, or you should re-establish MAS version tracking by deleting Xcode and starting from scratch via MAS. I'd be interested to learn whether the store is tracking your manual installation.

How do I download and install just the iOS SDK? [duplicate]

Silly question - Is there a way to download the iPhone SDK without Xcode when Apple releases an update?
As far as I understand you cannot download the SDK separately - and even if you could, I wouldn't recommend it. Using the bundled SDK+Xcode release is the best idea in my opinion, as it will be working for you out of the box. I know it's annoying having to download such a large amount of data for an SDK (not all of us have 100mbps pipes to play with!) but for ease of development, it's the way I'd recommend you go.
For those who have installed Xcode but do not have the iOS SDK, here is the way to download it without re-downloading Xcode:
Got to
Xcode > Preferences > Downloads
and select whatever you want to install.
Yes, contrary to what others say this is somewhat possible.
Method One
With this method you can download any iOS or OSX SDK and install it to XCode.
Download the desired SDK, bundled with XCode, from developer.apple.com/downloads
Once the package is done downloading mount the disk image. Right on the XCode application in the image and click on Show Package Contents. Navigate to:
/Contents/Developer/Platforms/
the iOS SDKs are in:
iPhoneOS.platform/Developer/SDKs/
the OSX SDKs are in:
MacOSX.platform/Developer/SDKs/
and the iOS simulator SDKs are in:
iPhoneSimulator.platform/Developer/SDKs/
To install one of the SDKs simply find XCode.app and place the SDK in the appropriate folder of the XCode.app package.
Method Two
With this method you can only dowload iOS simulators and iOS simulator SDKs.
Open XCode and in the menu bar click on XCode > Preferences. In the preferences dialog select the downloads tab and select the simulators you would like to dowload.
Unfortunately, no. Apple only provides the SDK as a bundled package.
They quite often include fixes and updates in the bundled version of xcode. I guess this is a good way for them to "force" people to use the latest point release of xcode.
The answer to the question being asked is, I think, that it is not possible. However, there is a highly related question (with a more interesting answer), how to use different/nonresident iOS SDKs with a particular version of Xcode? This does require downloading some other Xcode (to gain access to some other iOS SDK).
This issue has been a passion of mine for approximately the last 10 years, since I enjoy the stability of (or, at least, predictability of known misbehaviors in) a familiar IDE (i.e. Xcode) version. I last investigated the solution to this issue 3 years ago, and it was slightly more involved than the solution from 5 or so years before that. Here are my notes, from 2017:
SDK
What the development environment treats as the target device, e.g. compilation, IDE behaviors like displaying interface definitions/headers and code completion).
The "Base SDK" (in the "Build Settings" of a target in a project, which is possibly contained by a workspace) setting defaults to "Latest iOS", which resolves to a specific iOS version based on the contents of the Xcode app package directory
<app-package>/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
A version of the Xcode application will ship (via Mac App Store or a disk image from developer.apple.com) with only one SDK. The above path will contain a directory named iPhoneOS.sdk and an alias (symbolic link) targeting this directory that is named according to the SDK version (iPhoneOS10.0.sdk -> iPhoneOS.sdk)
No application-provided means (i.e. preference of other UI affordance) for altering this characteristic.
While the plural form of the directory name (SDKs) seems like a vexing/mocking choice, you can modify the contents of this intra-app-package directory to include symbolic links to SDKs contained in other versions of Xcode.
This appears to only work in the forward direction, i.e. using a newer SDK in an older Xcode (e.g. iOS 10 SDK in Xcode 7). This direction has always met my historical needs. Only recently have I attempted to go backwards (make a newer Xcode use an older SDK, e.g. iOS 8.4 SDK in Xcode 7), and I discovered that recent Xcode installs (versions 8.0 and 7.3.1 on a 10.11.6 system) ignore symbolic links to older SDKs (i.e. they do not appear in a target's Base SDK popup menu – screen shot of Xcode 7.3.1 ignoring the iOS 8.4 SDK symlink).
UPDATE (new details): I double-checked my home machine (which I had used for additional multi-SDK experiments) and found that older SDKs do appear in the Base SDK popup. Mysterious! This is a 10.10.5 system, running Xcode 7.2.1 (which ships with iOS 9.2 SDK), editing a different (non-iovation) Xcode project, and the iOS 8.2 SDK (from Xcode 6.2) will display in the popup. Obviously, there are numerous differences between the setup, and I have no idea which variables cause the difference in behavior.
MYSTERY SOLVED: Recent Xcode installs (the aforementioned versions 8.0 and 7.3.1) include a MinimumSDKVersion key in the …/iPhoneOS.platform/Info.plist file. This key appears to be set to the SDK that ships with Xcode (i.e. inside the app package), and, consequently, blocks Xcode from recognizing older SDKs. I was first keyed onto this minimum-version mechanism from the xcodebuild command-line tool, which was printing out, "Skipped SDK <sdk-path>; its version (8.4) is below required minimum (10.0) for the iphoneos platform."
Editing MinimumSDKVersion plist key (e.g. making it 8.0) allows for the display and selection of older SDKs!
The fact that Apple rigidly binds SDK version to Xcode version has always bothered me. Oftentimes, I would prefer to add an SDK to an existing Xcode install, rather than updating the entire Xcode environment simply to gain support for a new version of iOS. Admittedly, bringing everything along in lock-step fashion (app, tools, device and OS support) does seem like it should simplify support issues for Apple, and, perhaps, they believe this conjoined progression also simplifies things for 3rd party devs (no options to fret over, just update the app).

Xcode: must re-download all of Xcode to get iOS SDK? [duplicate]

Silly question - Is there a way to download the iPhone SDK without Xcode when Apple releases an update?
As far as I understand you cannot download the SDK separately - and even if you could, I wouldn't recommend it. Using the bundled SDK+Xcode release is the best idea in my opinion, as it will be working for you out of the box. I know it's annoying having to download such a large amount of data for an SDK (not all of us have 100mbps pipes to play with!) but for ease of development, it's the way I'd recommend you go.
For those who have installed Xcode but do not have the iOS SDK, here is the way to download it without re-downloading Xcode:
Got to
Xcode > Preferences > Downloads
and select whatever you want to install.
Yes, contrary to what others say this is somewhat possible.
Method One
With this method you can download any iOS or OSX SDK and install it to XCode.
Download the desired SDK, bundled with XCode, from developer.apple.com/downloads
Once the package is done downloading mount the disk image. Right on the XCode application in the image and click on Show Package Contents. Navigate to:
/Contents/Developer/Platforms/
the iOS SDKs are in:
iPhoneOS.platform/Developer/SDKs/
the OSX SDKs are in:
MacOSX.platform/Developer/SDKs/
and the iOS simulator SDKs are in:
iPhoneSimulator.platform/Developer/SDKs/
To install one of the SDKs simply find XCode.app and place the SDK in the appropriate folder of the XCode.app package.
Method Two
With this method you can only dowload iOS simulators and iOS simulator SDKs.
Open XCode and in the menu bar click on XCode > Preferences. In the preferences dialog select the downloads tab and select the simulators you would like to dowload.
Unfortunately, no. Apple only provides the SDK as a bundled package.
They quite often include fixes and updates in the bundled version of xcode. I guess this is a good way for them to "force" people to use the latest point release of xcode.
The answer to the question being asked is, I think, that it is not possible. However, there is a highly related question (with a more interesting answer), how to use different/nonresident iOS SDKs with a particular version of Xcode? This does require downloading some other Xcode (to gain access to some other iOS SDK).
This issue has been a passion of mine for approximately the last 10 years, since I enjoy the stability of (or, at least, predictability of known misbehaviors in) a familiar IDE (i.e. Xcode) version. I last investigated the solution to this issue 3 years ago, and it was slightly more involved than the solution from 5 or so years before that. Here are my notes, from 2017:
SDK
What the development environment treats as the target device, e.g. compilation, IDE behaviors like displaying interface definitions/headers and code completion).
The "Base SDK" (in the "Build Settings" of a target in a project, which is possibly contained by a workspace) setting defaults to "Latest iOS", which resolves to a specific iOS version based on the contents of the Xcode app package directory
<app-package>/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
A version of the Xcode application will ship (via Mac App Store or a disk image from developer.apple.com) with only one SDK. The above path will contain a directory named iPhoneOS.sdk and an alias (symbolic link) targeting this directory that is named according to the SDK version (iPhoneOS10.0.sdk -> iPhoneOS.sdk)
No application-provided means (i.e. preference of other UI affordance) for altering this characteristic.
While the plural form of the directory name (SDKs) seems like a vexing/mocking choice, you can modify the contents of this intra-app-package directory to include symbolic links to SDKs contained in other versions of Xcode.
This appears to only work in the forward direction, i.e. using a newer SDK in an older Xcode (e.g. iOS 10 SDK in Xcode 7). This direction has always met my historical needs. Only recently have I attempted to go backwards (make a newer Xcode use an older SDK, e.g. iOS 8.4 SDK in Xcode 7), and I discovered that recent Xcode installs (versions 8.0 and 7.3.1 on a 10.11.6 system) ignore symbolic links to older SDKs (i.e. they do not appear in a target's Base SDK popup menu – screen shot of Xcode 7.3.1 ignoring the iOS 8.4 SDK symlink).
UPDATE (new details): I double-checked my home machine (which I had used for additional multi-SDK experiments) and found that older SDKs do appear in the Base SDK popup. Mysterious! This is a 10.10.5 system, running Xcode 7.2.1 (which ships with iOS 9.2 SDK), editing a different (non-iovation) Xcode project, and the iOS 8.2 SDK (from Xcode 6.2) will display in the popup. Obviously, there are numerous differences between the setup, and I have no idea which variables cause the difference in behavior.
MYSTERY SOLVED: Recent Xcode installs (the aforementioned versions 8.0 and 7.3.1) include a MinimumSDKVersion key in the …/iPhoneOS.platform/Info.plist file. This key appears to be set to the SDK that ships with Xcode (i.e. inside the app package), and, consequently, blocks Xcode from recognizing older SDKs. I was first keyed onto this minimum-version mechanism from the xcodebuild command-line tool, which was printing out, "Skipped SDK <sdk-path>; its version (8.4) is below required minimum (10.0) for the iphoneos platform."
Editing MinimumSDKVersion plist key (e.g. making it 8.0) allows for the display and selection of older SDKs!
The fact that Apple rigidly binds SDK version to Xcode version has always bothered me. Oftentimes, I would prefer to add an SDK to an existing Xcode install, rather than updating the entire Xcode environment simply to gain support for a new version of iOS. Admittedly, bringing everything along in lock-step fashion (app, tools, device and OS support) does seem like it should simplify support issues for Apple, and, perhaps, they believe this conjoined progression also simplifies things for 3rd party devs (no options to fret over, just update the app).

How to update iPhone SDK without having to re-download Xcode?

Silly question - Is there a way to download the iPhone SDK without Xcode when Apple releases an update?
As far as I understand you cannot download the SDK separately - and even if you could, I wouldn't recommend it. Using the bundled SDK+Xcode release is the best idea in my opinion, as it will be working for you out of the box. I know it's annoying having to download such a large amount of data for an SDK (not all of us have 100mbps pipes to play with!) but for ease of development, it's the way I'd recommend you go.
For those who have installed Xcode but do not have the iOS SDK, here is the way to download it without re-downloading Xcode:
Got to
Xcode > Preferences > Downloads
and select whatever you want to install.
Yes, contrary to what others say this is somewhat possible.
Method One
With this method you can download any iOS or OSX SDK and install it to XCode.
Download the desired SDK, bundled with XCode, from developer.apple.com/downloads
Once the package is done downloading mount the disk image. Right on the XCode application in the image and click on Show Package Contents. Navigate to:
/Contents/Developer/Platforms/
the iOS SDKs are in:
iPhoneOS.platform/Developer/SDKs/
the OSX SDKs are in:
MacOSX.platform/Developer/SDKs/
and the iOS simulator SDKs are in:
iPhoneSimulator.platform/Developer/SDKs/
To install one of the SDKs simply find XCode.app and place the SDK in the appropriate folder of the XCode.app package.
Method Two
With this method you can only dowload iOS simulators and iOS simulator SDKs.
Open XCode and in the menu bar click on XCode > Preferences. In the preferences dialog select the downloads tab and select the simulators you would like to dowload.
Unfortunately, no. Apple only provides the SDK as a bundled package.
They quite often include fixes and updates in the bundled version of xcode. I guess this is a good way for them to "force" people to use the latest point release of xcode.
The answer to the question being asked is, I think, that it is not possible. However, there is a highly related question (with a more interesting answer), how to use different/nonresident iOS SDKs with a particular version of Xcode? This does require downloading some other Xcode (to gain access to some other iOS SDK).
This issue has been a passion of mine for approximately the last 10 years, since I enjoy the stability of (or, at least, predictability of known misbehaviors in) a familiar IDE (i.e. Xcode) version. I last investigated the solution to this issue 3 years ago, and it was slightly more involved than the solution from 5 or so years before that. Here are my notes, from 2017:
SDK
What the development environment treats as the target device, e.g. compilation, IDE behaviors like displaying interface definitions/headers and code completion).
The "Base SDK" (in the "Build Settings" of a target in a project, which is possibly contained by a workspace) setting defaults to "Latest iOS", which resolves to a specific iOS version based on the contents of the Xcode app package directory
<app-package>/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
A version of the Xcode application will ship (via Mac App Store or a disk image from developer.apple.com) with only one SDK. The above path will contain a directory named iPhoneOS.sdk and an alias (symbolic link) targeting this directory that is named according to the SDK version (iPhoneOS10.0.sdk -> iPhoneOS.sdk)
No application-provided means (i.e. preference of other UI affordance) for altering this characteristic.
While the plural form of the directory name (SDKs) seems like a vexing/mocking choice, you can modify the contents of this intra-app-package directory to include symbolic links to SDKs contained in other versions of Xcode.
This appears to only work in the forward direction, i.e. using a newer SDK in an older Xcode (e.g. iOS 10 SDK in Xcode 7). This direction has always met my historical needs. Only recently have I attempted to go backwards (make a newer Xcode use an older SDK, e.g. iOS 8.4 SDK in Xcode 7), and I discovered that recent Xcode installs (versions 8.0 and 7.3.1 on a 10.11.6 system) ignore symbolic links to older SDKs (i.e. they do not appear in a target's Base SDK popup menu – screen shot of Xcode 7.3.1 ignoring the iOS 8.4 SDK symlink).
UPDATE (new details): I double-checked my home machine (which I had used for additional multi-SDK experiments) and found that older SDKs do appear in the Base SDK popup. Mysterious! This is a 10.10.5 system, running Xcode 7.2.1 (which ships with iOS 9.2 SDK), editing a different (non-iovation) Xcode project, and the iOS 8.2 SDK (from Xcode 6.2) will display in the popup. Obviously, there are numerous differences between the setup, and I have no idea which variables cause the difference in behavior.
MYSTERY SOLVED: Recent Xcode installs (the aforementioned versions 8.0 and 7.3.1) include a MinimumSDKVersion key in the …/iPhoneOS.platform/Info.plist file. This key appears to be set to the SDK that ships with Xcode (i.e. inside the app package), and, consequently, blocks Xcode from recognizing older SDKs. I was first keyed onto this minimum-version mechanism from the xcodebuild command-line tool, which was printing out, "Skipped SDK <sdk-path>; its version (8.4) is below required minimum (10.0) for the iphoneos platform."
Editing MinimumSDKVersion plist key (e.g. making it 8.0) allows for the display and selection of older SDKs!
The fact that Apple rigidly binds SDK version to Xcode version has always bothered me. Oftentimes, I would prefer to add an SDK to an existing Xcode install, rather than updating the entire Xcode environment simply to gain support for a new version of iOS. Admittedly, bringing everything along in lock-step fashion (app, tools, device and OS support) does seem like it should simplify support issues for Apple, and, perhaps, they believe this conjoined progression also simplifies things for 3rd party devs (no options to fret over, just update the app).

Resources