Xcode-beta 4: Cannot unit-test framework on iOS <10.0 simulator

Originator:daniel
Number:rdar://27747702 Date Originated:08-Aug-2016 06:11 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode-beta 4 (8S188o)
Classification:Serious Bug Reproducible:Always
 
Summary:
On Xcode 8 beta 4, it is impossible to unit test an iOS framework on iOS versions prior to 10.0. The reason for this is that the deployment target for XCTest’s host app appears to be iOS 10 — which means it cannot be installed on e.g. an iOS 9.3 simulator. Therefore, the framework cannot be unit tested at — short of creating a dummy app that links a framework, and using that dummy app as the host app for the tests.

Steps to Reproduce:
0. Ensure you have an iOS 9 simulator runtime installed for Xcode, and a simulator set up for that runtime.
1. Create a new Xcode project and select “iOS Framework” as the template; make sure that “Include unit tests” is checked.
2. Select the project in the file navigator and set the deployment target to iOS 9.
3. Select an iOS 9 simulator as the run destination of the default scheme and run the unit tests.

Expected Results:
The tests run and succeed because they are just the template tests that don’t do anything.

Actual Results:
Xcode does not run the tests at all and shows a dialog with the following error message:
“${DEVICE} cannot run xctest.

${DEVICE} runs iOS ${VERSION_SMALLER_THAN_10}, which is lower than xctest’s minimum deployment target. Change your project’s minimum deployment target or upgrade ${DEVICE}’s version of iOS.”

Regression:
This does not happen when the unit tests are set up to use a custom host app with an appropriate deployment target.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!