I\'ve been facing an issue (frequently) with the recent major release of the iOS application development tool - Xcode 9-beta.
It\'s showing me the following error fr
This seems to be a temporary issue when you are trying to build too fast after a build has started. Try stopping and running the project again.
In my case the only thing that worked was switching back from the "New Build System" to the "Legacy Build System" in the Workspace Settings. Bummer.
If issue is on OS Mojave and you are trying, like me to run tests on older Xcode version (lower than 10.0), make sure that in your scheme, when you select Test, Debug executable is disabled
You won't be able to debug tests from this point
I hate to add more noise to this, but for me, the answer is to, nonsensically, use sudo
.
Run normally, Xcode 9.4.1 (9F2000) and Xcode 10.0 beta 4 (10L213o) both failed to attach to my app after multiple tries, giving the error quoted in the original post.
What worked was to run Xcode (9.4) with sudo,
sudo /Applications/Xcode.app/Contents/MacOS/Xcode
I don't see why sudo
is necessary. The Cocoa app to which I am attaching is a Debug build that I just built in Xcode 9.4.1 and dragged into /Applications
. It is not codesigned. Posix permissions on the .app
, its Contents
, its MacOS
, and the executable are all octal 755. Owner is me. It works fine if I leave it in the Build folder, build and debug in the normal way.
The problem is apparently with lldb. I also tried using lldb (lldb-902.0.79.7) from the command line. I got the same result. It works only with sudo
. Without sudo
,
error: attach failed: unable to attach