admin管理员组

文章数量:1415139

Problem:
I'm trying to create an IPA file with Address Sanitizer (ASan) enabled in Xcode. Here's my current setup:

  1. 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.
  2. I've manually added the -fsanitize=address flag to both Other C Flags and Other C++ Flags in Build Settings.
  3. 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 the Enable Address Sanitizer option. The only similar option I can find is Enable 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.

本文标签: How to enable Address Sanitizer in Xcode Archive buildStack Overflow