I have been reading the forums and so far none of the solutions suggested works for me. I\'m running Xcode 4.4.1 and testing in iPhone 5.1 simulator. The simulator won\'t op
Sometimes this problem arises from having two targets in a project, both using the same bundle identifier but building products with distinct names.
Deleting the application on the device/simulator solves the problem, as it has been said earlier.
I restart the simulator and it worked for me
Step1: ping
$ 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 Step2: Check /etc/hosts
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. Step3: Correct File Format: It should be unix or LF *
$ 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.
In Sublime Text 2 this can be done throught the view menue: View > Line Endings > Unix
Flush the dns cache ($ dscacheutil -flushcache) and go back to step 1
Cleaning (either deleting folders, or Product->Clean) did not worked.
I saw that in my .plist the bundle id had been removed. Thanks to git. I checkouted-- the file, and bam! deployed to simulator no problem.
Just sharing...
and another one for the record: (none of the suggestions worked for me)
Mountain Lion: XCode 4.6.3
moved the whole Application to Trash
and deleted following other folders/Users/[USERNAME]/Library/Developer
/Users/[USERNAME]/Library/Caches/com.apple.dt.XCode
/Users/[USERNAME]/Library/Application Support/iPhone Simulator
reboot System and reinstall XCode
This happend to me after changing the Product name.
After resetting the simulator, cleaning the project, and restarting XCode, nothing worked. After shutting down and restarting the simulator everything worked as expected.