<!--
{
  "availability" : [
    "iOS: 4.2.0 -",
    "iPadOS: 4.2.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreMIDI",
  "identifier" : "/documentation/CoreMIDI/MIDISetupRemoveDevice(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core MIDI"
    ],
    "preciseIdentifier" : "c:@F@MIDISetupRemoveDevice"
  },
  "title" : "MIDISetupRemoveDevice(_:)"
}
-->

# MIDISetupRemoveDevice(_:)

Removes a driver-owned MIDI device from the current MIDI setup.

```
func MIDISetupRemoveDevice(_ device: MIDIDeviceRef) -> OSStatus
```

## Parameters

`device`

The device to remove.

## Return Value

An `OSStatus` result code.

## Discussion

Typically, only a studio-configuration editor calls this function to remove a device that’s offline and which the user has specified as permanently missing. It’s a good practice to have drivers set the deviceʼs [`kMIDIPropertyOffline`](/documentation/CoreMIDI/kMIDIPropertyOffline) to 1, instead of removing the device from the setup, so if the device reappears later, the system preserves the deviceʼs property state.

---

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)