laitimes

iOS real device and emulator framework merged

1. Set the Release mode

1. First of all, choose here

iOS real device and emulator framework merged

2. Choose Run-> to change Debug to Release, select Close, and close

iOS real device and emulator framework merged

2. Run the project

1. In the real machine environment, compile the project

iOS real device and emulator framework merged

2. Compile the project in the simulator environment

iOS real device and emulator framework merged

3、选framework,Show in Finder

iOS real device and emulator framework merged

4. Find, the framework generated by the real machine and the simulator

iOS real device and emulator framework merged

3. Synthesis

1, lipo -info command, can detect the framework

lmydeMacBook-Pro:~ lmy$ lipo -info /Users/lmy/Library/Developer/Xcode/DerivedData/CloudLearning_OPDiscoveryDF-fyoydhuesnoytlbbbitgpbkgyzwh/Build/Products/Release-iphoneos/OPDiscoveryDF.framework/OPDiscoveryDF 
Architectures in the fat file: /Users/lmy/Library/Developer/Xcode/DerivedData/CloudLearning_OPDiscoveryDF-fyoydhuesnoytlbbbitgpbkgyzwh/Build/Products/Release-iphoneos/OPDiscoveryDF.framework/OPDiscoveryDF are: armv7 arm64 
lmydeMacBook-Pro:~ lmy$ 
           
Description: Armv7 arm64 is included in the True Set framework
lmydeMacBook-Pro:~ lmy$ lipo -info /Users/lmy/Library/Developer/Xcode/DerivedData/CloudLearning_OPDiscoveryDF-fyoydhuesnoytlbbbitgpbkgyzwh/Build/Products/Release-iphonesimulator/OPDiscoveryDF.framework/OPDiscoveryDF 
Architectures in the fat file: /Users/lmy/Library/Developer/Xcode/DerivedData/CloudLearning_OPDiscoveryDF-fyoydhuesnoytlbbbitgpbkgyzwh/Build/Products/Release-iphonesimulator/OPDiscoveryDF.framework/OPDiscoveryDF are: i386 x86_64 
lmydeMacBook-Pro:~ lmy$ 
           
Description: i386 x86_64 included in the True Set framework

2. Synthesis

lipo -create "/Users/lmy/Library/Developer/Xcode/DerivedData/CloudLearning_OPDiscoveryDF-fyoydhuesnoytlbbbitgpbkgyzwh/Build/Products/Release-iphoneos/OPDiscoveryDF.framework/OPDiscoveryDF" "/Users/lmy/Library/Developer/Xcode/DerivedData/CloudLearning_OPDiscoveryDF-fyoydhuesnoytlbbbitgpbkgyzwh/Build/Products/Release-iphonesimulator/OPDiscoveryDF.framework/OPDiscoveryDF"  -output  "/Users/lmy/Library/Developer/Xcode/DerivedData/CloudLearning_OPDiscoveryDF-fyoydhuesnoytlbbbitgpbkgyzwh/Build/Products/OPDiscoveryDF"
           

The above command is too long, you can cd directly into the Products directory and execute the following short command:

lipo -create "Release-iphoneos/OPDiscoveryDF.framework/OPDiscoveryDF" "Release-iphonesimulator/OPDiscoveryDF.framework/OPDiscoveryDF"  -output  "OPDiscoveryDF"
           

Finally, under the Products/ directory, a full library containing armv7 arm64, i386 x86_64 was generated.

iOS real device and emulator framework merged

3. Replace, use

Replace the generated OPDiscoveryDF file with any OPDiscoveryDF.framework, and this OPDiscoveryDF.framework can be synthesized and used, supporting real machines and simulators.