-
在Build Setting中将有问题的库加入忽略列表
Build Setting > Build Options > Excluded Source File Names
OC
#if !(TARGET_IPHONE_SIMULATOR) // 不是模拟器
// 问题代码...
#endif
Swift
#if targetEnvironment(simulator) // 模拟器
#else // 真机
// 问题代码...
#endif
在Build Setting中将有问题的库加入忽略列表
Build Setting > Build Options > Excluded Source File Names
#if !(TARGET_IPHONE_SIMULATOR) // 不是模拟器
// 问题代码...
#endif
#if targetEnvironment(simulator) // 模拟器
#else // 真机
// 问题代码...
#endif