Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode freezes when it reaches a breakpoint, while testing on a device

I set a breakpoint in Xcode and run my app on a device. Xcode stops at the breakpoint and the console opens, but I just see a spinning wheel instead of a list of all the variables and Xcode sort of freezes. Nothing happens when I push the Stop button. It unfreezes only if I unplug the device. This just started happening last week.

Other times it will list the variables, but when I click the arrow next to "self" for example, the same "freeze" happens.

This does NOT happen while testing in the simulator.

Any ideas?

like image 669
Nikolay Dyankov Avatar asked Mar 01 '13 11:03

Nikolay Dyankov


People also ask

Why breakpoint is not working in Xcode?

See this post: Breakpoints 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!

How do I delete a breakpoint in Xcode?

Xcode tip #10: Breakpoints are great for debugging – place them by selecting a line number, or remove them by right-clicking and choosing Delete Breakpoint. You can also remove one by dragging it away, but a fast method is to use Cmd+\ to toggle a breakpoint on the current line.

How do breakpoints work in Xcode?

Navigate to a line in your code where you want execution to pause, then click the gutter or line number in the source editor to set a breakpoint. Xcode displays a breakpoint icon to indicate the location. Drag a breakpoint up or down to move it to another location; drag it away from the gutter to remove it.

What is exception breakpoint in Xcode?

An exception breakpoint is a type of breakpoint that is created when some exception occurs in the code. On occurrence of such exception our application stops at that given condition causing the exception and we can access all variables in scope at that breakpoint.


2 Answers

Just restart your development machine. Worked for me.

like image 146
Abhinav Dobhal Avatar answered Sep 19 '22 10:09

Abhinav Dobhal


This worked for me:

Close Xcode. Open Finder, hit +Shift+G to open "Go to Folder".

Type ~/Library/Developer/Xcode/DerivedData

Delete all folders in this directory and empty trash. Reopen Xcode and try again.

This is thanks to rokjarc (Why does Xcode successfully build & copy my application, but won't launch it?)

like image 44
Dan Avatar answered Sep 21 '22 10:09

Dan