Debugger does not stop at breakpoints when running

2019-09-05 07:24发布

问题:

I want to test my app on device and see all the NSLOGs on console while runnig the ap on device.I also want to stop the app at breakpoints but app does not stop on breakpoints and not print NSLOGs .I have unchecked load symbols lazily .I am using a debug build .Please tell me how to achieve this Thanks in advance

NOTE:After starting the app x code shows the app being debugged is not being run (I think the problem is after xcode transfers the app to device then it disconnects with device)

回答1:

Try to set breakpoint in the didFinishLaunchingWithOptions then the viewwillappear of the view you want to test the breakpoints on. basically any places before your code (which you want to test) which surely get called.

I had same problem before not exactly sure why does it happen though. it's like preparing Xcode to look for breakpoints :)



回答2:

Do you have breakpoints enabled in xCode?

Should be looking like this;



回答3:

Sounds like you're working with a jailbroken device .. Is that the case ?
If you are , the "official" answer should be "disable mobileSubstrate addons".
I've managed to run the app in debug mode , after :

  1. Doing what you mentioned (got that error message).
  2. Double tap home-button , hold the app icon, close the app..
  3. Run it again from XCode.
  4. Repeat again if necessary.