---
sidebar_position: 0
---

# debug

The `sos.management.debug` API groups together methods for working with native debug mode.

:::note
Some modern systems might require additional steps to enable the native debug mode. Please refer to the [native debug documentation](https://docs.signageos.io/hc/en-us/articles/4413935787154-Applet-Native-Device-Debug) for more information.
:::

<details>
    <summary>Debug Management Capabilities</summary>
		| Capability | Description |
		|:------------|:-------------|
		| `SET_DEBUG` | If the device can enable or disable the native debug mode. |

		If you want to check if the device supports this capability, use [`sos.management.supports()`](https://developers.signageos.io/sdk/sos_management/#supports).
</details>

## Methods

### disable()

The `enable()` method disables the [native debug](https://docs.signageos.io/hc/en-us/articles/4413935787154-Applet-Native-Device-Debug) mode.

```ts expandable
disable(): Promise<void>;
```

#### Return value

A promise that resolves when the debug mode is disabled.

#### Example

```ts
await sos.management.debug.disable();
```

<Separator />

### enable()

The `enable()` method enables the [native debug](https://docs.signageos.io/hc/en-us/articles/4413935787154-Applet-Native-Device-Debug) mode.

```ts expandable
enable(): Promise<void>;
```

#### Return value

A promise that resolves when the debug mode is enabled.

#### Example

```ts
await sos.management.debug.enable();
```

:::note[GitHub Example]

- [ Example applet with activating debug mode](https://github.com/signageos/applet-examples/tree/master/examples/management-js-api/debug)

:::

<Separator />

### isEnabled()

The `isEnabled()` method returns whether the [native debug](https://docs.signageos.io/hc/en-us/articles/4413935787154-Applet-Native-Device-Debug) mode is enabled.

```ts expandable
isEnabled(): Promise<boolean>;
```

#### Return value

A promise that resolves to `true` if the debug mode is enabled, otherwise `false`.

#### Example

```ts
const isDebugEnabled = await sos.management.debug.isEnabled();
console.log(`Native debug mode is ${isDebugEnabled ? 'enabled' : 'disabled'}.`);
```

<Separator />

### setDebug()

The `setDebug(enabled)` method sets the native debug mode to the specified state.

```ts expandable
setDebug(enabled: boolean): Promise<void>;
```

#### Params

| Name      | Type      | Required         | Description                                             |
|-----------|-----------|------------------|---------------------------------------------------------|
| `enabled` | `boolean` |  <div>Yes</div>  | `true` to enable the debug mode, `false` to disable it. |

#### Return value

A promise that resolves when the debug mode is set.

#### Possible errors

If the `enabled` parameter is not a boolean.

#### Example

```ts
const enabled = await sos.management.debug.isEnabled();
if (!enabled) {
 await sos.management.debug.setDebug(true);
}
```