Unable to boot device due to insufficient system resources using Xcode 9
Asked Answered
S

13

36

When I try to launch an iOS Simulator from Xcode 9, the following error pops up:

"Unable to boot device due to insufficient system resources" error dialog

Surround answered 10/10, 2017 at 17:57 Comment(3)
Looks like a duplicate of Xcode 9 Server: Unable to boot device due to insufficient system resourcesDelayedaction
I found the duplicate using this DDG search.Delayedaction
don't want to do the command below. I just restart my laptop and it's okUseless
C
37

You should increase the allowed running processes for your system. You can modify the limits through Terminal. The command for that is the following:

sudo launchctl limit maxproc [limit for one user] [total limit]

Inside Simulator Help, Apple's example values are 2000 for one user and 2500 total.

After setting up the values, quit iOS Simulator, then restart Xcode and try launching a simulated device again.

However, keep in mind that this can slow down your system and make the OS unstable. Since these values are only permanent until the next restart, you should reboot your system and it will restore these values to default.

From Simulator Help:

WARNING: Setting the the maximum number of processes to a number that is too low can prevent your Mac from operating correctly. Restart your machine to restore the original limits.

Chaoan answered 10/10, 2017 at 18:15 Comment(2)
Tried above command and everything stopped working. Restarting mac resolved issue. Just be careful before using this commandCrisscross
@LalitKumar I'm sorry to hear that, try using higher values if this issue comes up again.Garth
O
39

Following command helped me out. Try pasting the below command in the terminal and it should solve your problem.

sudo launchctl limit maxproc 2000 2500

Octahedron answered 23/1, 2018 at 9:13 Comment(1)
Ideally, it works without restarting Xcode, need to know why exactly you faced the issue so you have to restart Xcode.Octahedron
C
37

You should increase the allowed running processes for your system. You can modify the limits through Terminal. The command for that is the following:

sudo launchctl limit maxproc [limit for one user] [total limit]

Inside Simulator Help, Apple's example values are 2000 for one user and 2500 total.

After setting up the values, quit iOS Simulator, then restart Xcode and try launching a simulated device again.

However, keep in mind that this can slow down your system and make the OS unstable. Since these values are only permanent until the next restart, you should reboot your system and it will restore these values to default.

From Simulator Help:

WARNING: Setting the the maximum number of processes to a number that is too low can prevent your Mac from operating correctly. Restart your machine to restore the original limits.

Chaoan answered 10/10, 2017 at 18:15 Comment(2)
Tried above command and everything stopped working. Restarting mac resolved issue. Just be careful before using this commandCrisscross
@LalitKumar I'm sorry to hear that, try using higher values if this issue comes up again.Garth
I
7

Alternatively you can quit the current Simulator and then launch the Simulator again (ideally for a different iPhone version).

Invoke answered 8/11, 2017 at 10:53 Comment(0)
S
3

This error happens to me after I rename my simulators.

I just renamed back to what its name before and restarting the machine do the fix for me.

As what Apple have said:

Restart your machine to restore the original limits.

So any changes that I made to that limits, which I don't even know other than renaming simulators, will be back to original.

Try restarting your machine first, before doing what's in the right answer.

(This might also helps you prevent the slow down of your system. Cheers!)

Szymanski answered 6/8, 2019 at 7:53 Comment(0)
K
2

What other people already answered works. Here's a way to also set the values independently with sysctl:

To set the total max # of processes:

sudo sysctl kern.maxproc=<VALUE>

To set the max # of processes per user:

sudo sysctl kern.maxprocperuid=<VALUE>

Where <VALUE> is whatever value you want to set them to.

NOTE: Some people say to use -w as a param to sysctl. You can...it won't hurt anything. But, it's deprecated in modern versions of MacOS.

You can list the current values with these commands:

sudo sysctl kern.maxproc kern.maxprocperuid

Those settings will not persist across a reboot. To persist the values across a reboot, do something like what is in this post: https://discussions.apple.com/thread/2781309

I.e., create a plist file in /Library/LaunchDaemons (e.g., sysctl.plist) that sets the values as you want them. Here's an example:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" 
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
 <key>Label</key>
 <string>sysctl</string>
 <key>ProgramArguments</key>
 <array>
 <string>/usr/sbin/sysctl</string>
 <string>-w</string>
 <string>kern.maxprocperuid=1024</string>
 <string>kern.maxproc=2048</string>
 </array>
 <key>RunAtLoad</key>
 <true/>
</dict>
</plist>
Kobi answered 2/11, 2018 at 17:41 Comment(0)
L
2

In my case, it was a lot simpler, my Mac's storage was full. I deleted a couple of GB of unused stuff, restarted the Mac, and it worked fine.

Lavolta answered 6/5, 2020 at 2:26 Comment(0)
M
2

I closed Xcode and Simulator and then restarted my computer and the error went away. It has been 3 days and it has not returned. Before making changes to settings I recommend restarting first.

Memorialize answered 29/6, 2020 at 17:26 Comment(0)
D
1

In my case, i simply quit the xcode and reopened. It worked.

Or, If you have multiple instances of simulator open, then in that case also such error shows, so quit all other istances of the simulator and run the app on your desired simulator.

Digitoxin answered 6/8, 2019 at 15:14 Comment(0)
A
0

In my case I had another account in which Simulator was running.

  1. Locked screen.
  2. Switched to other account.
  3. Quit Simulator.
  4. Came back to current account and it worked.
Antonelli answered 10/7, 2020 at 8:0 Comment(0)
J
0

In my case I have a lot of open simulators, after closing most of them the error disappers

Jeramyjerba answered 17/9, 2020 at 15:22 Comment(0)
S
0

xCode 12.4 In my case no simulator was showing. Solution was to click on Apple icon, select force quit and choose simulator.

Skedaddle answered 18/3, 2021 at 17:37 Comment(0)
A
0

in my case i just quit Xcode then reopen and problem solved

Alexio answered 10/10, 2021 at 4:24 Comment(1)
This has already been mentioned in other answers like this one. When answering older questions that already have answers, please make sure you provide either a novel solution or a significantly better explanation than existing answers.Tani
R
0

Open the terminal and copy paste the following command.

killall -9 com.apple.CoreSimulator.CoreSimulatorService

Rochelrochell answered 24/11, 2022 at 20:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.