解壓靜態庫 a檔案

2021-07-24 20:05:09 字數 903 閱讀 4671

目錄(?)

[-]

分離arch

抽離a檔案的object

獲取檔案

首先先準備乙個靜態庫.a檔案,比如叫staticlibrary.a,放在桌面的test目錄裡。

首先先file一下staticlibrary.a,看一下該檔案包含幾種arch。

~  cd desktop/test

test ls

staticlibrary.a

test file staticlibrary.a

staticlibrary.a: mach-o universal binary with

2 architectures

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

staticlibrary.a (for architecture arm64): current ar archive random library

可以看到該檔案包含兩種arch,分別是armv7和arm64。 

由於下面抽離object的時候必須是要單一的庫,所以這裡我們之抽出armv7並命名為v7.a:

lipo staticlibrary.a -thin armv7 -output v7.a
這時候應該在test目錄下多了乙個v7.a檔案。

ar -x v7.a
你會發現會多出一些.o檔案

比如剛才多出來了乙個view.o檔案,使用以下命令進行獲取:

nm view.o > view.m
ok 去看一下view.m檔案吧

解壓靜態庫 a檔案

1.準備乙個.a的靜態庫檔案 test.a 將其放在桌面新建立的test資料夾中 2.進入終端 a.進去該資料夾目錄 cd desktop test b.檢視.a檔案包含幾種arch file test.a c.由於抽離object的時候必須是要單一的庫,所以抽出armv7並命名為v7.a 目錄會多...

ios學習 解壓靜態庫 a檔案

首先先準備乙個靜態庫.a檔案,比如叫staticlibrary.a,放在桌面的test目錄裡。首先先file一下staticlibrary.a,看一下該檔案包含幾種arch。cd desktop test test ls staticlibrary.atest file staticlibrary....

CAB檔案壓縮 解壓類庫

在codeproject上閒逛,又發現乙個好東西 cabinet file cab compression and extraction,乙個好心人提供了cab檔案的壓縮和解壓縮類庫 c 專案的demo download c project with demo 112 kb net專案的demo d...