Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xcodebuild, missing iOS simulator sdk

I'm automating the building process for an iOS project. Everything was fine... but now I have to support iOS 4, what I have installed is the iOS simulator 4.3 (Xcode : Preferences > Downloads > Components).

Inside xcode I have these options:

  • iOS device
  • iPad simulator 5.0
  • iPad simulator 5.1
  • iPhone simulator 5.0
  • iPhone simulator 5.1

There is no 4.3

From command line

$ xcodebuild -showsdks
Mac OS X SDKs:
    Mac OS X 10.6                   -sdk macosx10.6
    Mac OS X 10.7                   -sdk macosx10.7

iOS SDKs:
    iOS 5.0                         -sdk iphoneos5.0

iOS Simulator SDKs:
    Simulator - iOS 5.0             -sdk iphonesimulator5.0

There is no 4.3

Questions:

  1. Where is the 4.3 simulator installed?
  2. What sdk value should a pass to xcodebuild for the 4.3 simulator?

Thanks guys.

like image 826
subzero Avatar asked Apr 27 '12 19:04

subzero


People also ask

How can I run Xcode simulator on my iPhone?

To run your app in Simulator, choose an iOS simulator—for example, iPhone 6 Plus, iPad Air, or iPhone 6 + Apple Watch - 38mm—from the Xcode scheme pop-up menu and click Run. Xcode builds your project and then launches the most recent version of your app running in Simulator on your Mac screen, as shown in Figure 1-1.

How do you choose a simulated device as a destination?

Select a simulated device For iOS, tvOS, and watchOS apps, you can choose a simulated device, under [Platform] Simulators, from the run destination menu next to the scheme menu in the toolbar.

What is an XCFramework?

What is XCFramework? Apple defines XCFrameworks as a distributable binary package created by Xcode that contains variants of a framework or library so that it can be used on multiple platforms (iOS, macOS, tvOS, and watchOS), including Simulator builds.


1 Answers

The simulator SDK's are located at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs

You can use the following xcodebuild (/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild) command:

xcodebuild -target $target -sdk $sdk -configuration $configuration

where $target is the target name specified in the project, $sdk could be taken from the output of the command you used to see the available SDK's (iphoneos5.0, iphonesimulator5.0) and $configuration could be AdHoc, AppStore or whatever else you have setup in the project.

For the missing SDK issue you could check the item status at Xcode : Preferences > Downloads > Components to be Installed and check the folder iPhoneSimulator4.3.sdk exists at the SDK's location. If it does but still not displayed as installed, you could consider removing and reinstalling it or reinstall the Xcode completely.

like image 162
A-Live Avatar answered Oct 05 '22 12:10

A-Live