'Too many open files' error xcode
Check if you have too many open simulators. I closed all the simulators and the error went away
I think you just have reached the maximum number of open file descriptors.
You can check the limit by
$ ulimit
And change it by:
$ ulimit -n 6666
But do not forget ulimit
changes the limit only for current session. You have to put ulimit -n 6666
to .bash_profile
or something like this
Check the number of file descriptors that can be opened by your shell. Most cases, default will be 256.
ulimit -a
To solve the 'too many open files' issue locally, increase the number of files that can be opened per shell:
ulimit -S -n 2048 #2048 works fine, or you may put other value.
In case it still does not resolve, system settings can be checked the following way:
sysctl kern.maxfiles sysctl kern.maxfilesperproc
If you prefer to increase the limits system wide, go for these:
sysctl -w kern.maxfiles=20480 (or any number) sysctl -w kern.maxfilesperproc=18000 (or any number)
Use sudo
at the beginning of the command, in case you get permission denied.
In order to make this a permanent setting, you will need to add it or change default kernal parameters in /etc/sysctl.conf
file.
This article explains the details.