Search code examples
swiftxcodecocoacocoapodspodfile

Pod Init with default option set to OSX & not IOS for CocoaPods in Swift using Xcode?


I closed my Xcode project & went into the project directory & typed

pod init

And it made a Podfile like

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

target 'Test1' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for Test1

end

Notice the 2nd line - platform :ios, '9.0' but mine is a Mac Desktop app

So I had to manually change it to use platform :osx, '10.12'

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

target 'Test1' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for Test1

end

Is there an option to directly create one for Mac Desktop App like pod init --mac or something like that?


Solution

  • There is no option --mac or anything equivalent at this moment.

    You can check all the available options for pod init here: https://guides.cocoapods.org/terminal/commands.html#pod_init