Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

iOS app debugging


May 21, 2021 iOS Development Manual


Table of contents


IOS application debugging


Brief introduction

When we do an application, we can make all kinds of mistakes, which can lead to all kinds of mistakes. Therefore, in order to fix these errors or defects, we need to debug the application.

Select a debugger

The debuggers in Xcode are GDB and LLDB debuggers, and GDB is the default. L LDB is a debugger that is part of llVM's open source compiler project. You can change the debugging and edit the activity schedule options.

How do I find coding errors?

We just need to build our application, the code is compiled by the compiler, all the messages, errors and warnings will be displayed as well as the cause of the error and we can correct them. You can click on product, and then click on "Analytics" to see what might happen in the application.

Set a break point

Break points help us understand our application objects and help us identify many flaws, including the different states of logical problems. W e just need to click on the line number to create a break point. W e can remove the break point by tapping and dragging it. It looks like this

iOS app debugging

When we run the app and select playVideo, the button app will be paused and let's analyze the state of our application. When the break point is triggered, we get an output, as shown in the following image

iOS app debugging

You can easily determine which thread triggered the break point. At the bottom you can see objects, such as self, sender, etc., which hold the values of the corresponding objects, and we can expand some of these objects to see what their states are.

To continue with the application, we select the continue button (the far left button) in the debug area, as shown in the following image. O ther options include step and step skip

iOS app debugging

Abnormal break point

We also have an exception break point that triggers the application to stop where the exception occurred. B y selecting the "plus" button after debugging navigation, we can create an exception break point. You will get the window below

iOS app debugging

Then we need to select the Exception Breakpoint (Add Exception) breakpoint, which displays the following window

iOS app debugging

What's next?

You can learn more about debugging and other Xcode features in the Xcode 4 user guide.