背景: 导入百度人脸实名SDK, 只支持真机运行, 如何在模拟器下正常运行?
方法: 在模拟器下, 忽略只支持真机SDK , 文件 ,代码;
一. 忽略SDK 及 文件;
在Xcode 工程配置 BuildSettings
中, 设置 Excluded Source File Names
指定在模拟器环境不参与便宜的SDK及文件 .
image.png
注: /.../folder ,不能递归忽略folder文件夹下的所有文件. 需要指定 /.../folder/*
二. 忽略代码:
#if !TARGET_OS_SIMULATOR
BDFaceBaseKitLivenessTipCustomConfigItem *tipCustomConfigItem = [[BDFaceBaseKitLivenessTipCustomConfigItem alloc] ;
#endif