【发布时间】:2017-08-03 15:51:51
【问题描述】:
我正在尝试将 Google 移动广告 SKD 安装到我的 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,因为我真的不需要测试我的 UI 或任何 sn-p 代码。 我正在考虑删除这两个文件夹。
我的问题是,
1) 从我的 Xcode 项目中删除 Tests 和 UITests 文件夹有什么缺点吗?如果我这样做了,我可以直接从我的 Podfile 中删除这两个目标吗?
2) 假设我要保留这两个目标。我是否必须将吊舱添加到所有三个目标?或者这两个嵌套的目标是否继承了目标“立方”的任何豆荚
3) 我是否需要将 Google 移动广告 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
【问题讨论】: