---
title: "Sentry Local (Spotlight)"
description: "Learn how to send Sentry events from your Android app to Sentry Local (Spotlight) on your development machine."
url: https://docs.sentry.io/platforms/android/integrations/spotlight/
last_updated: 2026-12-05T20:08:11.000Z
---

# Sentry Local (Spotlight) for Android

Sentry Local (Spotlight) lets you inspect your app's errors, traces, and logs on your development machine while you develop. The SDK sends a copy of every Sentry event to [`sentry local`](https://cli.sentry.dev/commands/local/), a local server from Sentry CLI that prints events in your terminal and shows them in the [Sentry Local](https://local.sentry.dev) viewer.

The `sentry-spotlight` module provides a `SpotlightIntegration` that sends a copy of all Sentry events to the local server. By using `debugImplementation`, you can ensure the integration is excluded from release builds, preventing insecure HTTP URLs from leaking into production APKs.

## [Install](https://docs.sentry.io/platforms/android/integrations/spotlight.md#install)

We recommend using `debugImplementation` so the `sentry-spotlight` dependency is excluded from release builds:

```groovy
debugImplementation 'io.sentry:sentry-spotlight:8.67.0'
```

*Other available variations of the above snippet: kotlin*

If you need Sentry Local in all build types, use `implementation` instead of `debugImplementation`.

## [Configure](https://docs.sentry.io/platforms/android/integrations/spotlight.md#configure)

**XML**

```xml
<application>
    <!-- Enable Spotlight -->
    <meta-data
    android:name="io.sentry.spotlight.enable"
    android:value="true"
  />
    <!-- Optional: override the default Spotlight URL -->
    <meta-data
    android:name="io.sentry.spotlight.url"
    android:value="http://10.0.2.2:8969/stream"
  />
</application>
```

**Java**

```java
import io.sentry.android.core.SentryAndroid;

SentryAndroid.init(this, options -> {
    options.setDsn("https://<key>@o<orgId>.ingest.sentry.io/<projectId>");
    options.setEnableSpotlight(true);
    // Optional: override the default Spotlight URL
    options.setSpotlightConnectionUrl("http://10.0.2.2:8969/stream");
});
```

**Kotlin**

```kotlin
import io.sentry.android.core.SentryAndroid

SentryAndroid.init(this) { options ->
    options.dsn = "https://<key>@o<orgId>.ingest.sentry.io/<projectId>"
    options.isEnableSpotlight = true
    // Optional: override the default Spotlight URL
    options.spotlightConnectionUrl = "http://10.0.2.2:8969/stream"
}
```

The default URL is `http://10.0.2.2:8969/stream`. The `10.0.2.2` address is the Android emulator's bridge to the host machine's `localhost`. If you're running on a physical device, replace this with your machine's local IP address and start the server with `sentry local serve --host 0.0.0.0`, so it accepts connections from your network. With a non-loopback host, `--open` isn't available.

## [Start the Local Server](https://docs.sentry.io/platforms/android/integrations/spotlight.md#start-the-local-server)

Install [Sentry CLI](https://cli.sentry.dev/getting-started/) on your development machine and start the local server, or run it with `npx`:

```bash
curl -fsSL https://sentry.io/get-cli/ | sh
sentry local serve
```

*Other available variations of the above snippet: npx*

If `sentry local serve` says a Sentry Local daemon is using the port, stop it with `sentry local daemon stop` (this ends its sessions), or pick another `--port` and change the SDK's Spotlight URL to match.

`sentry local serve` listens on port `8969`, which matches the default URL. Add `--open` to open the Sentry Local viewer in your browser.

Don't add `--session`. A session server refuses events sent to `/stream` on its root, and it rejects requests addressed to `10.0.2.2`, where the emulator sends them.

## [Verify](https://docs.sentry.io/platforms/android/integrations/spotlight.md#verify)

To verify the integration is working, capture a test exception:

```java
import io.sentry.Sentry;

Sentry.captureException(new Exception("Spotlight test from Android!"));
```

*Other available variations of the above snippet: kotlin*

Confirm that the error appears in the terminal running `sentry local serve` or in the Sentry Local viewer.

---

Find other pages: [Sitemap](https://docs.sentry.io/sitemap.md) lists every page with a one-line summary, and [llms.txt](https://docs.sentry.io/llms.txt) gives an overview with guidance for agents.
