Open pikacode opened 8 years ago
What is the .tbd
?
In Xcode 7 it changes from ".dylib" to ".tbd"
I don't know what the purpose of those tbd
s are (I suspect they're just stubs from cat
ing a few of them), but having .dylib
in the Xcodeproj seems to have the same effect?
There is no .dylib
anymore,.tbd
instead
Maybe this can help:
http://stackoverflow.com/questions/31450690/why-xcode-7-shows-tbd-instead-of-dylib
And all the .dylib
can't be used such as:
Also can't be searched out :
You can hava a try with Xcode 7 : )
Actully .dylib
s can be found at /usr/lib
,but Xcode 7 use bitcode for reducing the size of code as default,.tbd
s are used as reference to the .dylib
s,I guess so....
hi, @Yasashi ,
Have you found the solution for adding .tbd file?
@tennysondy
i add a method to extend Xcodeproj
, and then judge Xocde version. it works for me ^^
ps:i am ios native developer, maybe it's not the best code for rb, first time to write rb...
require 'xcodeproj'
# extend
module Xcodeproj
class Project
module Object
class AbstractTarget < AbstractObject
def add_system_library_tbd(names)
Array(names).each do |name|
path = "usr/lib/lib#{name}.tbd"
files = project.frameworks_group.files
unless reference = files.find { |ref| ref.path == path }
reference = project.frameworks_group.new_file(path, :sdk_root)
end
frameworks_build_phase.add_file_reference(reference, true)
reference
end
end
end
end
end
end
# get Xcode version
xcode_version_path = "/Applications/Xcode.app/Contents/version.plist"
xcode_version = 0
if File.exists?(xcode_version_path)
find = 0
open(xcode_version_path,"r") do |file|
file.each_line do |line|
if find == 1
xcode_version = line.delete("<string>").delete("</string>")
puts "Xcode version:#{xcode_version}"
while(xcode_version.length > 4)
xcode_version = xcode_version.chop
end
break
end
if line.include?"CFBundleShortVersionString"
find = 1
end
end
end
else
puts "Please install Xcode under the directory '/Applications/' "
exit
end
# select method
if xcode_version.to_i >= 7
target.add_system_library_tbd("z")
else
target.add_system_library("z")
end
@tennysondy 晕,都特么中国人,你说什么英文。。。
@Yasashi 非常感谢,我也是发了之后才发现你是中国人,哈哈~~~
@Yasashi 本来想直接找你聊的,发现github上不能直接联系
哎呦!好屌
Hi: I'm trying:
target.add_system_libraries("z")
the "libz.dylib" has been added,but not the "libz.tbd" I looked for "/lib/xcodeproj/project/object/native_target.rb",it's:path = "usr/lib/lib#{name}.dylib"
Is there any way to add "libz.tbd"?