![]() Most Swift variables can’t be looked into, and debugger commands such as po don’t work. There is one limitation - when paused on a breakpoint, access to variables is quite limited. ![]() We can debug view hierarchy, explore the memory graph, and even override environment settings such as text size or dark mode, all while running a debug build created with Xcode 11 on an iOS 14 device. We can pause anywhere, step over, step in, etc. With the debugger attached (either by running from Xcode 12 or manually attaching), breakpoints can be navigated as usual. It might take a couple of attempts, but it works! The app name should appear under “Lucky targets”. ![]() If for some reason you don’t want to use Xcode 12 for running, it’s possible to attach a debugger to an already launched app (a running process) manually.Īt any point of testing the app, we can open the project in Xcode 12 and attach the debugger by going to menu option Debug > Attach to Process and picking the app’s process. I would recommend going this way only if you always need breakpoints and the hassle of switching between Xcode versions all the time is worth it for you.īig thanks to Geoff Hackworth for suggesting this trick! Attaching debugger to a running app There’s a downside however, that we would then need to use Xcode 12 for running the app. ![]() Using this method, we don’t need to disable auto-launching or debugging in scheme settings, because we’re using Xcode 12 for this step and it knows how to talk with iOS 14 devices. This will install and launch the app, and attach the debugger. ![]() Launching from Xcode 12Īfter building the target with Xcode 11 (cmd+B), switch to Xcode 12, and do Run Without Building by going to menu option Product > Perform Action > Run Without Building or using cmd+control+R. We can either attach a debugger to an already running app, or let Xcode 12 also launch the app and attach the debugger for us. There are two options to get the debugger running for an app already compiled with Xcode 11. But Xcode 12 does! To get breakpoints to work, we have to use Xcode 12 for this step. Unfortunately, Xcode 11 doesn’t know how to debug apps on iOS 14. ![]()
0 Comments
Leave a Reply. |