美文网首页xcode 环境快捷
iOS App在模拟器上编译失败问题

iOS App在模拟器上编译失败问题

作者: 霸哥终结者 | 来源:发表于2022-08-11 12:05 被阅读0次

主要是模拟器和真机的架构问题, 可以通过忽略该库来解决

  1. Build Setting中将有问题的库加入忽略列表
    Build Setting > Build Options > Excluded Source File Names

    图1
  2. OC代码中

#if !(TARGET_IPHONE_SIMULATOR)  //  不是模拟器
// 问题代码...
#endif
  1. swift代码中

推荐

#if targetEnvironment(simulator) // 模拟器
#else // 真机
// 问题代码...
#endif

不推荐

#if arch(i386) || arch(x86_64) // 模拟器
#else // 真机
// 问题代码...
#endif

相关文章

网友评论

    本文标题:iOS App在模拟器上编译失败问题

    本文链接:https://www.haomeiwen.com/subject/pmnzwrtx.html