Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 9 - Could not attach to pid for Frameworks unit tests

I am getting the following error after migrating from one mac to another using time machine.

Could not attach to pid

Ensure "project title" is not already running, and "system username" has permission to debug it.

Screenshot added.

The error occurs only when running the unit tests for (any) Framework project. Running an application on simulator and device works fine.

Running unit tests for an application works, but running it for any framework can't be launched due to this error. I am getting this error even with Alamofire or PromiseKit unit tests.

I tested the solutions suggested on similar questions on Stackoverflow (I deleted derived data, cleaned everything, reinstalled Xcode, restarted the mac ..) nothing solved the issue till now.

I am using Xcode 9.3 and tested this with Xcode 9.4-beta also.

I am running on Mac OS High Sierra - 10.13.4 (17E199)

Any help / suggestion is welcome!

like image 593
AmineG Avatar asked Apr 09 '18 16:04

AmineG


1 Answers

After opening a bug report to Apple, they suggested me to:

  • Check if my user is an Admin user. It was the case.
  • Check if I have "_developer" group, in the output of groups command. it was the case. Use this command: dscacheutil -q group
  • Check developer mode rights using the command sudo /usr/sbin/DevToolsSecurity -status. The status was unknown for me.
  • Enable developer mode rights if needed, using the command sudo /usr/sbin/DevToolsSecurity -enable. This solved finally my issue!
like image 121
AmineG Avatar answered Sep 29 '22 05:09

AmineG