37
votes

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

  1. 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.

  1. Restart xcode and the simulator
8
whats your xcode version?Tharif
Did you try on differents projects ?KIDdAe
Xcode 6.1 and Yes I've used on other projectnitin.agam
Explain what is happening. What errors are you seeing? What dialog boxes? What do you see in syslog? Are you renaming Xcode.app? (don't).Jeremy Huddleston Sequoia
I was using the Xcode 6.3. Now it's working in Xcode 7.1. No problem at all.nitin.agam

8 Answers

79
votes

I also have this issue and googled this, which redirect to this question. Mine was xcode10 What i have done is as follows

  1. Quit the simulator & Xcode.
  2. Opened Activity monitor, selected cpu option and search for sim, killing all the process shown as result.
  3. Then fired up the terminal and run 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. Hope it helps.

33
votes

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.

Edit scheme window screenshot

9
votes

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 Remove all simulators

And then added new one's

Add new simulators

And the problem has gone

3
votes

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

1
votes

The following solved my issue

  1. Open edit scheme

Open edit scheme

  1. Check that lunch is automatically

Check that lunch is automatically

0
votes

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 ...

enter image description here

0
votes

Long shot but in my case I just moved my Xcode to Applications and restarted Xcode.

0
votes

Enable/change location in the xcode console. It worked for me.