靜態庫的製做詳解

靜態庫的製做ios

    1   靜態庫的存在形式: .a .framework xcode

         動態庫的存在形式:.dylib .frameworkbash

 

   2   靜態庫和動態庫的區別: 靜態庫在連接的時,會被完整的複製到可執行文件中,被使用屢次,就由多份拷貝。架構

                                                         動態庫則不會被複制,只有一份,程序運行時,動態加載到內存,系統只加載一次,多個程序共用app

        可是:程序中若是使用本身的動態庫是不容許上架的。iphone

 

   3   使用靜態庫,能夠保護核心代碼,將MRC的項目打包成靜態庫,就能夠在ARC環境下直接使用。ide

 

   4   靜態庫的特色: .a(靜態錄庫) + .h  看不到具體實現的代碼測試

 

演練:通常狀況下若是有個別mrc文件須要參與到編譯中,能夠作以下改動,可是有不少的話,須要使用靜態庫。MRC的項目打包成靜態庫,在ARC環境下也可使用。ui

計算機生成了可選文字:
112 陟 
Ⅱ h'A 吅 O • 
m AppDM•gat•n 
M n 02d 
- 鷢 12 ~ J 」 
18 步 」 
R • 
S ~ 
嚷 你 發 c 塽 . 甪 嫠 , # 一 
-fbn -ObjC -arc

 

(二)靜態庫的製做spa

<>.a靜態庫的製做:

1、建立一個靜態庫(選右邊的是.a的靜態庫的製做,選左邊的是.framework的靜態庫的製做)

計算機生成了可選文字:
Choose a template for your new project: 
Cocoa Touch 
Static Library 
Application 
Framework & Library 
Application 
Framework & Library 
Application 
Framework & Library 
os x 
Application 
Framework & Library 
System Plug-in 
Cocoa Touch 
Framework

 

建立的靜態庫中的文件和靜態庫的名稱是同樣的。

 

2、假使你有一個項目文件,須要生成一個靜態庫。

計算機生成了可選文字:
test 
ZJTooIs.h 
m ZJTooIs.m 
2 
ZJT001s.h 
test

在模擬器上生運行的成靜態庫

計算機生成了可選文字:
Q 
h ZJTools.h 
m ZJTooIs.m 
Products 
libtest.a 
G) 
tes 
iPhone Bs 
#corfiimld + B

 

在真機上生成的靜態庫

計算機生成了可選文字:
•Latest 
h ZJTools.h 
m ZJTooIs.m 
Products 
Iibtest.a 
"zhuzhu"ä iPhone 
88 
cOmiWähd +

 

點擊libtest.a,showinFinder

計算機生成了可選文字:
「 甴 乙 
0 
亡 
. Debua-lOhoneos 
Iibtest.a 
個 在 真 機 上 跑 得 靜 態 庫 , 個 在 模 擬 器 上 跑 得

 

可是要想將文件打包給別人,還須要一個.h文件。能夠直接將.h文件拷貝過來,可是若是項目很大,有不少

.h文件,這個時候就比較麻煩,能夠選擇這樣操做:

計算機生成了可選文字:
Resource Tags 
Build Settings 
Build Phases 
Build Rules 
e 
PROJECT 
test 
test 
h ZJTools.h 
m ZJTooIs.m 
Products 
Iibtest.a 
Target Dependencies (O items) 
Conwe Sources (I item) 
Link Binary With LiVaries (O items) 
Copy Files (I item) 
Destination Products Directory 
subpath 
n 
Copy only when instal ing 
h ZJTooIs.h ...in test

 

而後,再編譯一下!!!就能夠運行了

 

計算機生成了可選文字:
Debug-iphoneos 
Debug-iphonesimulator 
include 
libtest.a 
h ZJTools.h

 

測試靜態庫:

將生成的模擬器的文件導進來

