Xcode 9: Could not attach to pid

前端 未结 22 2161
旧巷少年郎
旧巷少年郎 2020-12-13 05:41

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

相关标签:
22条回答
  • 2020-12-13 06:30

    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.

    0 讨论(0)
  • 2020-12-13 06:30

    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.

    0 讨论(0)
  • 2020-12-13 06:32

    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

    0 讨论(0)
  • 2020-12-13 06:32

    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
    
    0 讨论(0)
提交回复
热议问题