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变得更小。

你可能感兴趣的:(xcode7 dylib换为tbd)