lipo
Descripition
The lipo command creates or operates on universal (multi-architec-
ture) files.
It only ever produces one output file, and never alters the input file.
The operations that lipo performs are:
- listing the architecture types in a universal file;
- creating a single universal file from one or more input files;
- thinning out a single universal file to one specified architecture type;
- extracting, replacing, and/or removing architectures types from the input file to create a single new universal output file.
Options
-info
Briefly list the architecture types in the input universal file (just the names of each architecture).
-detailed_info
Display a detailed list of the architecture types in the input universal file (all the the information in the universal header, for each architecture in the file).
-create
Take the input files (or file) and create one universal output file from them.
-output output_file
Specifies its argument to be the output file.
Examples
- lipo -info
列出文件支持的架构.
lipo -info libZLHelloWorld.a
可以看出当前.a支持armv7和arm64架构.
- lipo create
合并多个文件, 合成后的文件支持的架构为合并前文件支持的所有架构集合.
lipo -create Release-iphoneos/libZLHelloWorld.a Release-iphonesimulator/libZLHelloWorld.a -output libZLHelloWorld.a
验证:
Release-iphoneos/libZLHelloWorld.a 支持armv7+arm64
Release-iphonesimulator/libZLHelloWorld.a 支持i386+x86_64
libZLHelloWorld.a 支持armv7+i386+x86_64+arm64
还可合并framework
lipo
-create
Release-iphoneos/IJKMediaFramework.framework/IJKMediaFramework
Release-iphonesimulator/IJKMediaFramework.framework/IJKMediaFramework
-output
IJKMediaFramework
Note: 上述命令 写成每行一个元素是为了看的方便 实际各元素间用空格连接.
- lipo -thin
裁剪文件仅支持某种架构 .
lipo -thin armv7 libZLHelloWorld.a -output libZLHelloWorld_armv7.a