Tag Archives: could not attach to pid

How to Solve Xcode Error: could not attach to pid “xx”

This problem occurs when you start Xcode to run the project recently. Start it again or start it a few more times, and you can run the project normally.

Popularize it: PID (Process Identifier) ​​is called Process Identifier in English, and it also belongs to electrical and electronic technical terms.
PID is the identity of each process. Once the program runs, the system will automatically assign a unique PID to the process. After the process is terminated, the PID is reclaimed by the system and may continue to be assigned to the newly running program.
The PID column represents the process ID of each process , that is to say, PID is the identity of each process.
Reason: pid is a sign of unix allocation of resources, which means that it may be related to the version of the Mac system.

Solution:
1. clean the project (command+shift+k)
2. restart simulator if you use it
3. re-build
4. run it again.

There is no good solution yet, mainly relying on re-build.