<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.1.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ExtensionFoundation",
  "identifier" : "/documentation/ExtensionFoundation/AppExtension/main()-w0u9",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "ExtensionFoundation"
    ],
    "preciseIdentifier" : "s:19ExtensionFoundation03AppA0P0A3KitAD0cA18SceneConfigurationV0F0RtzrlE4mainyyKFZ"
  },
  "title" : "main()"
}
-->

# main()

The main entry point for an app extension that doesn’t present any UI.

```
static func main() throws
```

## Discussion

Don’t call this method directly. When the host launches your app extension in a new
process, the system calls this method to create your custom [`AppExtension`](/documentation/ExtensionFoundation/AppExtension) type and
prepare your extension for requests from the host app.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)