The lipo command was used when typing the static library, so to summarize. .framework and.a static libraries are used in the same way.
- View the CPU architectures supported by static libraries
1. Lipo – xx/xx/TestFramework info. Framework (path) framework in the output is as follows:
Architectures in the fat file: /Users/xxx/Desktop/TestFramework.framework/TestFramework are: armv7 arm64
Copy the code
2. Lipo – detailed_info xx/xx/TestFramework framework (path) framework in the output is as follows:
Fat header in: /Users/xxx/Desktop/TestFramework.framework/TestFramework fat_magic 0xcafebabe nfat_arch 2 architecture armv7 cputype CPU_TYPE_ARM cpusubtype CPU_SUBTYPE_ARM_V7 capabilities 0x0 offset 16384 size 69232 align 2^14 (16384) architecture arm64 cputype CPU_TYPE_ARM64 cpusubtype CPU_SUBTYPE_ARM64_ALL capabilities 0x0 offset 98304 size 69280 align 2^14 (16384).Copy the code
- The merge produces a new static library
Lipo-create Directory for storing static library 1 Directory for storing static library 2… -output The output of the combined path is as follows:
lipo -create xxx/TestFramework1.framework xxx/TestFramework2.framework -output TestFramework3.framework
Copy the code
- Static library split
Lipo Static library source file path -thin CPU architecture name -output File path after splitting
Lipo TestFramework. Framework -thin armv7-output testwork2.frameworkCopy the code
- Extracting a single platform
lipo -extract armv7 TestFramework1.framework -output TestFramework2.framework
- Replacing a specified CPU
lipo TestFramework1.framework -replace armv7 TestFramework2.framework -output TestFramework3.framework
- Removing a SPECIFIED CPU
lipo -remove armv7 TestFramework1.framework -output TestFramework2.framework