如何添加"目标"到一个pod文件? (例如HockeyApp)

时间:2017-02-15 23:32:29

标签: react-native cocoapods

我正在阅读Crysfel Villa,Stan Bershadskiy的React Native Cookbook

我在关于使用hockeyapp的章节中并不确定如何设置podfile。这些是方向:

  

怎么做......   首先,我们需要安装react-native-hockeyapp   模块在我们的应用程序打开终端,转到您的应用程序   根项目目录并输入以下命令:$ npm install   react-native-hockeyapp --save进入你的ios /目录并且   初始化您的Podfile:$ pod init打开您的Podfile并添加pod   " HockeySDK"到你的目标。回到终端,安装Podfile:   $ pod install

我不是百分百肯定"将pod HockeySDK添加到您的目标"

我的podfile:

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'MyApp' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for MyApp

  target 'MyApp-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end

  target 'MyAppTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

target 'MyApp-tvOS' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for MyApp-tvOS

  target 'MyApp-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

如何正确修改pod文件?

1 个答案:

答案 0 :(得分:0)

如果您想在HockeySDK目标中添加MyApp模块(这是您正在构建的应用),您只需添加pod 'HockeySDK'这样的行:

target 'MyApp' do
   (...)
   pod 'HokeySDK'
   (...)
end

然后运行pod install打开.xcworkspace文件而不是.xcproj。您可以在官方CocoaPods指南中找到更多信息。