計算機生成了可選文字:
Iibtest.a 
h ZJTools.h 
p ega e. 
m AppDeIegate.m 
h V•ewControIIer.h 
WewControIIer.m 
Main.storyboard 
Assets. xcassets 
Launch Screen. storyboard 
17 — 
Info.plist 
Supporting Files 
20 
22 — 
25 
8 
9 
11 
12 
13 
14 
15 
16 
18 
19 
21 
23 
24 
26 
27 
#im ort 
#1mpor 
cend 
"ViewCont roller. h" 
Too s. 
er ( ) 
@implementation ViewController 
(void) viewDidLoad 
(super viewDidLoadJ ; 
// Do any additional setup after loading the view, 
typically from a nib. 
(void) touchesBegan: (NSSet«UITouch *)touches withEvent: 
Products 
(UIEvent *)event 
IZJT001s ; 
cend 
2ø15-11-1ø

 

須要的注意的地方:

1 、在模擬器上面,就用靜態庫生成的模擬器的包,若是不用,會報錯!!!!

2、在6s65s5s以上)編譯均可以成功,可是選用iphone5就會報錯。

計算機生成了可選文字:
iPhone 5 
Finished rt 
ViewContr 
Created b 
Copyright 
#import "View 
2 
5 
6 
8 
9 
By Type 
3 issues 
Ignoring file 'Users,'base'Desktop/ 
file wa... 
referenced from: 
O Linker command failed with exit code 
I (use -v to see invocation)

緣由是:架構不一樣

計算機生成了可選文字:
不 同 機 型 的 CPU , 對 應 的 架 構 不 
5s--—6sPlus : x86 6 
3gs--4s : armv7 
Sc : a 黼 丷 酬 armv7 蒹 客 m 丷 副 
5s---6sPlus: arm64 
鬢 , 態 霪 支 持 的 梅 . | 霪 文 件 
問 描 : 
悠 樣 一 次 聾 支 持 多 個 梅 的 的 , 態 霪 ? 
幫 決 方 案 : 
正 幫 情 況 、 鴛 選 中 每 一 個 犧 擬 器 進 行 潷 , 生 成 支 對 應 構 的 態 庫 . 然 後 合 川 幫 鑫 
B 山 Settings 。 Build Active 」 NO , 表 示 不 止 譯 活 躍 的 讓 所 有 的 架 構 擲 潷

查看架構,終端:

計算機生成了可選文字:
Debug-iphonesimulator — bash — 80x24 
Last login: Tue Nov le 11:49:40 on ttysøøø 
bases cd 'Use rs/base/Library/DeveIope r/Xcode/De rivedData/tes 
t—ctce rugazcl Ivshezqj aqaznvjed/BuiId/Products/Debug—iphonesimuIato r 
bases lipo —info Iibtest.a 
input file Iibtest.a is not a fat file 
Non—fat file: Iibtest.a is architecture: x86 64 
bases

 

計算機生成了可選文字:
」 1 11 • 1 , 「 ㄣ 1 ~ 
O X 1 1 •u 一 - $ 3 
•S 
'U

 

由於架構不同,適用的版本不同,要想都兼容不一樣的模擬器,能夠選擇不一樣的編譯器,從新編譯,可是也能夠

使用另外一種方法,更爲方便一點:

將yes改成no,編譯不活躍的狀態下的架構。

