Xcodebuild error : Unable to find destination, returned exit code 70

I am getting the below error while trying to build an iOS app.
xcodebuild command is running successfully on my machine.

This error generally means that the target Simulator does not exist.
Does anyone know what could be the reason?

xcodebuild: error: Unable to find a destination matching the provided destination specifier:
	{ platform:iOS Simulator, OS:latest, name:iPhone 6 }

export LC_CTYPE="en_US.UTF-8"
export XCTOOL_FORCE_TTY="true"
set -o pipefail && xcodebuild -workspace 'pop_app_ios.xcworkspace' -scheme 'pop_app_ios' clean build test -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6,OS=latest' CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= PROVISIONING_PROFILE= | tee $CIRCLE_ARTIFACTS/xcode_raw.log | xcpretty --color --report junit --output $CIRCLE_TEST_REPORTS/xcode/results.xml
returned exit code 70

EDIT Jan 16 2017: We no longer recommend using UUIDs to start simulators. The OS X image has been updated to resolve the underlying issue, and using UUIDs is no longer necessary. Please check out this post for examples of how to choose the simulators by name.

Hey,

please rather use a simulator UUID than a name. I can’t explain why but sometimes they don’t work as well.

This should start and build your app with the iOS 9.3 iPhone 6 simulator:

set -o pipefail && xcodebuild -workspace 'pop_app_ios.xcworkspace' -scheme 'pop_app_ios' clean build test -sdk iphonesimulator -destination 'id=547B1B63-3F66-4E5B-8001-F78F2F1CDEA7' CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= PROVISIONING_PROFILE= | tee $CIRCLE_ARTIFACTS/xcode_raw.log | xcpretty --color --report junit --output $CIRCLE_TEST_REPORTS/xcode/results.xml

Constantin

1 Like

@anon47539524 Thanks for your reply. Is there someway to get the list of Simulator UUIDs ? How to know the specs of the simulator for the UUID that you provided ?

Yep, there’s a list here:

Yes, great. Just now found the same post!
Thanks a lot!

/cc @drazisil
You can also get a list of all the simulators installed with either xcrun instruments -s or with xcrun simctl list.

Please note that these UUIDs for the simulators are different for every Xcode install (UUID=Unique Universal Identifier). I will update the docs over the week to properly list all simulators UUIDs available to you. From iOS 8.4 to 10.0.

1 Like

I tried running xcrun simctl list and got the below list of simulators. Strangely there are no iOS 9.3 Simulators

-- iOS 8.4 --
    iPhone 4s (F2E9EEAB-9FCE-4109-A40F-3DD79627C985) (Shutdown)
    iPhone 5 (C5C8EA0E-F5A8-4AF8-BBAA-385B61026A5E) (Shutdown)
    iPhone 5s (45BFA4E8-C0A9-4A04-9CD0-4449FE4CF40B) (Shutdown)
    iPhone 6 (65AAA024-64D5-40B9-A122-8872E3F52EC4) (Shutdown)
    iPhone 6 Plus (DFB14113-4697-4E2D-AD3F-B4FBA4B62969) (Shutdown)
    iPad 2 (A4276BA9-2D38-434D-A063-A1A7DC399235) (Shutdown)
    iPad Retina (399AEF36-5560-4C4A-AE61-03F0A81555D0) (Shutdown)
    iPad Air (AD005E41-F7E6-4C5F-B3B1-6C980E834739) (Shutdown)
-- iOS 9.0 --
    iPhone 4s (5EF3DECC-3E8F-41A0-B2CF-DC384A66E12E) (Shutdown)
    iPhone 5 (24F6F5A0-343E-4C64-9F4C-B50D88F5E99E) (Shutdown)
    iPhone 5s (49DAC9E5-C129-497D-853E-D93BC4BB8A10) (Shutdown)
    iPhone 6 (53600017-30F1-428A-A16A-25C6CEDBD849) (Shutdown)
    iPhone 6 Plus (321D1CF5-2514-4897-8B09-C133602F6DB5) (Shutdown)
    iPhone 6s (763DC427-F2C5-4AA4-989F-2CA944FA8F04) (Shutdown)
    iPhone 6s Plus (011805C3-BB7A-4785-A313-D7AD2AF6DE49) (Shutdown)
    iPad 2 (2F39BEF2-E92D-498C-B2D9-29366BD8F732) (Shutdown)
    iPad Retina (A1EC86BA-49AB-414B-9C27-2D0F26A34A81) (Shutdown)
    iPad Air (42D87249-99F2-4BC1-9180-317D268C46F7) (Shutdown)
    iPad Air 2 (6E2B1E19-6466-4328-917C-16019130FDE8) (Shutdown)

Constructed the xcodebuild command as below :
- set -o pipefail && xcodebuild CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= PROVISIONING_PROFILE= -workspace 'pop_app_ios.xcworkspace' -scheme 'pop_app_ios' -sdk iphonesimulator -destination 'id=011805C3-BB7A-4785-A313-D7AD2AF6DE49' clean build test | tee $CIRCLE_ARTIFACTS/xcode_raw.log | xcpretty --color --report junit --output $CIRCLE_TEST_REPORTS/xcode/results.xml

But I am still getting the same “Destination not found, Exit code 70”

I need more information to give you a definite answer. Could you please open up a support ticket and attach this reply please?

I have opened a Support ticket.
Please let me know if there is anything else that I need to do.

Where should this be placed?

Hello William,
Below is the circle.yml that I am using successfully now.
Replace the -workspace and -scheme values with the appropriate values from your app.

machine:
  xcode:
    version: 7.3

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