# Shutdown API in Mobile SDKs


This guide walks you through the `shutdown` API provided by the RudderStack [Android (Kotlin)]({{< ref "sources/event-streams/sdks/kotlin-sdk/" >}}) and [iOS (Swift)]({{< ref "sources/event-streams/sdks/swift-sdk/" >}}) SDKs.

## Overview

The RudderStack Android (Kotlin) and iOS (Swift) SDKs provide a `shutdown` API that lets you: 

- Stop all the operations
- Remove all plugins, and 
- Free up the resources associated with the analytics instance initialized by the SDK

## Method definition

The following sections highlight how to use the `shutdown` API:

### Android (Kotlin)

{{< tabs tabTotal="2" >}}
{{% tab tabName="Kotlin" %}}
```kotlin
analytics.shutdown()
```
{{% /tab %}}
{{% tab tabName="Java" %}}
```java
analytics.shutdown();
```
{{% /tab %}}
{{< /tabs >}}

### iOS (Swift)

{{< tabs tabTotal="2" >}}
{{% tab tabName="Swift" %}}
```swift
analytics.shutdown()
```
{{% /tab %}}
{{% tab tabName="Objective-C" %}}
```objectivec
[self.analytics shutdown];
```
{{% /tab %}}
{{< /tabs >}}

## Considerations

Note the following before using the `shutdown` API:

- **The shutdown operation is irreversible** — the `Analytics` instance cannot be used further once it is shut down.
- All SDK APIs will stop working once the `Analytics` instance is shut down and any API call will log an error. Also, any getter API call will return `null`.
- All events recorded up to the shutdown point are written to disk but they are only flushed after the next initialization. 
- No saved data is lost — any data that persists on disk is processed upon the next SDK initialization.
