---
title: "deactivateDevice(_:session:)"
framework: mediadevice
role: symbol
role_heading: Instance Method
path: "mediadevice/mediadeviceextension/deactivatedevice(_:session:)"
---

# deactivateDevice(_:session:)

Called when the user deactivates a device via a user interface.

## Declaration

```swift
@MainActor func deactivateDevice(_ device: MediaOutputDevice, session: MediaOutputSession)
```

## Parameters

- `device`: The device to deactivate.
- `session`: The session associated with the deactivation.

## Mentioned in

Creating a media device extension

## Grouping

Grouping The device should be removed from its modifiable group. updateDevices(_:) should be called to update the state of group information.
