<html devsite>
<head>
  <meta name="project_path" value="/_project.yaml">
  <meta name="book_path" value="/versions/7.5.0/_book.yaml">
</head>
<body>

<h1 class="page-title" id="modules.apple_platform">apple_platform</h1>

{% dynamic setvar source_file "src/main/java/com/google/devtools/build/lib/starlarkbuildapi/apple/ApplePlatformApi.java" %}
{% dynamic setvar version "7.5.0" %}
{% dynamic setvar original_path "/rules/lib/builtins/apple_platform" %}
{% include "_buttons.html" %}
<!-- {% raw %} -->

Corresponds to Xcode's notion of a platform as would be found in <code>Xcode.app/Contents/Developer/Platforms</code>. 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 <code>x86_64</code> and <code>i386</code> architectures.<p>Specific instances of this type can be retrieved from the fields of the <a href='../toplevel/apple_common.html#platform'>apple_common.platform</a> struct:<br><ul><li><code>apple_common.platform.ios_device</code></li><li><code>apple_common.platform.ios_simulator</code></li><li><code>apple_common.platform.macos</code></li><li><code>apple_common.platform.tvos_device</code></li><li><code>apple_common.platform.tvos_simulator</code></li><li><code>apple_common.platform.watchos_device</code></li><li><code>apple_common.platform.watchos_simulator</code></li></ul><p>More commonly, however, the <a href='../fragments/apple.html'>apple</a> configuration fragment has fields/methods that allow rules to determine the platform for which a target is being built.<p>Example:<br><pre class='language-python'>
p = apple_common.platform.ios_device
print(p.name_in_plist)  # 'iPhoneOS'
</pre>

<h2>Members</h2>
<ul>
    <li>
    <a href="#is_device">is_device</a>
  </li>
      <li>
    <a href="#name_in_plist">name_in_plist</a>
  </li>
      <li>
    <a href="#platform_type">platform_type</a>
  </li>
  </ul>

      <h2 id="is_device">is_device</h2>
        <p><pre class="rule-signature"><a class="anchor" href="../core/bool.html">bool</a> apple_platform.is_device</pre></p>

    Returns <code>True</code> if this platform is a device platform or <code>False</code> if it is a simulator platform.


        <h2 id="name_in_plist">name_in_plist</h2>
        <p><pre class="rule-signature"><a class="anchor" href="../core/string.html">string</a> apple_platform.name_in_plist</pre></p>

    The name of the platform as it appears in the <code>CFBundleSupportedPlatforms</code> entry of an Info.plist file and in Xcode's platforms directory, without the extension (for example, <code>iPhoneOS</code> or <code>iPhoneSimulator</code>).<br>This name, when converted to lowercase (e.g., <code>iphoneos</code>, <code>iphonesimulator</code>), can be passed to Xcode's command-line tools like <code>ibtool</code> and <code>actool</code> when they expect a platform name.


        <h2 id="platform_type">platform_type</h2>
        <p><pre class="rule-signature"><a class="anchor" href="../builtins/apple_platform_type.html">apple_platform_type</a> apple_platform.platform_type</pre></p>

    Returns the platform type of this platform.



</body>
</html>

<!-- {% endraw %} -->
