OGeek|极客世界-中国程序员成长平台

标题: ios - Cocoapods:iOS 应用中的 OS X 测试应用? [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 17:55
标题: ios - Cocoapods:iOS 应用中的 OS X 测试应用?

我有一个 iOS 应用,我们称之为 Potato。它在 PotatoServiceTest 子目录中有一个名为 PotatoServiceTest 的命令行 OS X 实用程序。这两个都使用(当前)单个 pod,AFNetworking

过去,我只会使用两者中的 AFNetworking git 子模块。但我真的很想在这里尝试一下 Cocoapods。如何配置我的 Podfile?

我的 Podfile 目前看起来像这样:

xcodeproj 'otato.xcodeproj'
target 'otato' do
    pod 'AFNetworking', '~> 3.0'
end

我的理解是这应该是我需要的:

xcodeproj 'otato.xcodeproj'
xcodeproj 'otatoServiceTest/PotatoServiceTest.xcodeproj'

target 'otato' do
    pod 'AFNetworking', '~> 3.0'
end

target 'otatoServiceTest' do
    pod 'AFNetworking', '~> 3.0'
end

但是,我收到一个错误:

[!] Unable to find a target named `Potato`

我还能尝试什么?



Best Answer-推荐答案


您当前的 Podfile(只有一个 xcodeproj 指令的 Podfile)很好。运行 pod install 将创建一个新的 Potato 工作区(Potato.xcworkspace)。然后,您只需在您的 Potato 工作区中添加 PotatoServiceTest.xcodeproj,AFNetworking 也将可用于您的 PotatoServiceTest 目标。

关于ios - Cocoapods:iOS 应用中的 OS X 测试应用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34421481/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4