alexander.sivak
alexander.sivak

Reputation: 4720

How do I fix the xcrun unable to find simctl error?

I have Xcode 6.2 Beta. Attempting

xcrun simctl 

in terminal yields

xcrun: error: unable to find utility "simctl", not a developer tool or in PATH

Upvotes: 388

Views: 231261

Answers (13)

Onkar Ghotra
Onkar Ghotra

Reputation: 11

For me I got that error when I was running React Native with Expo

Xcode Version: Version 16.1 (16B40)

Solution:

sudo xcode-select --reset

Upvotes: 1

Anshu
Anshu

Reputation: 33

adding command line tools matching the installed xcode version in xcode -> preference -> locations works fine

Upvotes: 2

tanpengsccd
tanpengsccd

Reputation: 2129

In Terminal, try this.

sudo xcode-select -s /Applications/Xcode.app

/Applications/Xcode.app is your Xcode.app path.

If you still get an error in the terminal.

try sudo xcodebuild -license to agree to the license.

Upvotes: 139

Ankush Patil
Ankush Patil

Reputation: 29

You are facing this issue because the path of command line tools are not configured correctly in your XCode. Please navigate to Xcode > Settings > Locations tab . Unselect and select the XCode version name option and that should resolve this issue.

enter image description here

Upvotes: 3

Raghav gupta
Raghav gupta

Reputation: 9

following are the steps to solve this issue -

  1. open terminal on your mac
  2. type cd.. 2 times
  3. Now go to /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
  4. Now type ls, you will find sdk's here. Fir iPhone, you should see iPhoneOS.sdk.
  5. copy this path as /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk
  6. now reopen the terminal and type export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk
  7. now this error should be removed and your devices should be now recognised by system

Upvotes: -2

Gavin Harris
Gavin Harris

Reputation: 702

Had this issue after the latest version of XCode (Version 14.0 (14A309)) installed itself.

For me the Command Lint Tools were all installed etc and it made no sense; none of the above worked. However when running xcrun -v simctl it showed me that my SDKPATH was set to version 15.5 of the SDK; the new version is 16.0.

To resolve I added the below line to the top of my .zshrc file and restarted my terminal.

export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk

Note: The 'file' iPhoneSimulator.sdk is a simlink to the latest SDK version so I hope I don't need to change this again!

Upvotes: 12

Gulshan Nadaph
Gulshan Nadaph

Reputation: 1121

Got similar issue on executing command

./Scripts/bootstrap.sh -d.

This helped me Xcode > Preferences > Locations, Set Command line Tools

enter image description here

Upvotes: 101

Amogam
Amogam

Reputation: 437

Choose Xcode Preferences then choose Locations tab and inside go to command line tools Drop down box and choose one.

Problem sovled !

FYI: I tried this with Xcode 12.3

Upvotes: 9

fbozo
fbozo

Reputation: 9201

I solved this problem by entering

Xcode > Preferences > Locations 

And assigning the Command Line Tools

This is in Xcode Version 7.2 beta (7C46t) enter image description here

Upvotes: 908

Rawand Saeed
Rawand Saeed

Reputation: 855

While running Xcode, open the Xcode menu, go to Preferences…, then select Locations

In Locations, "Command Line Tools", choose your version of Xcode.

It should be fine. This worked for me.

Upvotes: 9

coders
coders

Reputation: 2477

In Xcode, open the Xcode menu at the top, then select Preferences…, and then select the Locations tab.

Xcode screenshot

Upvotes: 141

Serzas
Serzas

Reputation: 1266

If you are interested in command line "approach", please try: installer -pkg /Applications/Xcode.app/Contents/Resources/Packages/XcodeSystemResources.pkg -target /. In addition, please make sure that xcode-select -s selected right Xcode installation path.

Upvotes: 3

jsr
jsr

Reputation: 181

I had the same problem. My application was working well but suddenly in next run, it started throwing the "simctl" error. It seems I had started Xcode update installation in the background.

Fix: I just started the Xcode application and it prompted to install some pending tools update. After Xcode updates, my app started working normally.

Upvotes: 13

Related Questions