計算機生成了可選文字:
test 
h ZJTools.h 
m ZJTooIs.m 
Products 
Iibtest.a 
test) a iPhone 6 
PROJECT 
test 
TARGETS 
test 
test 
Build test: Succeeded 
Resource Tags 
Basic 
Architectures 
Today at 11:40 
uild Settings 
Build Phases 
Build Rules 
build 
test 
Standard architectures (armv7, 
Latest ios oos C 
No v 
arm64 armv7 armv7s 
test 
Levels 
re 
Combined 
Setting 
Architectures 
Base SDK 
ve rc 
Deb ug 
Release 
Valid Architectures 
Setting 
Asset Pack Manifest URL Prefix

 

再次編譯:發現兩個個都支持:

計算機生成了可選文字:
Debug-iphonesimulator — bash — 80x24 
Last login: Tue Nov le on ttysøøø 
bases cd 'Users/ base/ Library/DeveIope r/Xcode/De rivedData/tes 
t—ctce rugazcl Ivshezqj aqaznvjed/BuiId/Products/Debug—iphonesimu to r 
bases Ii o —info Iibtest.a 
Architectures in the fat file: Iibtest.a are: 
bases

可是真機調試的仍是不能夠。

 

靜態庫的兩個版本,一個是調試版本,一個是發佈版本。

計算機生成了可選文字:
2 . 犧 . Debug 本 
. 譫 試 版 本 會 包 含 整 的 符 號 儻 , 以 方 試 
. 讕 試 版 本 不 會 對 代 碼 進 行 優 化 
1 . 真 機 . R ea 「 本 
2 . 犧 . R ea 「 本 
發 布 版 本 
悠 樣 殳 不 同 版 本 ? . 
. 發 布 版 本 不 會 包 含 整 的 符 號 詹 
. 發 布 版 本 的 歇 行 代 碼 進 行 過 優 化 的 
. 發 布 版 本 的 大 小 會 迦 試 版 本 的 貉 小 
. 在 執 行 速 度 方 面 , 發 布 版 本 會 快 , 但 不 意 味 鬢 會 有 顯 薯 的 升 
項 目 0 Edit Scheme 0 Run . , Release/Debug 猾 別 邊 行

 

這個是release模式:

計算機生成了可選文字:
one 6 
Build 
1 target 
Debug 
Release 
Debug 
Release 
test I Build test: Succeeded Today at 12:01 
Arguments 
Options 
Diagnostics 
Build Configurati 
Executable 
Debug Process As 
Launch 
Release 
None 
Debug executable 
f') Me (base) 
Automatically 
Wait for executable to be launched

 

而後下面的會變紅:

計算機生成了可選文字:
000 
test 
test 
m ZJTooIs.m 
Products 
Iibtest.a 
9 test) a iPhone 6 
2 
3 
4 
5 
6 
7

此時,再次編譯一下(分別選擇模擬器和真機):

showinFinder會出現4個文件夾:

計算機生成了可選文字:
Release-iphoneos 
Debug-iphoneos 
Debug-iphonesimulator 
Release-iphoneos 
Release-iphonesimulator 
include 
libtest.a 
iates

 

 

作測試:在release下面,會出現不打印的狀況。這個時候須要作得更改就是,將release模式改成debug。

計算機生成了可選文字:
V 2MmtrcIt_er.' 
Creati 15,'IW3. 
Conright c AIL ri*tE reservi, 
s "nort Wi&Ccntr0LIer.Y' 
Urterfa:e n 
"SArr* *array : n 
NSLog(7V, array); 
; ; Dispose of am,' re*urces tiat can be rxreated, 
32 
SArray array at:w, value 
have bæn optinied cut'

 

 

因此最後咱們通常給別人的,是生成的release模式下的靜態庫。

 

<>.framework靜態庫的製做:

1

計算機生成了可選文字:
Choose a template for your new project: 
Application 
Framework & Library 
Cocoa Touch 
watch OS 
Framework 
Application 
Framework R Library 
Application 
Framework & Lib 
Cocoa Touch 
Static Library

 

可是這邊有一個問題,須要手動勾選一下,是靜態庫仍是動態庫,由於動態庫也是有.framework文件的。

(在後面有提示到!!!!!)

 

2、測試用的代碼:

計算機生成了可選文字:
fram 
.k test 
iPhone 6s Plus framework test: Ready I Today at 12:31 
framework test) ZJTooI.m ) *log 
framework test 
2 
5 
6 
8 
9 
10 
11 
12 
13 
14 
15 
16 
ZJT001.m 
framework test 
Created by base on 
copyright 0 2ø15# 
#import "ZJTool. h" 
@implementation ZJTool 
+ (void) log 
NSLog 
framework test 
framework test 
ZJTool.h 
U Tool. m 
Info.plist 
framework testTests 
Products 
15/0/19. 
base. All ric

 

