Swati
Swati

Reputation: 2918

Message from debugger: unable to attach error for osx app

I have been building mac app on my mac mini and it always worked well but today i faced this error, searched a lot but no luck.

Message from debugger: unable to attach

What i tried:

Xcode 8.2

OSX 10.12.1

Please help :)

Upvotes: 8

Views: 4297

Answers (3)

jason z
jason z

Reputation: 1377

Unfortunately, the above solutions didn't work for me (although I am sure they work for some people).

Here is what worked for me, in case this helps anyone else:

  • Close Xcode
  • Open Xcode and Create a new Xcode project
  • In the iOS template, select Single View App then click Next
    • yes, I know you are trying to get a macOS app attaching to the debugger :).
  • Give the iOS app any product name and organization identifier you would like and click Next
  • Create the new project anywhere you would like (I saved it to my desktop)
  • Build and run (cmd + r) the iOS app on a simulator like the iPhone 8 (starting a simulator and running the iOS app will take a little time, so have patients)
  • After the iOS app runs in the simulator, click to stop it from running (the stop button is next to the run button)
  • Open your macOS app that you are having trouble connecting a debugger to, and build and run it (cmd + r)

This, for some reason, allowed me to connect to the debugger with my macOS app...

Xcode version: 10.1, macOS Mojave version: 10.14.2

Upvotes: 0

code4latte
code4latte

Reputation: 570

I just had this problem today. I have little demo code in a mac project(created with Xcode 9.4). This error just started to occur after I upgraded system to macOS Mojave 10.14. However, in Xcode 10 this project runs no problem(without changing anything). If you can use Xcode 10 it will probably be fixed.

Upvotes: 0

possen
possen

Reputation: 9276

This is what fixed it for me, perhaps it will help others but I do realize the question was for 8.2. I had it set to Xcode 9 "New Build System" disabling this and switching to "Standard Build System" in the Project Settings under the File Menu. I had tried all the other things like killing DerivedData, clean build, restarting Xcode. I also verified that my dependent libraries were set correctly. The only thing that worked was disabling new "New Build System"

Upvotes: 4

Related Questions