---
title: Install on macOS
---
> ## Documentation Index
> Fetch the complete documentation index at: https://docs.page/Lyokone/flutterlocation/llms.txt
> Use this file to discover all available pages before exploring further.

# Install on macOS

## Swift Package Manager

The `location` plugin is distributed as a Swift package only; it has no
CocoaPods podspec. Swift Package Manager is on by default since Flutter 3.44,
so there is nothing to set up. If you turned it off, turn it back on:

```bash
flutter config --enable-swift-package-manager
```

and, if your app's `pubspec.yaml` turns it off, remove that setting:

```yaml name="pubspec.yaml"
flutter:
  config:
    enable-swift-package-manager: false # remove this line
```

Your app can still use CocoaPods for other plugins; Flutter integrates both
side by side.

If you embed Flutter in an existing native app, build it with
`flutter build swift-package`. `flutter build ios-framework` and
`flutter build macos-framework` only install plugins through CocoaPods, so they
leave `location` out.

## Info.plist

In order to request location permissions, you need to add the following to your
`macos/Runner/Info.plist`:

```
<key>NSLocationWhenInUseUsageDescription</key>
<string>The app needs the location</string>
```

The string will appear in the popup when the user is asked to grant location
permissions.

## Sandboxed application

Ensure that the application is properly "sandboxed" and that the location is
enabled. You can do this in Xcode with the following steps:

1. In the project navigator, click on your application's target. This should
   bring up a view with tabs such as "General", "Capabilities", "Resource Tags",
   etc.
2. Click on the "Signing and Capabilities" tab. This will give you a list of
   items such as "App Groups", "App Sandbox", and so on. Each item will have an
   "On/Off" button.
3. Turn on the "App Sandbox" item and press the ">" button on the left to show
   the sandbox informations.
4. In the "App Data" section, select "Location".

## About macOS

The location is not precise while using macOS since the computers don't have a
GPS. Some settings will have no effect in order to keep the location as precise
as possible.