3、將.h文件暴露出去。

計算機生成了可選文字:
framework test 
framework test 
h ZJTool.h 
m ZJTooI.m 
C) Info.plist 
framework testTests 
Products 
tram... 
k test 
iPhone 6s Plus framework test: Ready 
framework test 
Today at 12:32 
PROJECT 
framework test 
e framework test 
framework test Tests 
General 
Build Settings 
Build Phase 
Resource Tags 
Target Dependencies (O items) 
Conwe Sources (I item) 
Link Binary With LiVaries (O items) 
Headers (I item) 
Public 
h Z.JTool.h 
Project 
(0) 
.in framev.ork test 
Add private header files he 
Add project header files he

 

 

正常上面的操做完成後,會編譯成功,可是報錯了,我作了以下嘗試:

修改項目的名稱:

1、在建立文件的時候,將下面的勾去掉

計算機生成了可選文字:
Product Name: 
Organization Name: 
Organization Identifier: 
Bundle Identifier: 
Language: 
base 
com.520it 
com.520it.ProductName 
Objective-C 
Include Unit Tests

2、此次的項目名稱是test1,(猜想是由於我上面項目中有空格)

計算機生成了可選文字:
testl 
testl 
h ZJTool.h 
m ZJTooI.m 
Info.plist 
testl framework 
PROJECT 
test I 
testl 
General 
Resource Tags 
Target Dependencies (O items) 
Conwe Sources (I item) 
Build Settings 
Build Phases 
e 
Link Binary With Libraries (O items) 
Headers (I item) 
h Z.JTool.h 
(0) 
Project 
(0) 
.in test I 
Add private header files here 
Add project header files here

 

選擇模擬器和真機分別編譯。

點擊test1.framework,showinFinder

計算機生成了可選文字:
Debug-iphoneos 
Debug-iphonesimulator 
1 .tramework 
testl_framework 
Headers 
Info. plist 
test 1

 

這個也是一樣地能夠經過命令行能夠查看,由於生成的

計算機生成了可選文字:
basedeMacBook—Pro: Products bases cd 'Use rs/base/Library/DeveIope r/Xcode/De rivedD 
a f pokwo fnqx rcdykx roducts/Debug—iphoneos/testI . f rame 
wo rk 
framework bases lipo —info 'Users/ base/ LibrarWDeveIoper 
/Xcode/De rivedDa f pokwo I f nqx rcdykx roducts/Debug—iphon 
eos/testl. f ramewo rk/testl 
Non—fat file: / Use rs/base/LibrarWDeveIope r/Xcode/De rivedData/testI—cpfpokwoIfnq 
xrcdykxrxakfhgpu/BuiId/Products/Debug—iphoneos/testI. framework/testl is architec 
ture: arm64 
framework base$

 

 

3、一樣的,不一樣的模擬器以及真機,使用的架構不同,因此能夠這樣操做:

真機上面須要編譯一次,模擬器上面也須要編譯一次

計算機生成了可選文字:
h ZJTool.h 
m ZJTooI.m 
Info.plist 
Products 
testl -framework 
Resource Tags 
Combined 
Build Settings 
Levels 
Build Phases 
active 
testi 
testi 
Build Rules 
General 
Basic 
PROJECT 
test I 
testl 
Architectures 
Setting 
Build Active Architecture Only 
Deb ug 
Release 
Apple LLVM 7.0 - Warnings - C.. 
Setting 
Nonvirtual Destructor

 

 

四、測試framework靜態庫

