Method: Pod::Podfile::DSL#platform

Defined in:
lib/cocoapods-core/podfile/dsl.rb

#platform(name, target = nil) ⇒ void

This method returns an undefined value.

Specifies the platform for which a static library should be built.

CocoaPods provides a default deployment target if one is not specified. The current default values are 4.3 for iOS, 10.6 for OS X, 9.0 for tvOS, 1.0 for visionOS and 2.0 for watchOS.

If the deployment target requires it (iOS < 4.3), armv6 architecture will be added to ARCHS.

Examples:

Specifying the platform


platform :ios, '4.0'
platform :ios

Parameters:

  • name (Symbol)

    the name of platform, can be either :osx for OS X, :ios for iOS, :tvos for tvOS, :visionos for visionOS, or :watchos for watchOS.

  • target (String, Version) (defaults to: nil)

    The optional deployment. If not provided a default value according to the platform name will be assigned.



594
595
596
597
598
# File 'lib/cocoapods-core/podfile/dsl.rb', line 594

def platform(name, target = nil)
  # Support for deprecated options parameter
  target = target[:deployment_target] if target.is_a?(Hash)
  current_target_definition.set_platform!(name, target)
end