Reputation: 2142
I am facing this problem again and again. Anybody can give the solution to this problem except reboot the Mac?
I have already tried these tricks
simulator-->services-->a reset content and settings,
closing xcode and re-opening
xcode --> developer toos --> simulator -->(open the simulator),
quit simulator
Activity monitor -->(the simulator is closed so nothing here to force close)
First of all quit your simulator.
And then quit and restart Xcode.
And then run your project.
Upvotes: 66
Views: 105263
Reputation: 1
If you are trying to launch a new iOS simulator and there are no options for the iOS version, it means that there are no simulator runtimes installed. Here are the steps I took:
Open Xcode.
In the menu bar, click on "Window".
Click "Devices and Simulators".
In the Devices and Simulators window, click on the "Simulators" tab. At this point, you won't see anything in the tab.
At the bottom left corner press the + icon. This will open a window to create a new simulator.
In the window, click the dropdown menu next to "OS Version". Then, select the option "Download more simulator runtimes...".
From here, you can download which platforms you want to simulate (Which in my case is iOS).
Upvotes: 0
Reputation: 1887
sudo killall Simulator
rm -rf ~/Library/Developer/CoreSimulator/Caches
This is not a repost, Jean-François Fabre. This is a precise and correct answer.
Upvotes: 4
Reputation: 123
System Settings > Storage > Developer
If you've installed a new iOS version for simulators, and this keeps happening, remove all the devices in the Developer Storage. This will boot simulator devices with updated iOS.
Upvotes: 0
Reputation: 11
Usually when I open XCode I see a suggestion to download an iOS operating system, but not this time. And I went to Windows -> Devides & Simulators to add the new operating system, hoping it will work fine.
Upvotes: 0
Reputation: 61
None of the above worked for me.
Go to System settings > Storage settings. Click Developer, From the list delete Xcode Cache.
Worked for me
Upvotes: 6
Reputation: 557
I tried all steps above and nothing worked for me, so i opened xcode, and started a new project, then selected App. Once i did that, xcode installed all missing parts. In my case, was that the iOS was not properly installed.
Upvotes: 0
Reputation: 19
I just rebooted my Mac and the problem was resolved. Not elegant, but easy.
Upvotes: -1
Reputation: 7561
In my case, I needed to open XCode and make sure the iOS version was installed. After opening XCode, from the top bar open the simulators dropdown and if you don't see a list of devices, select "install iOS version xx". After downloading the devices, close the simulator and reopen.
Upvotes: 0
Reputation: 89
In my case, was just kill the process: sudo killall -10 com.apple.CoreSimulator.CoreSimulatorService
Upvotes: 3
Reputation: 1
I tried all methods above and still had the same error. Since its the simulator causing a mess , i just created a new project on Xcode and just chose new device and when device was powered on i launched my expo project and it worked
Upvotes: 0
Reputation: 156
I was having this behavior in xcode 14.2, visual studio 17.5 preview 6. The folders previous posts refer to are not there to delete. In my case, I finally discovered that after rebuilding certs due to the main apple cert expiration on Feb 6, 2023, the project had chosen the distribution cert for use in simulator. I had to remove the account, re-add it, and then the developer cert would show, but it would de-select itself oddly enough. I finally set it, closed the properties, and it stuck... after which the simulator came right up. Hopefully that saves someone some time.
Upvotes: 0
Reputation: 8011
I also have this issue and googled this, which redirect to this question. Mine was xcode10
What i have done is as follows
Activity monitor
, selected cpu
option and search for sim
, killing all the process shown as result.sudo xcrun simctl erase all
. It will delete all content of all simulators. By content if you logged in somewhere password will be gone, all developer apps installed in that simulator will be gone.Doing these resolved my issue.
Upvotes: 127
Reputation: 1174
Under Product -> Scheme -> Edit Scheme
, check these settings once.
Right now it is showing None
. That is NOT what you want.
Choose the Executable from the dropdown. It should have something like: <app_name>.app
.
Upvotes: 48
Reputation: 765
In my case tmp
directory was not there for some reason, creating it giving adequate permissions saved my day.
sudo mkdir /private/tmp
sudo chmod 1777 /private/tmp
https://stackoverflow.com/a/48075384/6919038
Upvotes: 5
Reputation: 9
The following solved my issue
Upvotes: 0
Reputation: 760
None of the above solutions helped me.
I also tried
sudo killall -10 com.apple.CoreSimulator.CoreSimulatorService
And even after clean Xcode reinstallation my simulators continue closing after launching.
So i removed all simulators from Window - Device & Organizers
And then added new one's
And the problem has gone
Upvotes: 19
Reputation: 1263
Enable/change location in the xcode console. It worked for me.
Upvotes: 0
Reputation: 5451
Long shot but in my case I just moved my Xcode
to Applications
and restarted Xcode
.
Upvotes: -1
Reputation: 1333
In Xcode select Product > Scheme > Edit Scheme > Run > Options
tab.
Confirm Launch due to a background fetch event
is not selected.
See the image below ...
Upvotes: -1