Swift beginner Debugging memo with Xcode

Overview

This article is a memorandum of the author who is a beginner in programming. Will be added at any time.

Summary of debugging methods in Swi

--What is a Break point? --LLDB command --View Debugger --Reference

What is a break point?

It stops processing at the line where the breake point is set during the test. You can use this to debug line by line. To set, click the number on the left end of the editor as shown in the image below to check it. スクリーンショット 2020-10-27 23.58.43.png

If you execute it as it is, the process will stop at the Break point as shown in the image below, and the debug area will appear. You can debug in various ways by using commands in the debug area. スクリーンショット 2020-10-28 0.02.52.png

LLBD command

LLBD is one of the software debuggers (probably). Debug by typing a command on the console screen of the debug area.

po command

Probably an abbreviation for print object.

po <variable>

The value of the variable specified in can be output. It's convenient. スクリーンショット 2020-10-28 0.14.03.png

expression command

expression <variable> = <value>

Any value can be assigned to the variable specified in. When combined with the po command, print debugging is possible without rebuilding each time. I'm happy. スクリーンショット 2020-10-28 0.18.21.png

View debugger

View Hierarchy with Xcode as standard equipment. Translated literally, the view hierarchy. You can understand the hierarchical structure of Views on the app. スクリーンショット 2020-10-28 0.22.06.png Click the button circled in red in the image above to start it. Actually, I haven't used it yet, so I'll add it later.

reference

https://developer.apple.com/videos/play/wwdc2018/412

Recommended Posts

Swift beginner Debugging memo with Xcode
Remote debugging with intellij
Getting Started with Swift
Starting with Swift Swift UI
[Swift] [Beginner]] About range operators
Execute external command with swift
Create a playground with Xcode 12
Remote debugging with Gradle test
Java study memo 2 with Progate
Erase Storyboard Minimap with Xcode 12
Compare Java 8 Optional with Swift
XVim2 introduction memo to Xcode12.3
[Swift] Create a project with Xcode (ver 12.1) and display "Hello, World!"
[Tips] How to solve problems with XCode and Swift for beginners