Summary:
In Xcode 7.1.1 and earlier, passing -sdk iphonesimulator to xcodebuild would imply a suitable destination. In Xcode 7.2, this is no longer the case and the inferred destination is a generic iOS device rather than a simulator.
It is hard to imagine a case where this would be desired behaviour.
Steps to Reproduce:
Create a new iOS project with Xcode 7.1.1 or earlier.
With Xcode 7.1.1 or earlier selected through xcode-select or DEVELOPER_DIR, build it from the command line: xcodebuild -configuration Release -scheme -sdk iphonesimulator clean build
Run the same build with Xcode 7.2
Expected Results:
The build should succeed in both cases.
Actual Results:
Xcodebuild infers a valid SDK root (iphonesimulator9.2) and sets -isysroot to -isysroot $DEVELOPER_DIR/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk. However, it selects architectures armv7 and arm64, and puts $DEVELOPER_DIR/Platforms/iPhoneOS.platform/Developer/usr/bin in $PATH.
This results in the compiler trying to use the simulator version of sys/cdefs.h to build with armv7 and arm64 architectures, which produces errors like:
In file included from :1:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk/usr/include/sys/cdefs.h:707:2: error: Unsupported architecture
error Unsupported architecture
^
Notes:
The attached archive contains:
A sample project (just a Single View App template with the deployment target lowered to 9.0)
A script to run test builds consistently and gather versioned logs
Example output from Xcode 7.1.1 and 7.2.
Configuration:
Happens consistently in all tested configurations involving Xcode 7.2.
Description
Summary: In Xcode 7.1.1 and earlier, passing -sdk iphonesimulator to xcodebuild would imply a suitable destination. In Xcode 7.2, this is no longer the case and the inferred destination is a generic iOS device rather than a simulator.
It is hard to imagine a case where this would be desired behaviour.
Steps to Reproduce:
Expected Results: The build should succeed in both cases.
Actual Results: Xcodebuild infers a valid SDK root (iphonesimulator9.2) and sets -isysroot to -isysroot $DEVELOPER_DIR/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk. However, it selects architectures armv7 and arm64, and puts $DEVELOPER_DIR/Platforms/iPhoneOS.platform/Developer/usr/bin in $PATH.
This results in the compiler trying to use the simulator version of sys/cdefs.h to build with armv7 and arm64 architectures, which produces errors like:
In file included from:1:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk/usr/include/sys/cdefs.h:707:2: error: Unsupported architecture
error Unsupported architecture
^
Notes: The attached archive contains:
Configuration: Happens consistently in all tested configurations involving Xcode 7.2.
Product Version: 7.2/7C68 & 10.11.2/15C50 Created: 2015-12-21T16:03:12.825080 Originated: 2015-12-22T00:00:00 Open Radar Link: http://www.openradar.me/23973685