Skip to main content

Command Palette

Search for a command to run...

Modify a value during iOS debugging in Xcode

Published
1 min read
Modify a value during iOS debugging in Xcode
M

I am a Software Engineer working on open source and enterprise mobile SDKs for iOS and MacOS developers written in Swift. From 🇩🇪 and happily living in 🇺🇸

Xcode is using the open-source LLDB debugger and with the expression command you are able to modify a value in a running program.

Use expression in debugger

You can verify that the value has changed with the print command from LLDB.

Screen Shot 2022-07-11 at 1.15.53 PM.png

Once you resume the program you will see that the changed value is still used.

Bonus tip 1: You can also use the abbreviation e as alternative to the verbose expression because LLDB does prefix matching. Same for p as alternative to print.

Bonus tip 2: You can use multiple expressions as actions in the Xcode debugger ti supply test/demo data. Find out more by reading Dominik Hauser's article.

Using breakpoints to populate with demo data

More from this blog

Dev blog post potpourri by senior software engineer Marco Eidinger

149 posts

Hello 👋🏻 , I am a Software Engineer working on open source and enterprise mobile SDKs for iOS and MacOS developers written in Swift. From 🇩🇪 and happily living in 🇺🇸