lipo command(Mac)

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
    列出文件支持的架構(gòu).
lipo -info libZLHelloWorld.a
lipo -info運(yùn)行結(jié)果

可以看出當(dāng)前.a支持armv7和arm64架構(gòu).

  • lipo create
    合并多個(gè)文件, 合成后的文件支持的架構(gòu)為合并前文件支持的所有架構(gòu)集合.
lipo -create Release-iphoneos/libZLHelloWorld.a Release-iphonesimulator/libZLHelloWorld.a -output libZLHelloWorld.a 

驗(yàn)證:

驗(yàn)證結(jié)果

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: 上述命令 寫(xiě)成每行一個(gè)元素是為了看的方便 實(shí)際各元素間用空格連接.

  • lipo -thin
    裁剪文件僅支持某種架構(gòu) .
lipo -thin armv7 libZLHelloWorld.a -output libZLHelloWorld_armv7.a 
結(jié)果驗(yàn)證
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀(guān)點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

推薦閱讀更多精彩內(nèi)容