I know this has been discussed before, but I didn't quote understand most of the answers. As you can tell from my other questions on here, I'm a complete newbie when it comes to app creation using XCode. I only have the SDK for iOS 4.3.
A friend of mine wants my app, but he only has an iPhone 3. He has not upgraded to iOS4. I don't see any reason my app couldn't run at a lower iOS version, it's pretty simple.
So what I'd like to know is how can I add previous SDKs to my XCode library? Do I just download a previous version of XCode w/ it's SDK and install that? Will that brick XCode? If so, what then? Is there anything I can do, I'd really like this to be written with 3.x and above in mind.
The most simple and more straight forward answers without jargon will be extremely appreciated!
Thank you!
if you have the iOS 4.3 SDK, you also can target any iOS version preceding it. In your Xcode project build settings, make sure your base SDK is set to the highest you have (in this case 4.3) but change your deployment target to whatever iOS version you want (try not to go lower than 3.0).
Make sure you test it though, to be sure that you are not using any features that are not present in the SDK version you are targeting.
Each download of the iOS contains each (most) of the previous versions. They're in installer bundles in a folder on the disk image. For example in the xcode_4.0.1_and_ios_sdk_4.3.dmg, (after you have installed the main package) open the Packages folder, install the iPhoneSDK3_2.pkg, and iPhoneSimulatorSDK3_2.pkg (if needed).
Related
I do all steps from Mapbox integration tutorial (https://www.mapbox.com/install/), which BTW, doesn't work. Then I try to find some answers here. So, my problem is:
At this point I don't know why it's not working or what I am missing.
I try do new project step by step from Mapbox tutorial many times, it doesn't work. Xcode version is 8.1
Because of comment #jmkiley I did update MacOS and then Xcode and problem disappear. Maybe I did not notice the min. requirements
The tutorial (if I still see good) never writed, that you need to have specific version of Xcode. I think its support at least last version. I used Xcode version 9.+ but should work with now current version 10.+ too. Of course specific Xcode version need specific macOS version.
Error above is not very useful for get what the real problem is.
I found question, where autor use Xcode 8 but with macOS Siera so maybe is more important version of macOS than Xcode, but that is only hypotesis
I'm running into compatibility issues for some external frameworks I'm using in my project. Is there a way to change the Base SDK on Xcode 8? Currently in the project settings only show me the Latest SDK.
I've tried copying the older SDK from another version of Xcode to here but it didn't work:
/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
Starting with Xcode 7.3, in addition to copying in the SDK, you must also edit a certain Info.plist file, as described here for macOS in the post by agx. It looks like there is a similar file for iOS, at
Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Info.plist
Try changing the value of MinimumSDKVersion in there from 10.0 to whatever SDK version you want.
I've not tried this with iOS, but, using this workaround, I was just able to build a macOS target with macOS 10.6 using Xcode 8.0 (8A218a) (the "GM").
UPDATE
The hack described above stopped working for me in Xcode 9. If you want to use Xcode 9+, see my more recent answer dated Nov 22, 2017.
My original answer, although it worked with Xcode 8, for some strange reason which is not worth explaining, no longer works with Xcode 9 on a particular client's old project. So I've been using an alternative workflow which is really not too bad.
To work on this project, I open it in both the older Xcode, which can build it with the required SDK, and in a recent Xcode. I put the old Xcode window in the background and do my work in the recent Xcode. When I am ready to test changes, I do a File > Save All (⌥⌘S), then switch to the old Xcode and Build (⌘B). When the build is done, I switch back to the recent Xcode and Product > Perform Action > Run without Building (⌃⌘R). Because the dSYM file format has not changed, breakpoints work as expected.
The advantages are that no hacking of Xcode is required, and the only thing I need to remember about the old Xcode (Xcode 3 in my case) is, mercifully: ⌘B.
One little warning: In this particular project's Target, in Build Settings, it has a custom Build Products Path. This is typical of the way Mac apps were built years ago. To ensure that both of your Xcodes are working with the same product, if your old and recent Xcodes straddle the version which changed the default Build Products Path, you may need to set Build Products Path.
The workflow could probably be made even easier by scripting the xcodebuild and xcode-select command line tools, but this is good enough. With Apple's announcement at this year's WWDC about support for 32-bit Mac apps going away during the next two years, my client has some tough decisions ahead in any case.
You just have to change the "Deployment Target" settings. You basically use the latest available SDK as base SDK but select a target OS X version.
Of course it depends on why you want to use an older SDK?
So my developer developed my app in xcode 5 and i have the latest xcode version. When i tested the app on my version, a lot of features stopped working. My developer told me that it could be the different xcode versions between us. I was wondering if it is possible to fix this without changing the SDK or xcode version.
If it comes to me changing the xcode version, will i not be able to add apple's latest features to my app?
Also, when i add an SDK into the SDK folder, do i have to replace it with the current one or do i just leave both in there together?
BTW i don't know anything about programming, so i only speak noobish.
Thanks!
When parts of an application stop working after the version of Xcode is updated, the reason is almost always a change in the SDK since newer versions Xcode contain newer versions of the SDK. Additionally, stuff from older SDKs often gets deprecated and is eventually removed.
However, you should be aware that Xcode 5 is very dated nowadays and should not (and cannot) be used for developing applications for iOS 8. As a rule, when a new version of Xcode comes out, all existing code should be updated to the current version of the SDK and developers should upgrade to the latest version because it prevents issues like the ones you are describing.
You need to upgrade the code as per the latest iOS version. All the deprecated methods need to be replaced with the new ones. Also the codes that once worked with previous versions of iOS may be or may not be working with the latest version of iOS i.e iOS 8. So an upgrade to the code will be required.
I have xcode 4.2 installed which only allows me to launch a simulator for SDK 4.3 and 5.0. I would like to test on a simulator for SDK 4.0. How would I do this?
From the research I have done it seems that installing an earlier version of xcode will overwrite some of my xcode 4.2 files? I looks as if you have to start with installing the earliest version and end with the latest version. But I'm not sure.
I know there are many questions like this already, but nothing that covers exactly what I'm asking, the other examples use different version in different orders and don't seem to provide a really solid guide on achieving this.
Thanks
Download the old Xcode and extract simulator and sdk folders.
Than copy it to your xcode path.
that's all.
I have read that you can have multiple SDKs in Xcode 4 installed in the Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs directory. What was not made clear is how you can get these different SDKs. I'd at least like to test for iOS 4.0 instead of the latest iOS 4.3. Though it would be cool to test for 3.2 also. My Xcode 4 installed only with the latest 4.3 SDK in this directory. Is there a convenient way to add them?
When you install Xcode 4.0, your previous version get's renamed to something like "Developer-3.2.5". If you still have a previous version of Xcode installed you can simply do this:
cd /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs
sudo ln -s /Developer-3.2.5/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk .
sudo ln -s /Developer-3.2.5/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk .
If you don't have a previous version installed, uninstall Xcode 4.x and then install Xcode 3.2 and start progressively from there. After you install Xcode 4.x your previous version of Xcode 3.x will get renamed on disk after which you can symlink the 4.0/4.1 SDKs under Xcode 4.0. Relaunching Xcode 4.0 will give you 4.0 and 4.1 in the drop down option list.
No there is not a convenient way, unfortunately. The easiest way is to install an earlier version and then upgrade it, progressively if necessarily, to the latest version.
The XCode downloads available from http://developer.apple.com/downloads appear to contain packages going back to before 4.0. I recently hit this same issue and was able to determine that:
From 4.1 onward (Maybe earlier - still waiting for the download for XCode 3.2.3 and SDK 4.0.1), the packages contain sub-packages named quite similarly
Despite the inner package name, it appears that the actual iOS SDK will be included for the version mentioned on the primary DMG file. For instance, xcode_3.2.5_and_ios_sdk_4.2_final.dmg may contain what appears to be SDK packages for a bunch of versions, but the iOS SDK is only fully included for 4.2.
I was able to get my hands on 4.1, 4.2, and 4.3 by downloading the DMG XCode installers, viewing package contents, and running the corresponding iPhoneSDK4_X.pkg installer.
After installing, I had to copy the stuff it dropped from /Platforms/iPhoneOS.platform/ into the new location at /Developer/Platforms/iPhoneOS.platform.
In addition to the SDKs for iPhoneOS, I also made sure the iPhoneSimulator.platform stuff was there. For me, it seems that XCode handles installing most device support for debugging..
I hope this helps! The tricky part for me was realizing that the package names may be the same, yet the contents may be different. Each download only seems to have included a single full SDK.
Once I did this, i was able to change my base SDK in XCode and build against the target SDK.
Cheers!
PS: Once you add additional SDK's, you will likely see additional destinations appearing in your schemes list with identical device names for the physical devices. It drove me nuts, as each one is associated with one of the SDK's, yet the SDK version isn't listed in the list. Not bad once you figure out which is which, usually the symptom being a failed build, since it targets another SDK based on which physical device is selected. More info on this post: duplicate device scheme in xcode 4