計算機生成了可選文字:
testl -framework 
m AppDeIegate.m 
h V•ewControIIer.h 
Main.storyboard 
18 — 
23 — 
24 
X-Xframework"ZE i) m V•ewControIIer.m i) No Selection 
5 
6 
8 
9 
// Created by base on 15/ø9/19. 
// Copyright 0 2ø15# base. All rights reserved. 
#import «test1/ZJTool. 
@interface ViewController ( ) 
cend 
@implementation ViewController 
(void) viewDidLoad 
(super viewDidLoadJ ; 
// Do any additional setup after loading the view, 
typically from a nib. 
(void) touchesBegan: (NSSet«UITouch *)touches withl 
(UIEvent *)event 
IZJT001 log); 
12 
13 
14 
15 
16 
17 
19 
20 
21 
22 
25 
Launch Screen. storyboard 
Info.plist 
Supporting Files 
Products

 

編譯的時候不會報錯,可是運行的時候會報錯!!!

錯誤信息以下:

計算機生成了可選文字:
Library not loaded: @rpath/ 
. framework/testl 
Referenced from: /Users/base/ 
Library/Devetoper/CoreSimuIator/ 
Devices/6Ø42F7FØ-EBB9-4A48- 
B22ø-32242C2B2189/data/Containers/ 
Bundle/Apptication/ 
37AØCIE8-Ø29B-4Ø18-ACBØ- 
E. appÆMf ramewo rk*äE 
Reason: image not found 
(Udb)

 

解決方法:

由於這個靜態庫是自定義的(自己就是動態庫),還須要在動態庫的地方添加上去。

這樣就能夠運行成功!

計算機生成了可選文字:
X-Xframework"ZE 
testl .framework 
•fra...ork"ZE 
Running MIEtframework"ZE on iPhone 6 
iPhone 6 
Build Settings 
Resource Tags 
Hide status bar 
Requires full screen 
enera 
Capabilities 
Build Phases 
Build Rules 
Status 
Required 
Required 
. framework,w 
m 
m 
AppDeIegate.h 
AppDeIegate.m 
'"ewControIIer.h 
VI ewControIIer.m 
Main.storyboard 
Assets. xcassets 
App Icons and Launch Images 
App Icons Source Applcon 
Launch mages Source Use Asset Catalog 
Launch Screen File LaunchScreen 
Launch Screen. storyboard 
C) Info.plist 
Supporting Files 
Products 
Embedded Binaries 
testl -framework 
Linked Frameworks and Lbraries 
Name 
testl -framework 
testl -framework 
..in *IMframeworknZ-E 
2ø15-11-1ø 
Xifframework"ZE 
ø63

 

可是這個意味着,剛纔.frame生成的是動態庫,要想生成靜態庫作以下操做。

計算機生成了可選文字:
testl 
test I 
h ZJTool.h 
m ZJTooI.m 
Info.plist 
uc s 
testi) @ 
"zhuzhu"ä iPhone 
PROJECT 
test I 
TARGETS 
testl 
testl 
Build testl : Succeeded 
Resource Tags 
Today at 13:34 
Build Settings 
Build Phases 
mach- 
I e testi 
Build Rules 
test I 
General 
Basic 
Linking 
Combined 
Setting 
Mach-o Type 
Levels + 
Static Library

 

這個時候再次編譯一下,生成的纔是靜態庫。

 

直接測試:

計算機生成了可選文字:
X-XframeworknZE 
testl -framework 
A x-Xfra...ork"ZE 
iPhone 6 
Running MIEtframework"ZE on iPhone 6 
X-Xframework"ZE 
Resource Tags 
Hide status bar 
Requires full screen 
Build Settings 
Build Phases 
Build Rules 
Status 
Required 
General 
Capabilities 
m 
m 
AppDeIegate.h 
AppDeIegate.m 
VI ewControIIer.h 
'"ewControIIer.m 
Main.storyboard 
Launch Screen. storyboard 
App Icons and Launch Images 
App Icons Source Applcon 
Launch mages Source Use Asset Catalog 
Launch Screen File LaunchScreen 
Embedded Binaries 
Add embedded binaries here 
Linked Frameworks and L braries 
testl -framework 
C) Info.plist 
Supporting Files 
Products 
2ø15-11-1ø 
Xifframework"ZE 
974 
. f ramewo

 

