IMPORTANT: The Bazel docs have moved! Please update your bookmark to https://bazel.build/rules/lib/apple_platform You can read about the migration, and let us know what you think.Extensions > API reference > apple_platform
apple_platformCorresponds to Xcode's notion of a platform as would be found in
Xcode.app/Contents/Developer/Platforms. Each platform represents an Apple platform type (such as iOS or tvOS) combined with one or more related CPU architectures. For example, the iOS simulator platform supports
Specific instances of this type can be retrieved from the fields of the apple_common.platform struct:
More commonly, however, the apple configuration fragment has fields/methods that allow rules to determine the platform for which a target is being built.
p = apple_common.platform.ios_device print(p.name_in_plist) # 'iPhoneOS'
Trueif this platform is a device platform or
Falseif it is a simulator platform.
string apple_platform.name_in_plistThe name of the platform as it appears in the
CFBundleSupportedPlatformsentry of an Info.plist file and in Xcode's platforms directory, without the extension (for example,
This name, when converted to lowercase (e.g.,
iphonesimulator), can be passed to Xcode's command-line tools like
actoolwhen they expect a platform name.
apple_platform_type apple_platform.platform_typeReturns the platform type of this platform.