Fat*_*ler 7 debugging xcode ios xcode9-beta
在Xcode 7和8中,我已经能够通过在包含框架项目的xcworkspace中运行包含应用程序来调试我一直在开发的框架.如果我在框架中设置断点,它们将在运行时触发.
在Xcode 9 beta 6中,情况已不再如此.到目前为止,执行只在模拟器上调试时停止在框架断点处.当我在物理设备上进行调试时,框架断点不会停止执行,看起来它们被完全忽略.
如何在Xcode 9中调试iOS 11上的框架时,如何使框架断点正常工作?
FWIW:xcworkspace是通过pod install在框架根目录内运行创建的.然后我将示例应用程序的xcodeproj添加到xcworkspace.直到在Xcode 9 beta 6上进行测试之前,这一功能一直有效.
编辑:确认此行为仍发生在Xcode 9.0的GM种子上.
长话短说 - 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.
\n\nI 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.
\n\n\n\n\nXcode has to match up the binary that\'s running with the debug symbols that are still on your machine. Xcode should do that automatically, but it sounds like some stuff is moved around behind Xcode\'s back. To know whether the debug information matches you can look at the output of\n (lldb) image list\n and\n /Mac/path/to/Build/Products/Debug-iphoneos% dwarfdump --uuid iOS-App.app/iOS-App\n that will work on dylibs too.
\n \nDoes your framework have parenthesis around the address? That\'s a sure sign that lldb can\'t find your symbols.
\n \nif the UUID in image list doesn\'t match the dwarfdump, then something has modified the executable before it ran and doesn\'t match your built products. We\xe2\x80\x99re not sure if lipo might do that, which I see in your script but definitely check. Not much can be done if the debug-info no longer exists.
\n \nIf you can find the right executable with a matching UUID on your disk, you can simply\n (lldb) image add /Mac/path/to/DerivedData-asdfasdfadf/Products/Debug-iphoneos/iOS-App.app/Frameworks/Framework
\n \nAdditionally, Xcode uses Spotlight to find symbols on your machine. To avoid constantly re-indexing while building, the Intermediates/ directory containing .o files and other place where debug information is stored was blacklisted. This happened fairly late in Xcode 9.0 so may be the reason your stuff was working before.
\n
When I ran (lldb) image list at runtime, I saw that the UUID of my framework did not match that which was reported by dwarfdump 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}
# NOTE: This script creates a universal framework (device and simulator). However, *** for this to work: a Simulator target must be built first, and then Archive on the Device ***\n\nBUILD_PRODUCTS="${SYMROOT}/../../../../Products"\nSIM_PATH="${BUILD_PRODUCTS}/Debug-iphonesimulator/${TARGET_NAME}.framework"\nif [ "${CONFIGURATION}" = "Debug" ]; then\n DEV_PATH="${BUILD_PRODUCTS}/Debug-iphoneos/${TARGET_NAME}.framework"\nelif [ "${CONFIGURATION}" = "Release" ]; then\n DEV_PATH="${BUILD_DIR}/${CONFIGURATION}${EFFECTIVE_PLATFORM_NAME}/${TARGET_NAME}.framework"\nfi\nDEST_PATH="${PROJECT_DIR}/../Frameworks/${TARGET_NAME}.framework"\n\nrm -rf "${DEST_PATH}"\nmkdir "${DEST_PATH}"\ncp -r "${DEV_PATH}/" "${DEST_PATH}/"\nrm -f "${DEST_PATH}/${TARGET_NAME}"\ncp -Rn "${SIM_PATH}/Modules/" "${DEST_PATH}/Modules/"\n\nlipo -create "${SIM_PATH}/${TARGET_NAME}" "${DEV_PATH}/${TARGET_NAME}" -output "${DEST_PATH}/${TARGET_NAME}"\nRun Code Online (Sandbox Code Playgroud)\n\nIf the paths are confusing, I don\'t blame you. Essentially, workspace looks like:
\n\nRootDirectory\n|__SampleApp\n |__SampleApp.xcodeproj\n|__Frameworks\n |__MyFramework.framework\n |__AnotherFramework.framework\n|__MyFramework\n |__MyFramework.xcworkspace\n |__MyFramework.xcodeproj\n |__Podfile (etc..)\nRun Code Online (Sandbox Code Playgroud)\n
| 归档时间: |
|
| 查看次数: |
2317 次 |
| 最近记录: |