How to change Xcode sdk compiling version - ios

I have tried to build an app through to the AppStore but they rejected it due to the app using sdk 11.4. Stating that it needs to use the updated version of 12.1.
The current Xcode I have installed is 10.1 or 10B61 which is the latest without making use of a Beta. I have searched through the settings trying to find how to update the sdk as well as maybe target that newer base SDK.
Things I have tried:
Searched for newer Xcode (stated above)
Searched through settings for the base SDK version number so it can be changed.
Went to AppStore to find any updates for Xcode (there were none)
Tried googling how to change/update the sdk, but none give an explicit answer on where this can be done. It merely states that Xcode 10 should come with a base SDK of 12.1, but that does not seem to be the case here.
Please note that this is not to target the minimum version. I know where that is and it is set accordingly. No issues there.
EDIT:
I have run $> xcodebuild -showsdks and it shows that sdk 12.1 is the sdk that is installed.
However, it seems that it is somehow overriding it to 11.4 when it is trying to build to AppStore. Not sure why.

The issue did not seem to be with Xcode itself but rather Bitrise that we were using to build and publish the app to the AppStore. Once the correct stack was selected for the building/publishing, it managed to build, however, we then found a different issue.
Using Xcode 10.1 we built the app in iOS 12.1, however, Bitrise seems to have an issue with React-Native third-party dependencies when it comes to Xcode 10.0+. It just doesn't seem to install them correctly and throws an error while compiling. (dependency: double-conversion)
The only advice we could find online was to downgrade xCode to 9.4 and then manually add the Device Support files (from targeted SDK to 12.1) to the app. This is something we don't want to do.
We are waiting for Bitrise to sort their stuff out, but in the meantime, we are looking into building straight from Xcode or Fastlane.

Related

All iOS apps submitted to the App Store must be built with the iOS 15 SDK or later, but our iOS SDK is already of version 15.2

I have found similar questions in this and this articles, but neither can solve my problem.
The message given by Apple Store Connect was also "ITMS-90725: SDK Version Issue - This app was built with the iOS 14.4 SDK. All iOS apps submitted to the App Store must be built with the iOS 15 SDK or later, included in Xcode 13 or later."
However, I have checked that I am using xcode 13.2.1 which works with iOS 15.2 SDK, running on macOS Big Sur 11.6.4 (well.... a 2015 iMac, kind of old though). I believe it is capable of building a project with iOS 15.2 SDK, but I just can't find where I shall tune (if necessary) to avoid it keeping using iOS 14.4 SDK to build my project. Could you please help me solve the issue? Thank you very much!!
The figures below show the environment I mentioned above:
Looks like you have multiple Xcodes installed, please make sure you have selected the correct version for your Command Line Tools
I found that it was an embarrassing reason which caused the problem I raised above. I think I am responsible for showing what was going on to all who have read this post, and especially to those who had paused to think about this issue.
In short, Xcode 13.2.1 does build the app using iOS 15.2 SDK.
I was able to successfully archive, verify in Xcode, and uploaded the binary to app store connect. However, I was not familiar with the app store connect and did not aware that there was another binary built with iOS 14.4 SDK which was left by my predecessor.
Though I tried several times rebuild and re-upload, I kept falsely submitting the old binary to Apple's reviewer.
That's it, and no bug or secret about Xcode using older version of iOS SDK to build apps, it is just not true. Xcode does build using its latest SDK. Again my apologies to those who also worried about this issue.

How to fix the issue in uploading an app error : 10.1(UNSUPPORTED: Local iOS SDK is 10.2 which does not match)?

I created app using Lua language using Corona SDK and when I try to
create a build or Send it to App Store, it displays these errors below
UNSUPPORTED IOS SDK Mismatch
The version of iOS SDK (10.2) that's installed on this computer does
not match the target iOS version (10.1). You may encounter issues
building or incompatibilities at runtime.
Anyone can help me with this issue? Any help will be appreciated.
Thank you!
I had the same problem. You need to download the latest daily build from Corona Labs and then build using that version. Daily builds are found here:
https://developer.coronalabs.com/downloads/daily-builds
From Corona blog
Changes to Xcode Requirements
Starting with 2015.2616, Corona
Simulator will be more stringent about the version of Xcode you have
installed (older versions work like before, in a less stringent
manner). In particular, when you select a particular target iOS
version, you must have the corresponding version of Xcode installed.
For example, if you want to target iOS 8.3, you must install Xcode 6.3
which includes iOS 8.3 SDK.
Also, from this post you can read that for iOS 10 SDK you need install Xcode 8. So I guess for iOS 10.2 SDK you need Xcode 8.2 (I'm not sure which one exactly will fit). What is more you need most recent version of Corona:
stable build (requires Xcode 8.1 or later, the macOS Simulator requires macOS 10.10 or later, more information) or
daily builds.
Note: I'm using only Win7 for Corona SDK.

Using IOS 7.0 Simulator on Xcode 7.2.1

I would like to make my app compatible with IOS 7.0 but in the preferences --> downloads section, the lowest available version is IOS 8.1 simulator. I'm currently using OSX Yoesmite 10.10.5 wih xcode 7.2.1 running version 9.2.
Does that mean there's no way to test for app compatibility for any versions lower than IOS 8.1?
Edit: I realize it's possible to install older versions of xcode. I want to know if it's possible to download only the simulators on my current xcode, not have an entirely new and different xcode.
The answer should be NO.
It's not just about the simulator, but the SDK you use to compile the app to run within the simulator. When you use newer SDK to compile, the binary could contain unknown load commands to the binary header, or unknown APIs calls to an older system. That's the main reason you can't run an app built with newer SDK/system on an older OS. Even if it worked, it might still crashed at some point when the needed symbols can't be resolved.
So in order to run/build app for an older version of simulator, you need:
An older version of Xcode (which has older version of SDK)
Or, find out a way to setup your current version of Xcode to compile
with the older SDK extracted from an older version of Xcode. (This
may and may not work due to the change made to Xcode.)
For the second option, you can google it for how-to.

Xcode 7 ValidateEmbeddedBinary error Could not read data in foo-WatchKit-App.app

I am trying to do a full build on an iOS App with a WatchKit App as well.
When compiling the full project for Archive I am seeing the following
ValidateEmbeddedBinary DerivedData/lifa93/Build/Intermediates/ArchiveIntermediates/lifa93Dev/BuildProductsPath/Release-iphoneos/lifa93.app/Watch/lifa93-WatchKit-App.app
cd /Users/lordandrei/Projects/git/X7/lifa93
export PATH="/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode-beta.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
builtin-embeddedBinaryValidationUtility /Users/lordandrei/Projects/git/X7/lifa93/DerivedData/lifa93/Build/Intermediates/ArchiveIntermediates/lifa93Dev/BuildProductsPath/Release-iphoneos/lifa93.app/Watch/lifa93-WatchKit-App.app -signing-cert *9F…FB* -info-plist-path /Users/lordandrei/Projects/git/X7/lifa93/DerivedData/lifa93/Build/Intermediates/ArchiveIntermediates/lifa93Dev/InstallationBuildProductsLocation/Applications/lifa93.app/Info.plist
error: warning: Could not read data in /Users/lordandrei/Projects/git/X7/lifa93/DerivedData/lifa93/Build/Intermediates/ArchiveIntermediates/lifa93Dev/BuildProductsPath/Release-iphoneos/lifa93.app/Watch/lifa93-WatchKit-App.app
I have tried:
toggling between Debug and Release
toggling No Install and No Validate.
revoking and replacing all profiles (Signing, adhoc, dist)
So far nothing has made a dent.
Suggestions welcome as I am in a holding pattern trying to build.
Xcode: Version 7.0 beta 3 (7A152u)
iOS: 9.0 beta 3 (13A4293g)
Radar: 21975256
I had this issue when I was trying to build to my iPhone 6+ and Watch. I had just re-installed Xcode 7 Beta because I accidentally deleted one of the needed frameworks. I tried building several times and received the same "Could not read data..." error. I finally built to the simulator successfully, AND THEN built to both devices and it worked.
My issue now is that builds to Apple Watch seem to take forever to run or pass "Attaching...".
I don't know exact reason of your problem, but I created new project that includes WatchKit App target as well. And it works fine, no problems with building process.
I am using Xcode 7 beta (7A120f).
That's why I propose 3 potential ways to resolve the issue:
1. Create new new project from scratch and migrate source and resource files from your current project to new one. I had similar problems (it wasn't related to WatchKit app) previously and this trick helped me.
2. Install latest version of Xcode. Xcode 7 beta 4 is released on 21st of July.
3. Install Xcode (7A120f). This is version that I am using, you are using different one. I don't think that it will help, but who knows.

Is it possible to install iOS 6 SDK on Xcode 5?

Xcode 5 has a preferences pane that allow one to download iPhone 6.1 simulator, however I can't find a place where it allows downloading of iOS 6 SDK, thus it is not possible to set the active SDK to iOS 6 when developing with Xcode 5. Is there a workaround that would allow Xcode 5 to install iOS 6 SDK?
EDIT:
Workarounds should no longer be necessary now that Xcode 5 is generally available and allows you to download previous versions of the SDK.
EDIT: Starting Feb 1, 2014, Apple will no longer accept pre-iOS7 apps for submission to App Store. So while this technique still works, it will not be useful for most readers.
Yes, this is fine. I still build with iOS 4.3 for one project (it's been awhile since we updated; but they still accepted it after iOS 6 came out), and I currently build 10.5 apps with Xcode 5.
See How to point Xcode to an old SDK so it can be used as a "Base SDK"? for details on how to set it up. You can use my fix-xcode
script to link everything for you every time you upgrade.
The only trick is getting the old SDKs. If you don't have them, you generally need to download old versions of Xcode (still available on developer.apple.com), open the installer package, and hunt around to find the SDK you need.
SDKs can be found within the installer package at:
Xcode.app/Contents/Developer/Platforms/
I was also running the same problem when I updated to xcode 5 it removed older sdk. But I taken the copy of older SDK from another computer and the same you can download from following link.
http://www.4shared.com/zip/NlPgsxz6/iPhoneOS61sdk.html
(www.4shared.com test account test#yopmail.com/test)
There are 2 ways to work with.
1) Unzip and paste this folder to /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs & restart the xcode.
But this might again removed by Xcode if you update xcode.
2) Another way is Unzip and paste where you want and go to /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs and create a symbolic link here, so that the SDK will remain same even if you update the Xcode.
Another change I made, Build Setting > Architectures > standard (not 64) so list all the versions of Deployment Target
No need to download the zip if you only wanted to change the deployment target.
Here are some screenshots.
Yes, I just solved the problem today.
Find the SDK file, like iPhoneOS6.1.sdk, in your or your friend's
older Xcode directory.
Copy & put it into the Xcode 5 directory :
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs.
Then you can choose the SDK like below :
Hope this helps you.
Find and download old SDK. Older SDKs are found here.
I have copied the xcode.app directory as Xcode_4.6.3.app.
Now you can test and debug in both xcode versions. You have to run them from the corresponding folders or create shortcuts in your desktop. When building from command line give the parameter as iPhoneOS6.1 instead of iPhoneOS7.0
This worked great for me in Xcode5 and iOS.
Go to into Xcode5's SDK dir. Its usually located at:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
Add a symbolic link to the old SDK like this:
sudo ln -s /Applications/Xcode_4.6.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk iPhoneOS6.1.sdk
Or more accurately from anywhere in the command line,
sudo ln -s /Applications/Xcode_4.6.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk
You can download the older SDK and install it in
Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
folder. Logout + Login just to make sure the changes take effect and you should see the older SDK in your new XCode
Just to add, you can actually download old versions of the simulator with Xcode 5 itself - just go to preferences and you'll find them under Downloads:
Download Xcode 4.6.x from the Apple Dev Center: https://developer.apple.com/downloads/index.action
Create a folder called Xcode4 within the Applications folder and drag-n-drop the downloaded dmg there.
Open a terminal window
$sudo cp -R /Applications/Xcode4/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
You will be prompt to enter a password since you're inside a system folder
Open Xcode 5 and you should now see both SDKs
Just for me the easiest solution:
Locate an older SDK like for example "iPhoneOS6.1 sdk" in an older version of xcode for example.
If you haven't, you can downlad it from Apple Developer server at this address:
https://developer.apple.com/downloads/index.action?name=Xcode
When you open the xcode.dmg you can find it by opening the Xcode.app (right click and "show contents")
and go to Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1 sdk
Simple Copy the folder iPhoneOS6.X sdk and paste it in your xcode.app
right click on your xcode.app in Applications folder.
Go to Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
Just paste here.
Close your xcode app and re-open it again.
To test an app in iOS 6 on your simulator:
- Just choose iOS 6.0 in your active sheme.
To build your app in iOS 6, so the design of your app will be the older design on an iPhone with iOS 7 also:
- Choose iOS6.1 in Targets - Base SDK
Just note : When you change the base SDK in your Targets, iOS 7.0 won't be available anymore for building on the simulator !
Can do this, But not really necessary
How to do this
Jason Lee got the answer. When installing xCode I preferred keeping previous installations rather than replacing them. So I have these in my installation Folder
So /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs Contain different sdks. (Replace Xcode.app with correct number) copy previous sdks to
/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
Here is my folder after I copied one.
Now restart xCode and you can set previous versions of sdks as base sdk.
Why it is not necessary
Refering Apple Documentaion
To use a particular SDK for an Xcode project, make two selections in your project’s build settings.
Choose a deployment target.
This identifies the earliest OS version on which your software can run.
Choose a base SDK
Your software can use features available in OS versions up to and including the one corresponding to the base SDK. By default , Xcode sets this to the newest OS supported by Xcode.
Rule is Use latest as base SDK and set deployment target to the minimum version app supposed to run
For example you can use iOS 7 as base sdk and set iOS 6 as deployment target. Run on iOS 6 simulator to test how it works on iOS 6. Install simulator if not available with list of simulators.
Additionaly You can unconditionally use features upto iOS 6. And Conditionally you can support new features of iOS 7 for new updated devices while supporting previous versions.
This can be done using Weakly Linked Classes ,Weakly Linked Methods, Functions, and Symbols
https://developer.apple.com/library/ios/documentation/developertools/conceptual/cross_development/Using/using.html#//apple_ref/doc/uid/20002000-SW3
Weak Linking
Suppose in Xcode you set the deployment target (minimum required version) to iOS6 and the target SDK (maximum allowed version) to iOS7. During compilation, the compiler would weakly link any interfaces that were introduced in iOS7 while strongly linking earlier interfaces. This would allow your application to continue running on iOS6 but still take advantage of newer features when they are available.
The other answers here are correct too, but I find the following steps to be the easiest:
Just download Xcode 4.6.3 from the dev center link that says "Looking for an older version of Xcode?" (currently points here) and mount the dmg.
Then in terminal, copy the SDK files over:
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/
Finally, relaunch Xcode and you're done.
My app was transitioned to Xcode 5 seamlessly because it can still build with the original iOS Deployment Target that you set in the project (5.1 in my case). If the new SDK doesn't cause some insurmountable problem, then why not build using it? Surely there are many improvements under the hood.
For example, I will much prefer to use Xcode 5 instead of Xcode 4.6.3. Why? I'll get a lot more battery life because the UI scrolling of text/code areas in Xcode 5 no longer chews up an entire CPU thread.
Linking the 6.1 SDK into Xcode 5 as described in the other answers is one step. However this still doesn't solve the problem that running on iOS 7 new UI elements are taken, view controllers are made full-size etc.
As described in this answer it is also required to switch the UI into legacy mode on iOS 7:
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:#"UIUseLegacyUI"];
[[NSUserDefaults standardUserDefaults] synchronize];
Beware: This is an undocumented key and not recommended for App Store builds!
Also, in my experience while testing on the device I found that it only works the second time I launch the app even though I'm running the code fairly early in the app launch, in +[AppDelegate initialize]. Also there are subtle differences to a version built using Xcode 4.6. For instance, transparent navigation bars behave differently (causing the view to be full-size).
However, since Xcode 4.6.3 crashes on Mavericks (at least for me, see rdar://15318883), this is at least a solution to continue using Xcode 5 for debugging.
I downloaded XCode 4 and took iOS 6.1 SDK from it to the XCode 5 as described in other answers.
Then I also installed iOS 6.1 Simulator (it was available in preferences). I also switched Base SDK to iOS 6.1 in project settings.
After all these manipulations the project with 6.1 base sdk runs in comp ability mode in iOS 7 Simulator.
From 1st february Apple will reject app built only for iOS6 or lower. Here is also the official communication from Apple. Better start building for iOS7.
To clarify my statement: If you build for iOS6 or lower, apple will reject your app.
If you build for iOS7 AND lower everything is fine, this means:
you must use xcode5
you should deploy on iOS7 at least.
The content of the Apple email is pretty clear at me
"Make sure your apps work seamlessly with the innovative technologies
in iOS 7. Starting February 1, new apps and app updates submitted to
the App Store must be built with Xcode 5 and iOS 7 SDK."
I currently have Xcode 4.6.3 and 5.0 installed. I used the following bash script to link 5.0 to the SDKs in the old version:
platforms_path="$1/Contents/Developer/Platforms";
if [ -d $platforms_path ]; then
for platform in `ls $platforms_path`
do
sudo ln -sf $platforms_path/$platform/Developer/SDKs/* $(xcode-select --print-path)/Platforms/$platform/Developer/SDKs;
done;
fi;
You just need to supply it with the path to the .app:
./xcode.sh /Applications/Xcode-463.app

Resources