最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to enable Address Sanitizer in Xcode Archive build? - Stack Overflow

programmeradmin1浏览0评论

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.

发布评论

评论列表(0)

  1. 暂无评论