If a framework is written, the type of machine that is selected according to the build will be divided into the simulator framework and the real machine framework, which cannot be mixed.
At this point, you can use the Lipo command in Script to merge the two versions of the framework by configuring a run Script to regenerate a new framework that supports both the emulator and the real machine.
In the project's build phases, create a new run Script and enter the following:
if["${action}"="Build"]theninstall_dir=${srcroot}/products/${project_name}.frameworkdevice_dir=${build_root}/${configuration}-iphoneos/${project_name}.frameworksimulator_dir=${build_root}/${configuration}-iphonesimulator/${project_name}.frameworkif[-D"${install_dir}"]THENRM-rf"${install_dir}"Fimkdir-P"${install_dir}"CP-R"${device_dir}/" "${install_dir}/"#ditto"${device_dir}/headers" "${install_dir}/headers"Lipo-create"${device_dir}/${project_name}" "${simulator_dir}/${project_name}"-output"${install_dir}/${project_name}"#open"${device_dir}"#open"${srcroot}/products"fi
When the project is build again, the products directory appears under the project directory, which contains the merged framework folders.
Use Lipo-info to detect the following:
Lipo-info binary file path (can be dragged in)
If it appears:
x86_64 armv7 arm64
The instructions were successful!!!
READ: http://devonios.com/xcode-lipo-framework.html
IOS: Static library (. Framework) Merge