In Xcode 7 and 8, I have been able to debug a framework I've been developing by running the containing application within an xcworkspace that also contains the framework project. If I set breakpoints in the framework, they would get triggered at runtime.
In Xcode 9 beta 6, this is no longer the case. So far, execution is only stopping at the framework breakpoints when debugging on simulator. When I debug on a physical device, the framework breakpoints do not stop execution and it appears they are completely ignored.
How can I get framework breakpoints to work properly in order to debug my framework on iOS 11 in Xcode 9?
FWIW: The xcworkspace was created by running pod install
inside the framework root directory. I then added the sample application's xcodeproj to the xcworkspace. This has been functional up until testing on Xcode 9 beta 6.
Edit: Confirmed that this behavior still takes place on the GM seed of Xcode 9.0.
TL;DR - I needed to change which directory my archive script reads from when debugging or when preparing a release. Now when debugging, I need to be sure to set my framework scheme's archive config to "Debug" if I want breakpoints to work properly at runtime. I only use "Release" when preparing a production-ready .framework.
I reached out to Apple developer support via bug report. I will paste the response below. When he mentions "lipo", he is referring to a call I make in a post-archive script that creates a universal framework from the simulator and physical device builds.
When I ran
(lldb) image list
at runtime, I saw that the UUID of my framework did not match that which was reported bydwarfdump
at/Mac/path/to/Build/Products/Debug-iphoneos
.I ended up modifying my post-archive script to change which build directory it reads from when creating the framework. When I set my archive config to "Debug", it will read from Debug-iphoneos now. When I set it to "Release" it reads from
${BUILD_DIR}/${CONFIGURATION}${EFFECTIVE_PLATFORM_NAME}
If the paths are confusing, I don't blame you. Essentially, workspace looks like: