如何为少数平台创建库Pod?

时间:2015-10-16 08:28:39

标签: ios xcode macos cocoapods

我将为多个平台创建自己的Cocoapod(让我们说iOSOSX),因为它没有严格的平台依赖性。我已在s.platform文件中未指定.podspec。尝试使用pod lib lint进行lint时,我会收到错误:

- ERROR | [tvOS] xcodebuild: Returned an unsuccessful exit code. You can use `--verbose` for more information.
- NOTE  | [tvOS] xcodebuild:  xcodebuild: error: SDK "appletvsimulator" cannot be located.

显然它试图为tvOS平台构建并失败。我已经搜索了一些关于这样的问题,但我没有找到任何东西。

任何解决方案?实际上我不需要测试tvOS的构建,所以我怎样才能设置osx和ios支持。

PS。 XCode 7.0.1

2 个答案:

答案 0 :(得分:0)

我不确定这是否正确但它对我有用。 只需在drwxrwxrwx 521 mc-zone staff 17714 10 17 19:20 .npm -rw------- 1 mc-zone staff 56 10 17 17:01 .npmrc drwxrwxrwx 5 mc-zone staff 170 10 17 16:57 .nvm drwxrwxrwx 4 mc-zone staff 136 10 16 23:15 _dev 文件中使用多个平台声明:

.podspec

可能是部署目标声明:

s.platform = :ios
s.platform = :osx

此外,由于该库支持多个平台,您需要根据“Pods”的“Base SDK”进行选择。

答案 1 :(得分:0)

如果您要定位iOS和tvOS,这就是一个例子。

Pod::Spec.new do |s|

s.name        = 'SVGgh'
s.version     = '1.5.1'
s.license     = 'MIT'
s.tvos.deployment_target = '9.0'
s.ios.deployment_target = '7.0'

s.summary     = "SVG Rendering Library for iOS"
s.homepage = 'https://github.com/GenerallyHelpfulSoftware/SVGgh'
s.source   = { :git => 'https://github.com/GenerallyHelpfulSoftware/SVGgh.git', :tag => "v1.5.1" }

s.ios.source_files = 'SVGgh/**/*{.h,m}'
s.tvos.source_files = 'SVGgh/**/*{.h,m}'
s.framework = 'CoreGraphics', 'CoreImage', 'CoreText', 'UIKit', 'Foundation'
s.prefix_header_file = 'SVGgh/SVGgh-Prefix.pch'
s.requires_arc = true
end

我认为这需要将Cocoapods库更新到0.39或更高。请注意,您可以为每个平台选择一组不同的源文件。

[更新以回应评论,表明提问者并不想要tvOS。]。