您的位置:首页 > 移动开发 > IOS开发

ios developer tiny share-20160720

2016-07-20 20:30 471 查看
今天分享使用Xcode Debug,包括打开调试面板、设断点、使用LLDB、管理断点等。

具体内容如下:

Debug your app

Use the Xcode debugger to inspect your code while running your app. The debug navigator and debug area automatically appear when you build and run your app. If necessary, show the navigator area by clicking the left button () and the debug area by clicking
the middle button () on the right of the toolbar.

To set a breakpoint in your code, open the file in the source editor and click in the gutter next to the line of code you want to break in. To temporarily disable a breakpoint, click the breakpoint badge in the gutter and it turns grey. To temporarily disable
all breakpoints, click the breakpoint icon in the debug bar. To delete a breakpoint, drag it out of the gutter. Run your app and the debugger will stop the app at the breakpoint you specified when that line of code is executed.



The debug bar appears at the top of the debug area and contains the buttons to control the execution of your app—for example, continue, step over, and step in to. The variable area below shows the variables in the current scope. To view a variable, click
the disclosure triangle next to a variable. If the value is an image, you can quick look it directly in Xcode. The console area to the right shows standard output and is where you enter LLDB debugger commands. For example, enter “po [expression]” and the debugger
will execute the expression you enter. As you type an expression, the debugger offers suggestions for completing it similar to the source editor. The debug navigator appears to the left of the debug area and allows you to navigate the stack.



To manage your breakpoints, click the breakpoint navigator () in the navigator area. You can view, disable, and delete breakpoints. To add special types of breakpoints, click the Add button (+) at the bottom of the navigator and choose a type of breakpoint
from the pop-up menu. Control-click a breakpoint to display a contextual menu and explore more ways to manage your breakpoints.

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ios xcode debug breakpoint LLDB