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

13

368

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

Imitative answered 17/3, 2015 at 19:37 Comment(3)
My app was running without issue then suddenly I came across this. I had no license to agree to and command line tools was set. A simple reboot of my machine worked.Beliabelial
please select correct answerLimpet
After adding a second user to my Mac, I ran into this issue. This command resolved it!Rusticus
B
884

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

Bucket answered 19/4, 2016 at 18:29 Comment(8)
"assigning the Common Line Tools" ... nice, but why aren't they set on install? hahaPardo
Great! After updating to Catlina 10.15.3 it simply disappeared.Imprison
Note this also works when "pod lib lint My.podspec" throws the same error.Pastille
I also got this error after installing brew. This answer works like a charm, thanks!Unilocular
If my Xcode have the above path setup. Shall i need the download the command line tools additionally in the machineClostridium
Worked for Xcode 14 as well. They need to set it on install.Derte
In case somebody like me stuck in the obvious image. After enter the Locations Tabs, you should select the Command Line Tools to an options and the comment below will change to your Xcode path. And then back to a new terminal, simctl is ready to go.Counterstatement
'Preferences' has been changed to 'Settings...'Homocercal
I
133

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

Xcode screenshot

Ichthyoid answered 26/2, 2019 at 0:59 Comment(2)
This makes it a lot more clear how to make the change, thanks for pic!Crossbow
Just clicking the dropdown causes the machine to ask for a password and fixed the issue.Yankeeism
S
107

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.

Suint answered 8/11, 2018 at 8:42 Comment(2)
This is what worked for me. I always had Xcode installed and always worked in the IDE, but this is the first time that I am using Xamarin in VS for Mac. Once I issued the second command in the terminal and started the debugger, the "Deploying to Device" window showed that I accepted the license and then started installing additional components.Che
This answer should have way more visibility. According to how you installed xcodebuild you could not have licenses accepted, things don't work and you don't know whyGenetic
S
96

Got similar issue on executing command

./Scripts/bootstrap.sh -d.

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

enter image description here

Sfumato answered 30/7, 2020 at 11:33 Comment(3)
How classic issue..Ingenious
Weird, but works! Thanks for all the help man, I don't know what I'd do building iOS stuff without this kind of help!Crozier
Yeap, That's it...Motionless
H
13

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.

Harrietharriett answered 31/3, 2018 at 10:14 Comment(0)
P
11

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!

Penley answered 18/9, 2022 at 3:55 Comment(2)
it works also for minor version 14.3 (14E222b)Danyluk
So my issue here is that I apparently defined SDKROOT in my .zshrc. Simply removing the export SDKROOT was enough to allow the properly-selected Command Line Tools selection to work.Radically
B
8

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.

Borkowski answered 29/10, 2018 at 12:57 Comment(0)
T
6

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

Temikatemp answered 4/2, 2021 at 8:43 Comment(2)
Worked for 13.3.1. Thanks!Savoy
Also worked for Xcode 14.2Obsolesce
Q
2

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.

Quadratics answered 23/4, 2019 at 14:2 Comment(0)
L
2

adding xcode in preference-> locations works fine

Legionnaire answered 2/1, 2020 at 0:6 Comment(1)
Adding command line tools as xcode version in preference-> locations works fineLegionnaire
Z
2

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

Zandrazandt answered 18/1 at 10:24 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Bombazine
E
-1

Here are a few steps you can try to fix this error,

1.) Clean and Rebuild Solution: Clean the solution in Visual Studio by going to the "Build" menu and selecting "Clean All" or using the keyboard shortcut Shift + Command + K. After that, rebuild the solution by selecting "Build All" from the "Build" menu or using the keyboard shortcut Command + B.

2.) Verify Build Configuration: Make sure you have the correct build configuration selected. Go to the toolbar at the top of Visual Studio and check the selected build configuration (e.g., Debug, Release). Ensure that you're trying to launch the application with the appropriate build configuration.

3.) Check Provisioning Profiles: Ensure that the provisioning profiles used for the app are correctly configured. Make sure you have valid provisioning profiles for the device or simulator you're trying to run the app on. You can check and manage your provisioning profiles in Xcode's "Preferences" under "Accounts" and ensure they are up to date.

4.) Restart Visual Studio and Simulator: Quit Visual Studio for Mac and close the iOS Simulator. Then, relaunch Visual Studio and the Simulator to see if the issue persists.

5.) Update Xcode and iOS Simulator: Make sure you have the latest version of Xcode and the iOS Simulator installed. Open the App Store on your Mac, go to the Updates tab, and install any available updates for Xcode or the iOS Simulator.

Enigmatic answered 12/6, 2023 at 13:59 Comment(0)
D
-2

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
Deb answered 7/12, 2022 at 19:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.