could not attach to pid on xcode 8.1 simulator

4.7k Views Asked by At

I have been having this error:

could not attach to pid

From Xcode for about 3 days now. The weird thing is during the 3 weeks it got me to finish this project I have had no issues with running the project on the simulator, but after I successfully added provisioning profile I have been having this issue.

I have tried all other solutions posted on here and other forums but all don't seem to work for me. I am using Xcode 8.1 and macOS Sierra.

4

There are 4 best solutions below

0
On BEST ANSWER

After a painstaking research i discovered the whole error started from when the code refused to compile after adding facebook sdk, so i changed the mach-o type to dynamic libraries thats when the code compiled but now refused to attach to emulator so i reveresed my actions and got the normal compile error i was getting before which was a Arch-64 error so i added that architecture to my target and problem solved.

2
On

Try resetting the content and settings, like this in the menu:

enter image description here

Also, when I have the issue I can usually re-run the app a few times and it works.

0
On

Go to XCode, Preferences,.. and click on location Tab.

Go to DerivedData folder and delete all folders in it.

Then try running Xcode again.

0
On

Worked for me: Finder->Go->Go to the folder copy text below add paste, delete all and install xcode again:

/Applications/Xcode.app
/Library/Preferences/com.apple.dt.Xcode.plist
~/Library/Preferences/com.apple.dt.Xcode.plist
~/Library/Caches/com.apple.dt.Xcode
~/Library/Application Support/Xcode
~/Library/Developer/Xcode
~/Library/Developer/CoreSimulator