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