上述生成的是debug版本,想生成的release版本,和.a靜態庫的作法是同樣的(參照上面)

 

5.a靜態庫和. framework靜態庫有什麼區別:

.a靜態庫是一個純二進制文件,.framework中除了有二進制文件以外還有資源文件

.a文件不能直接使用,至少要配合.h文件,.framework文件能夠直接使用

.a + .h +sourceFile = . Framework

建議使用. Framework

 

6、靜態庫開發中常見的問題:

(1)有些第三方庫會使用的圖片以及素材,這寫素材放在哪裏?

因爲Xcode默認在編譯的時候,會把全部的素材文件導入到mainbundle中,可能與使用靜態庫文件衝突。

解決方法:在靜態中使用bundle文件夾。在資源圖片等放到這個包中。

計算機生成了可選文字:
Info. plist 
resource. bundle 
ZJTool.h 
ZJTool.m 
test 1 
testl .xcodeproj

(2)若是須要暴露的頭文件過多,怎麼辦?

 

建議用一個主頭文件包含其餘文件,單獨泄露出去。

計算機生成了可選文字:
test I 
test I 
m ZJTooI.m 
Info.plist 
Products 
testl -framework 
testi 
iPhone 6s 
testl Build testl: Succeeded 
Today at 13:50 
UI Test Case 
Class 
Objective-C File 
Metal File 
Choose a template for your new file: 
iOS 
Source 
User Interface 
Core Data 
Apple Watch 
Resource 
Other 
watch OS 
Source 
User Interface 
Core Data 
Resource 
Other 
Cocoa Touch 
Class 
Swift File 
Unit Test Case 
Class 
h 
Header File 
Playground 
c 
C File

 

 

計算機生成了可選文字:
h ZJTool.h 
Headerh 
m ZJTooI.m 
Info.plist 
Products 
testl -framework 
5 
6 
8 
9 
10 
11 
12 
13 
14 
Header. h 
testl 
Created by base on 15/ø9/19. 
Copyright 0 2ø15# base. All 
#ifndef Header h 
#define Header_h

 

 

3)若是想調試靜態庫怎麼辦?建立複合文件!

計算機生成了可選文字:
I 〈 〉 I 復 合 頊 目 的 德 試 1 
Q e 
匚 、 
囗 
General 
Resource Tags 
Build Settings 
Build Phases 
vL . 」 復 合 頊 目 的 德 試 1 
PROJECT 
h AppDelegate.h 
復 合 頊 目 的 德 試 1 
m AppDelegate.m 
TargetDependencies(litem) 
h V•ewController.h 
公 復 合 頊 目 的 德 試 1 
ZJT• 。 。 I( 復 合 琰 目 的 瀏 試 1 , 
m V•ewController.m 
Main.storyboard 
添 加 依 
LaunchScreen.storyboard 
InfO.pliSt 
C 。 " Sources e " , 
L 」 
, Link BinaryWith Li 「 m 
CopyBundleResources(3items) 
, 、 復 合 頊 目 的 德 試 1 . app 
, 丿 libZJT001.a 
匈 霪 一 硬 目 
, 點 擊 下 面 的 + 鬲 . 懂 加 千 個 的 傑 訌 
胚 要 愫 一 個 俄 ,

 

計算機生成了可選文字:
•Delegate.h 
•Delegate.m 
ntroller.h 
ntroller.m 
in.storyboard 
InchScreen.storyboard 
).plist 
»orting Files 
Moo I.a 
iPhone 6s Plus Running on iPhone Es Plus 
Resource Tags 
Build Settings 
Drag to reorder frameworks 
Build Phases 
Build Rules 
Status 
Required 
General 
Capabilities 
cies (I item) 
ZJTool 
Conwe Sources (3 items) 
Link Binary Wit LiVaries (I item) 
libZJTool.a 
Copy Bundle Resowces (3 items)

 

測試:

