Problem:
I'm trying to create an IPA file with Address Sanitizer (ASan) enabled in Xcode. Here's my current setup:
- I've enabled Address Sanitizer in the
Edit Scheme -> Run -> Diagnostics
section for debugging, and it works fine when running the app directly from Xcode. - I've manually added the
-fsanitize=address
flag to both Other C Flags andOther C++ Flags
in Build Settings. - The app runs successfully with ASan in debug mode, but I'm unable to archive the IPA with ASan enabled because:
- The
Edit Scheme -> Archive
section doesn't have the same diagnostic options as the Run configuration. - In
Build Settings
, I don't see theEnable Address Sanitizer
option. The only similar option I can find isEnable C++ Container Overflow Checks
.
I've tried following advice from other sources(Claude and DeepSeek) to enable ASan in Build Settings, but the option is not present in my Xcode. How can I properly enable Address Sanitizer for an Archive build in Xcode?
Additional Details:
Xcode version: Version 15.0 (15A240d)
Expected Answer:
How to enable Address Sanitizer for Archive builds in Xcode.
Whether it's possible to include ASan in the final IPA file.
Any workarounds or manual configurations required.