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

# Location simulation

UX Framework provides the ability to simulate location for debug purposes. It might be useful when you need to test your application in a particular location, but have no ability to simulate location. Once you enable location simulation it allows you to specify a default location, manage simulated location on UI and simulate navigation along the route.

> **Note**
> 
> Enabled Location Simulation does not allow you to use another location provider simultaneously.

There are two ways of simulating location and routes:

#### Debug Settings - Simulate Location (recommended)

To enable location simulation you must enable it by passing `showSimulateLocationOption = true` in `debugSettings`. See the code block below for reference and learn more about debug settings in the [`DashDebugSettingsConfigInit`](https://docs.mapbox.com/android/navigation/api/uxframework/1.28.0/dash-config/com.mapbox.dash.sdk.config.api/-dash-debug-settings-config-init/). Once enabled, the "Testing Tools" menu of the app will now include "Simulate Location".

```kotlin
Dash.init(
   applicationContext = applicationContext,
   accessToken = getString(R.string.mapbox_access_token)
) {
   debugSettings {
      showSimulateLocationOption = true
   }
}
```

When the "Simulate Location" option is enabled in the app:

-   During navigation sessions, the location is automatically simulated along the route.
-   To manually change the location, long-press on the map to teleport to a new location.

#### Default location simulation

To turn on location simulation mode you will need to enable it through the configuration and specify a coordinate as default location for the simulation mode.

```kotlin
Dash.init(
   applicationContext = applicationContext,
   accessToken = getString(R.string.mapbox_access_token)
) {
   locationSimulation {
      defaultLocation = Location(LocationManager.PASSIVE_PROVIDER).apply {
          latitude = 38.899929
          longitude = -77.03394
      }    
   }
}
```