xcode7 dylib換為tbd

Xcode7中 Link Binary With Libraries 沒有.dylib庫,只能找到對應的.tbd,但不能代替使用,通過查找資料,嘗試后得到以下兩種解決方法。

方法1. (heqin測試可行)在項目Target中的Link Binary With Libraries 手動添加

首先點擊 “+”

顯示搜索添加頁面,在這里如果搜索之前的libsqlite3.dylib是搜不出來ios9之前的。所以需要點擊 Add Other,出現文件目錄頁面,正常情況這里去通過Finder也是找不到老的libsqlite3.dylib文件的,因為這個文件是隱藏掉的。所以需要按 打開finder,輸入

快捷鍵 CMD+Shift+G (Go to the folder),輸入/usr/lib后,進入隱藏的界面,然后添加你需要的 *.dylib,如libsqlite3.dylib文件。即可。

方法2(尚未測試).Build Phases 配置

project -> Build Settings ->Linking -> Other Linker Flag

添加 -l< 所需 dylib 的名稱 >

例如:libsqlite3.dylib -> -lsqlite3

為什么用tbd文件代替dylib文件的一種解釋。

http://stackoverflow.com/questions/31450690/why-xcode-7-shows-tbd-instead-of-dylib

So it appears that the .dylib file is the actual library of binary code that your project is using and is located in the /usr/lib/ directory on the user's device. The .tbd file, on the other hand, is just a text file that is included in your project and serves as a link to the required .dylib binary. Since this text file is much smaller than the binary library, it makes your app's download size smaller.

tbd文件類似于dylib文件的鏈接,可以使app變得更小。

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容