Skip to content

Debugging

Console Debug

When you have specified the breakpoint and you have llb debugger in the console.

You could use it

po swift_variable/ objects

SO link Apple Doc Complete Guide LLDB Debug Advanced LLDB

Breakpoint

In UI Xcode IDE, you can specify breakpoints on the code as well group breakpoints, share them and also add specific type of breakpoints. Like having exception breakpoint, printing debug logs, conditional breakpoints.

Reset Simulator

You can reset the simulator or just uninstall / delete the app from home screen. It is particularly useful for deleting NSUserDefaults & Persistent data associated with the app.

On Simulator App, navigate to ‘Device’ menu -> ‘Reset Content and Settings’

Link

Clean Build Folder

If you need to clean the project derived data which can sometimes resolve previous invalid cache of the build system. You can find it in

Top menu -> Product -> Clean Build Folder

Change variables in runtime

You can execute commands or change variables while in debugger breakpoint mode in LLDB Xcode console command.

Just enter expr or e followed by the expression you want to execute.

Function status with parameter change for different user experience timeline switch.

e NetworkConfigurationManager.shared.setConnectivity(isEnabled: true)

Variables alteration

e isValid = false

https://stackoverflow.com/questions/9907387/how-to-change-variables-value-while-debugging-with-lldb-in-xcode