我正在尝试将Google移动广告SDK安装到我的Xcode项目中。我已经安装了Cocoapods,然后在我的项目中初始化了一个Podfile:
# Uncomment the next line to define a global platform for your project
platform :ios, '10.2'
target 'Cubical' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for Cubical
target 'CubicalTests' do
inherit! :search_paths
# Pods for testing
end
target 'CubicalUITests' do
inherit! :search_paths
# Pods for testing
end
end
然而,我不明白为什么我的主项目(Cubical)中会有目标。我从来没有真正使用过CubicalTests或CubicalUITests,因为我不需要测试我的界面或任何代码片段。我考虑删除这两个文件夹。
我的问题是:
1)从我的Xcode项目中删除Tests和UITests文件夹是否有任何缺点?如果我这样做,我是否可以简单地从Podfile中删除这两个目标?
2)假设我要保留这两个目标。我是否需要将pod添加到所有三个目标中?还是两个嵌套的目标继承了'Cubical'目标的所有pods?
3)我需要将Google Mobile Ads SDK添加到链接的框架中吗?还是Cocoapods已经完成了这项工作?
我的最终pod如下所示:
# Uncomment the next line to define a global platform for your project
platform :ios, '10.2'
target 'Cubical' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
pod 'Google-Mobile-Ads-SDK'
# Pods for Cubical
target 'CubicalTests' do
inherit! :search_paths
# Pods for testing
end
target 'CubicalUITests' do
inherit! :search_paths
# Pods for testing
end
end