.a 文件解析

首先先準備一個靜態庫.a文件,好比叫staticLibrary.a,放在桌面的test目錄裏。dom

分離arch

首先先file一下staticLibrary.a,看一下該文件包含幾種arch。ui

~ cd Desktop/testspa

test ls.net

staticLibrary.a
code

test file staticLibrary.
blog

staticLibrary.a: Mach-O universal binary with 2 architectures
ip

staticLibrary.a (for architecture armv7): current ar archive random library
get

staticLibrary.a (for architecture arm64): current ar archive random libraryit

 

能夠看到該文件包含兩種arch,分別是armv7和arm64。 
因爲下面抽離object的時候必須是要單一的庫,因此這裏咱們之抽出armv7並命名爲v7.a:class

lipo staticLibrary.a -thin armv7 -output v7.a

這時候應該在test目錄下多了一個v7.a文件。

抽離.a文件的object

ar -x v7.a

 

你會發現會多出一些.o文件

獲取文件

好比剛纔多出來了一個View.o文件,使用如下命令進行獲取:

nm View.o > view.m

 

OK 去看一下view.m文件吧

 

原文地址:http://blog.csdn.net/showhilllee/article/details/49871363

相關文章
相關標籤/搜索