I am getting the following error after migrating from one mac to another using time machine.
Could not attach to pid Ensure "project title"
Could not attach to pid
Ensure "project title"
If you have Mojave OS then:
Mojave
1) Open your target scheme
2) Uncheck this one
3) Select this scheme while testing this target (ex. Testing "TestApiTarget" - select "TestApiTarget" in schemes on tests).
Its temporary solution from bug report