使用Cocoapods可以针对多个平台

时间:2019-06-04 19:49:26

标签: ios macos cocoapods

我想尝试使用新的Apple Catalyst项目(将iOS应用移植到macOS)使Firebase SDK适用于iOS和macOS应用。

我已经使用Cocoapods设置了我的Xcode项目,并且使用此pod文件可以正常工作:

platform :ios, '11.0'

abstract_target 'SharedPods' do
    use_frameworks!
    pod 'Perform'
    pod 'Nuke', '~> 7.6.1'
    pod 'PureLayout'
    pod 'DeviceKit', '~> 2.0'
    pod 'lottie-ios'
    pod 'Highlightr'
    pod 'Firebase/Core'
    pod 'Firebase/Database'
    pod 'Firebase/Auth'
    pod 'Fabric'
    pod 'Crashlytics'
    pod 'GoogleAPIClientForREST/Sheets'
    pod 'GoogleSignIn'
    pod 'SwiftLint'

    target 'xxxxx-app' do
    end

    target 'xxxxx' do
    end
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
     target.build_configurations.each do |config|
        config.build_settings['LD_NO_PIE'] = 'NO'
     end
  end
end

但是,如何添加它,以便它也可以使用相同的目标(pod文件中的xxxxx-app)为macOS构建。

1 个答案:

答案 0 :(得分:1)

使用Catalyst开发Firebase

  

安装Catalina和Xcode 11。

     

对于https://github.com/firebase/firebase-ios-sdk中的每个podspec,运行

     
      
  • pod gen {name here} .podspec --local-sources =。/ --auto-open
  •   
  • 在App-iOS构建设置中选中Mac框
  •   
  • 在“设置签名和功能”标签中对应用进行签名
  •   
  • 在项目管理器中单击窗格
  •   
  • 向iOS主机应用和单元测试目标添加签名
  •   
  • 选择单位制方案
  •   
  • 运行它以进行构建和测试
  •   

来源:https://github.com/firebase/firebase-ios-sdk/issues/3144#issuecomment-520530306

相关问题