Resetting the content and settings in the simulator worked for me. This is available in the "iOS Simulator" menu.
go to the Product menu and find the Edit Scheme menu there.
While in Edit Scheme window, select the "Run" option on the left hand side of the screen and then on the right hand side, change the debugger from LLDB to GDB.
I experienced the same problem, and after a while I found out that it was due to the fact that my XCode project included a Folder Reference to a folder named Resources.
It seems that XCode doesn't like that name.
Just removing the folder reference or renaming the folder solved the issue.
TWO METHODS
Method 1 : Inside the folder Application Support -> iPhone Simulator -> In the each simulator version of iOS -> Applications -> Delete all the files present here.
Now go to Products -> Clean
Now run it on any simulator and it will work.
Method 2 :
$ ping localhost
This should return something like
PING localhost (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.028 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.048 ms
...
If this works, this answer won't fix your problem, try something else.
If ping return something else for example: ping: cannot resolve localhost: Unknown host
something is screwed up with your /etc/hosts
file, go to Step 2
Check that the top of your /etc/hosts
file looks like this
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
If it doesn't have these entries in the file, enter them at the top of the file, flush the dns cache using $ dscacheutil -flushcache
and go back to Step 1, otherwise continue to Step 3.
$ file /etc/hosts
This should return: /etc/hosts: ASCII English text
If it returns something like /etc/hosts: ASCII English text, with CR line terminators
then the file is in the wrong format and is likely being ignored.
Change the file line endings to unix or LF using your favorite text editor.
Flush the dns cache ($ dscacheutil -flushcache
) and go back to step 1
Similar to fundtimer's answer, the local hosts file seems to have been the culprit.
I had to change my /etc/hosts
permissions back to the default after an inadvertent change:
sudo chmod 644 /etc/hosts
After that, simulator/LLDB worked for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With