Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS: Debugging not working in XCode

I'm using XCode 4 and iOS SDK 4.3. My debugging worked fine but now i discovered that when setting a breakpoint, the app pauses but XCode doesn't focus on the line in the Editor. Also the green arrow is not displayed when hitting the break point. I have a UINavigationController which is allocated in the AppDelegate. When i set a breakpoint in the didFinishLaunchingWithOptions everything works as expected:

enter image description here

This is when i a breakpoint has paused the app in the mapViewController which is the first item added to the navigation controller. (No green arrow but app is paused):

enter image description here

I really have no clue why debugging is working in AppDelegate but not in this controller. If you need additional info or screenshots in order to help me, please tell me.

UPDATE:

Now it's even not working in AppDelegate and changed nothing. I can also step through the lines and can see that values are assigned in the Locals and can therefore guess where the app is currently in the code. So obviously everything works, just the currently executed line is not marked as it should.

like image 705
cmart Avatar asked Mar 16 '11 09:03

cmart


People also ask

How do I enable debug mode in Xcode?

When you run an application in Xcode, the debugger is automatically started and attached to the process of the application. Click the Run button in the top left or press Command + R. From the moment the application is up and running, we can start inspecting the process and, if necessary, debug it.

Why breakpoints are not working in Xcode?

You might be pushing "Run" instead of "Debug" in which case your program is not running with the help of gdb, in which case you cannot expect breakpoints to work! In Xcode 6.4, there is now only a Run button and whether it runs a debug configuration or not depends on the currently selected scheme settings.

How do I debug my iPhone using Xcode?

To try to debug it, set your active scheme in Xcode to be AppName > iPhone 11 Pro Max. Then using the simulator alone (not Xcode) click on the AppName to let it run. Then go into Xcode and do Debug > Attach to process by PID. Then type in the name of your App, and click Attach.


1 Answers

In xCode4:

  • Your Project Name -> Edit Scheme
  • Info tab (in run configuration)
  • Set Build Configuration to "Debug", Debugger - to "LLDB" ("GDB" was before)
  • Run your project

Worked for me. For "LLDB" green line is visible. Switching back to "GDB" brings me to this issue again.

like image 195
vokilam Avatar answered Oct 15 '22 07:10

vokilam