我正在使用xcrun编译我想要在AppleTV应用程序中使用的动态库。
使用此命令,我可以编译dylib并在OS中使用:
➜ logger git:(master) ✗ ls
main.swift
➜ logger git:(master) ✗ xcrun swiftc -emit-library main.swift
➜ logger git:(master) ✗ ls
libmain.dylib main.swift
➜ logger git:(master) ✗ file libmain.dylib
libmain.dylib: Mach-O 64-bit dynamically linked shared library x86_64但是,我不能在AppleTV模拟器中使用它。dlopen命令返回nil。
然后,我尝试了一些参数,比如低音,但是不能正常工作。
➜ logger git:(master) ✗ xcrun swiftc -emit-library -sdk $(xcrun --show-sdk-path --sdk appletvsimulator10.1) main.swift
<unknown>:0: warning: using sysroot for 'AppleTVSimulator' but targeting 'MacOSX'
ld: warning: URGENT: building for OSX, but linking against dylib (/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator10.1.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation) built for tvOS. Note: This will be an error in the future.
ld: warning: URGENT: building for OSX, but linking against dylib (/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator10.1.sdk/usr/lib/libobjc.dylib) built for tvOS. Note: This will be an error in the future.
ld: warning: URGENT: building for OSX, but linking against dylib (/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator10.1.sdk/usr/lib/libSystem.dylib) built for tvOS. Note: This will be an error in the future.如何将我的Swift代码编译成在AppleTV中使用的动态库?
发布于 2017-05-02 01:32:18
模拟器:
xcrun swiftc -emit-library -sdk $(xcrun --show-sdk-path --sdk appletvsimulator10.2) main.swift对于物理装置:
xcrun swiftc -emit-library -sdk $(xcrun --show-sdk-path --sdk appletvos10.2) main.swifthttps://stackoverflow.com/questions/43018954
复制相似问题