When I try to launch an iOS Simulator from Xcode 9, the following error pops up:
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.
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
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.
Alternatively you can quit the current Simulator and then launch the Simulator again (ideally for a different iPhone version).
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!)
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>
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.
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.
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.
In my case I had another account in which Simulator was running.
- Locked screen.
- Switched to other account.
- Quit Simulator.
- Came back to current account and it worked.
In my case I have a lot of open simulators, after closing most of them the error disappers
xCode 12.4 In my case no simulator was showing. Solution was to click on Apple icon, select force quit and choose simulator.
in my case i just quit Xcode then reopen and problem solved
Open the terminal and copy paste the following command.
killall -9 com.apple.CoreSimulator.CoreSimulatorService
© 2022 - 2024 — McMap. All rights reserved.