<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MediaDevice",
  "identifier" : "/documentation/MediaDevice/MediaDeviceExtension/deactivateDevice(_:session:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Media Device"
    ],
    "preciseIdentifier" : "s:11MediaDevice0aB9ExtensionP010deactivateB0_7sessionyAA0a6OutputB0V_AA0aF7SessionCtF"
  },
  "title" : "deactivateDevice(_:session:)"
}
-->

# deactivateDevice(_:session:)

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

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

## Parameters

`device`

The device to deactivate.

`session`

The session associated with the deactivation.

## Grouping

The device should be removed from its modifiable group.
[`updateDevices(_:)`](/documentation/MediaDevice/MediaDeviceRoutingManager/updateDevices(_:)) should be called to update the state of group information.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)