> For the complete documentation index, see [llms.txt](https://docs.mapbox.com/help/llms.txt)

# Run the Maps SDK for iOS Examples App

Mapbox provides a robust **Examples app** to show various best practices and techniques for building with the [Maps SDK for iOS](https://docs.mapbox.com/ios/maps/). This tutorial shows the steps necessary to get the demo app running on an iOS emulator via Xcode in your development environment.

To start building your own app using the Maps SDK, see our [Get Started with the Maps SDK for iOS](https://docs.mapbox.com/ios/maps/guides/install/) guide.

Your browser doesn't support HTML5 video. Open [link to the video](https://docs.mapbox.com/help/help/assets/medias/tutorials--maps-sdk-ios-examples-app--launch-986eb20fc79324e7db0a8b518b7980be.mp4).

## Configure Credentials

### Step 1: Log in/Sign up for a Mapbox account

If you haven't done so already, [sign up for a Mapbox account](https://account.mapbox.com/auth/signup) and or [log in to your existing account](https://console.mapbox.com).

### Step 2: Configure your public token

Create a new file `.mapbox` in your user directory (`~/.mapbox`) containing a public access token. You can use your [default public token](https://console.mapbox.com/account/access-tokens/) for this value.

```text
pk.12345...
```

## Clone the `mapbox-maps-ios` repository with me

The examples app lives in a the `Apps/Examples` directory of the Maps SDK for iOS code, [available on GitHub](https://github.com/mapbox/mapbox-maps-ios). Use git to clone the repository on your development machine.

```nix
$ git clone git@github.com:mapbox/mapbox-maps-ios.git
```

## Open the Examples Project

1.  Launch Xcode, then choose **File > Open...**
2.  Choose the `Examples.xcodeproj`.

![Screenshot of the file picker showing which file to open](https://docs.mapbox.com/help/assets/ideal-img/tutorials--maps-sdk-ios-examples-app--open.43e6818.480.png)

Now you should see the **Examples** project successfully loaded in the Project Navigator pane.

![Screenshot from Xcode showing the Examples project](https://docs.mapbox.com/help/assets/ideal-img/tutorials--maps-sdk-ios-examples-app--xcode.7c8ab4f.480.png)

## Run the App

Be sure you have an iOS emulator selected, then click the **Run** button. Xcode will build and run the Maps SDK for iOS examples app on your emulator.

You will see a listing with the title and description for each example, grouped by category. Tap each example to explore and learn the capabilities of the Mapbox Maps SDK for iOS, including [user location](https://docs.mapbox.com/ios/maps/guides/user-location/), [markers and annotations](https://docs.mapbox.com/ios/maps/guides/markers-and-annotations/), [camera control and animation](https://docs.mapbox.com/ios/maps/guides/camera-and-animation/), and [offline use](https://docs.mapbox.com/ios/maps/guides/offline/).

Your browser doesn't support HTML5 video. Open [link to the video](https://docs.mapbox.com/help/help/assets/medias/tutorials--maps-sdk-ios-examples-app--launch-986eb20fc79324e7db0a8b518b7980be.mp4).

If the app loads but you see a black background where the map should be, this means that the public access token was not properly configured and network requests for Mapbox resources are failing.

A build script reads your public access token from `~/.mapbox` and sets the value `MBXAccessToken` in the example app's `Info.plist` file.

Try inspecting the `Info.plist` to confirm that `MBXAccessToken` exists and contains the correct public access token value, then run the app again.

![](https://docs.mapbox.com/help/assets/ideal-img/tutorials--maps-sdk-ios-examples-app--black-screen.5d2d3f4.480.png)

## Explore the source code

Each example lives in its own swift file, and you can explore the source code as you preview the examples in the emulator to learn how each example works. You may also want to change values and hot reload the app to change the functionality.

A good first customization might be to update the initial camera settings in `BasicMapExample.swift`, the source code for the *Display a map view* example. See if you can make the map initialize on a different location by updating the `center` coordinates in `CameraOptions`. You can also experiment with different values for `zoom`, `bearing`, and `pitch`,

![Screenshot from Xcode showing example source code](https://docs.mapbox.com/help/assets/ideal-img/tutorials--maps-sdk-ios-examples-app--code.1e65245.480.png)

## Next steps

With the Examples app running locally, you're ready to start exploring all the possibilities of the Maps SDK for iOS as you build maps into your iOS apps. Be sure to explore the [SDK's documentation](https://docs.mapbox.com/ios/maps/) to level up, and share questions and lessons learned in the [Mapbox Developer Discord](https://discord.com/invite/uMpcC5RmJh).

> **Related content (guide): [Get Started with the Maps SDK for iOS](https://docs.mapbox.com/ios/maps/guides/install/)**
> 
> This guide walks you through integrating the Maps SDK for iOS into your application, configuring your credentials, and adding a map to your app.

> **Related content (example): [Add a marker to the map](https://docs.mapbox.com/ios/maps/examples/point-annotation/)**
> 
> This example shows you how to add a marker to a Point of Interest (POI), using a `point annotation`.

> **Related content (guide): [User location](https://docs.mapbox.com/ios/maps/guides/user-location/)**
> 
> This guide shows you how to access the user's location from your app.