計算機生成了可選文字:
h AppDeIegate.h 
m AppDeIegate.m 
h V•ewControIIer.h 
m "ewControIIer.m 
Main.storyboard 
Assets. xcassets 
Launch Screen. storyboard 
Info.plist 
Supporting Files 
17 — 
20 
22 — 
26 
8 
9 
10 
11 
12 
13 
14 
15 
16 
18 
19 
21 
23 
24 
25 
27 
-touchesBegan:with 
#import "ViewController. h" 
#import "ZJTool. h" 
@interface ViewController ( ) 
cend 
@implementation ViewController 
(void) viewDidLoad 
(super viewDidLoadJ ; 
// Do any additional setup after loading the view, 
typically from a nib. 
(void) touchesBegan: (NSSet«UITouch *)touches withEvent: 
(UIEvent *)event 
IZJT001 log); 
2ø15-11-1ø 
U Tool 
h ZJTool.h 
m ZJTooI. m 
Products 
. app 
libZJTool.a

 

如今就能夠任意調試:

計算機生成了可選文字:
000 
iPhone 6s Plus Running on iPhone Es Plus 
(h ) CO ZJTool)ö ZJTool.m ) O *log 
16 
rights 
rese rve 
2 
5 
6 
8 
9 
10 
12 
13 
14 
17 
18 
ZJT001.m 
ZJT001 
Created by base on 15/ø9/19. 
Copyright 0 2ø15# base. All 
#import "ZJTool. h" 
+ (void) log 
NSLog 
cend 
h AppDeIegate.h 
m AppDeIegate.m 
h V•ewControIIer.h 
m V•ewControIIer.m 
Main.storyboard 
Assets. xcassets 
Launch Screen. storyboard 
Info.plist 
Supporting Files 
h ZJTool.h 
m ZJTooI.m 
Products 
. app 
libZJTool.a 
El 
self (Class) 
U Tool 
LIÜ141( 
) Thread 1 ) n 0 41ZJTool 
(Udb)

 

(4)將模擬器和真機的靜態庫結合:

計算機生成了可選文字:
Products — bash — 80x24 
Last 10 in: Tue Nov le on tt seeø 
dDa ta/ tes t—ctce rugazcl Ivshezqjaqaznvjed/BuiId/P roducts/Debug—iphoneos/Iib test . a 
/ Use rs/ base/ Lib ra ry.' Deve lope r/Xcode/De rivedDa ta/test—ctce rugazcl Ivshezqj aqaznvj 
d/BuiId/Products/Debug—iphonesimuIator/Iibtest.a —output zonghe.a 
bases cd 'Users/ base/ LibrarWDeveIope rivedData/tes 
base eMacBoo —Pro: Pro uc s ase 
IPO —create 
ser s ase L r ary eve oper co 
e/ De rived Data/ test—ctce rug a z c I Ivshezqj aqaznvjed/BuiId/Products/Debug—iphoneos/Ii 
btest.a /Users/base/Library/DeveIoper/Xcode/DerivedData/test—ctcerugazcIIvshezqj 
aqaznvjed/BuiId/Products/Debug—iphonesimu Iato r/ Iibtest . 
basedeMacBook—Pro: Products bases 
Drive 
rDrop 
ktop 
Debug-iphoneos 
Debug-iphoneos 
Debug-iphonesimulator 
Release-iphoneos 
Release-iphonesimulator 
zonghe.a 
include 
libtest.a 
h ZJTools.h

 

可是,這個生成的綜合文件的大小是模擬器和真機綜合的2倍,因此通常不建議使用合併的。

 

mrc中生成的項目,打包成靜態庫,能夠在arc環境下直接使用

1、先將環境改爲mrc。

 

若是隻有個別的mrc的文件,能夠單獨改爲的mrc環境下的。

 

可是有不少mrc文件的話,須要打包成靜態庫

 

若是想生成真機和模擬器經過的文件,能夠這樣操做

 

可是整個包會變得比較大,不多用。

相關文章
相關標籤/搜索