iOS调试真机出现的 “__llvm_profile_initialize“ 错误

一、错误形式:

app启动就崩溃,如下:

bash 复制代码
Demo`__llvm_profile_initialize:
    0x1045f7ab0 <+0>:   stp    x20, x19, [sp, #-0x20]!
    0x1045f7ab4 <+4>:   stp    x29, x30, [sp, #0x10]
    0x1045f7ab8 <+8>:   add    x29, sp, #0x10
    0x1045f7abc <+12>:  adrp   x8, 29
    0x1045f7ac0 <+16>:  ldr    x8, [x8, #0x28]
->  0x1045f7ac4 <+20>:  ldrb   w19, [x8]
    0x1045f7ac8 <+24>:  adrp   x0, 26
    0x1045f7acc <+28>:  add    x0, x0, #0x7ce            ; "LLVM_PROFILE_FILE"

二、解决方案

1、禁用代码覆盖率

Xcode15或者Xcode16创建的新项目,好像默认就开启了这个选项。项目设置 -> Build Settings,然后搜索 "Code Coverage",如下:

将上面的设置禁用或设置为"No"即可:

2、添加链接Flag: -ld_classic

如果上面的方法还不能解决,则做以下设置:

Targets -> Build Settings -> Linking General -> Other Linker Flags 添加:-ld_classic 或者-ld64

相关推荐
cypking18 分钟前
Objective-C 语法完整学习手册(小白自学 + 开发备查)
c语言·开发语言·学习·objective-c
软泡芙16 小时前
【IOS】Codable
ios·ssh·cocoa
nvvas17 小时前
9月苹果发布会前瞻:新iPhone、Apple Watch重点速览
ios·iphone
Zender Han18 小时前
Flutter 自适应(Adaptive)与响应式(Responsive)设计实践:官方推荐方案详解
android·flutter·ios
冯汉栩19 小时前
Swift Control DateSelection(日期选择框)
ios·cocoa·swift
开心就好202521 小时前
appuploader-cli 使用教程:在 Windows 上用命令行把 IPA 上传到 App Store
后端·ios
软泡芙1 天前
【IOS】CoreBluetooth
ios
冯汉栩1 天前
Swift Control DashLineView(虚线)
开发语言·ios·swift
Codeking__1 天前
iOS 动画:core Animation 底层原理
macos·objective-c·cocoa
2501_915918411 天前
iOS 真机调试工具推荐,安装运行、性能分析有哪些工具
ide·vscode·ios·objective-c·个人开发·swift·敏捷流程