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
    列出文件支持的架构.
lipo -info libZLHelloWorld.a
lipo -info运行结果

可以看出当前.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 
结果验证
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • #幸福是需要修出来的~每天进步1%# 20170521(8/99) 【幸福三朵玫瑰】 昨日2朵玫瑰 早起写日记✅ ...
    风吹小树动阅读 1,783评论 0 0
  • 原来大家都喜欢把音量调的很高,并不是足够听见就好,那么吵闹耳朵怎么受得了。 姐夫请我们吃了烤肉,正儿八经第一次吃这...
  • 最近身边的人和我抱怨他们的奇葩室友,我总是安慰说寝室有个奇葩室友也很正常,可能是我并没有遇到,所以杞人忧天假装安慰...
    二猫子阅读 1,733评论 2 2
  • 看着记忆中小时候的自己,深埋心底的自卑如一颗毒瘤日渐吞噬了人的心智:哪些悲伤的心事如哽咽在喉咙里的血,在害怕中,让...
    郭相麟阅读 1,594评论 0 0
  • 引用自:Crossin的编程教室 来看两个问题: 1. 假设有一个数列,如何把其中每一个元素都翻倍? 2. 假设有...
    SagaraMisae阅读 3,856评论 0 0

友情链接更多精彩内容