Testing an iOS and watchOS app on a simulator

I am seeing the following error when testing an iOS app that includes a watchOS (3) app…

Testing failed:
	Target specifies product type 'com.apple.product-type.watchkit2-extension', but there's no such product type for the 'iphonesimulator' platform
** TEST FAILED **

I read that CircleCI supports building and testing apps for iPhone and Apple Watch but I am not sure how to properly launch the simulator to do so.

In my test command, I use the following destination:
-destination='platform=iOS Simulator,name=iPhone 7,OS=10.0'

Here is the full test command:

test:
override:
- set -o pipefail &&
xcodebuild
CODE_SIGNING_REQUIRED=NO
CODE_SIGN_IDENTITY=
PROVISIONING_PROFILE=
-sdk iphonesimulator
-destination “platform=iOS Simulator,name=iPhone 7,OS=10.0”
-workspace GuideDogs.xcworkspace
-scheme “GuideDogs”
clean build test |
tee $CIRCLE_ARTIFACTS/xcode_raw.log |
xcpretty --color --report junit --output $CIRCLE_TEST_REPORTS/xcode/results.xml

Any ideas on how to properly test an iOS and watchOS app?

1 Like

Hi, try to remove “-sdk iphonesimulator”.
It works for me :slight_smile: