nitin.agam
nitin.agam

Reputation: 2142

iOS simulator is not launching

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

Upvotes: 66

Views: 105263

Answers (19)

Your helper
Your helper

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:

  1. Open Xcode.

  2. In the menu bar, click on "Window".

  3. Click "Devices and Simulators".

  4. In the Devices and Simulators window, click on the "Simulators" tab. At this point, you won't see anything in the tab.

  5. At the bottom left corner press the + icon. This will open a window to create a new simulator.

  6. In the window, click the dropdown menu next to "OS Version". Then, select the option "Download more simulator runtimes...".

  7. From here, you can download which platforms you want to simulate (Which in my case is iOS).

Upvotes: 0

thomasgalliker
thomasgalliker

Reputation: 1887

  1. Close all running iOS simulators: sudo killall Simulator
  2. Clear iOS simulator cache: rm -rf ~/Library/Developer/CoreSimulator/Caches
  3. Start iOS simulator

This is not a repost, Jean-François Fabre. This is a precise and correct answer.

Upvotes: 4

Tigran Muradyan
Tigran Muradyan

Reputation: 123

System Settings > Storage > Developer

  • Information icon next to developer
  • Delete XCode Simulator Caches
  • Open new simulator from XCode

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

thucthongthai
thucthongthai

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.

screenshort

Upvotes: 0

Rohit Vishwakarma
Rohit Vishwakarma

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

Cesar Gamboa Avellan
Cesar Gamboa Avellan

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

sandy t
sandy t

Reputation: 19

I just rebooted my Mac and the problem was resolved. Not elegant, but easy.

Upvotes: -1

Vahid
Vahid

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

Allan Santos
Allan Santos

Reputation: 89

In my case, was just kill the process: sudo killall -10 com.apple.CoreSimulator.CoreSimulatorService

Upvotes: 3

Big Joe
Big Joe

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

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

Ratul Sharker
Ratul Sharker

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

  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.

Upvotes: 127

swapnilagarwal
swapnilagarwal

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.

Edit scheme window screenshot

Upvotes: 48

Tasawar Hussain
Tasawar Hussain

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

Khawla ali
Khawla ali

Reputation: 9

The following solved my issue

  1. Open edit scheme

Open edit scheme

  1. Check that lunch is automatically

Check that lunch is automatically

Upvotes: 0

Mikhail Vasilev
Mikhail Vasilev

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

And then added new one's

Add new simulators

And the problem has gone

Upvotes: 19

Narasimha Nallamsetty
Narasimha Nallamsetty

Reputation: 1263

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

Upvotes: 0

Abhishek Bedi
Abhishek Bedi

Reputation: 5451

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

Upvotes: -1

Vipin Johney
Vipin Johney

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

enter image description here

Upvotes: -1

Related Questions