【问题标题】:How to Add a "Target" to a pod file? (such as HockeyApp)如何将“目标”添加到 pod 文件? (例如 HockeyApp)
【发布时间】:2017-07-04 20:46:24
【问题描述】:

我正在阅读 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

我不是 100% 确定 “将 pod HockeySDK 添加到您的目标”

我的播客文件:

# 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 文件吗?

【问题讨论】:

    标签: react-native cocoapods


    【解决方案1】:

    如果你想在MyApp 目标(这是你正在构建的应用程序)中包含HockeySDK 模块,你只需要像这样添加pod 'HockeySDK' 行:

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-11-27
      • 2020-07-18
      • 2021-09-08
      • 2021-07-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-10-25
      相关资源
      最近更新 更多