<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HealthKit",
  "identifier" : "/documentation/HealthKit/HKMetadataKeyUDIDeviceIdentifier",
  "metadataVersion" : "0.1.0",
  "role" : "Global Variable",
  "symbol" : {
    "kind" : "Global Variable",
    "modules" : [
      "HealthKit"
    ],
    "preciseIdentifier" : "c:@HKMetadataKeyUDIDeviceIdentifier"
  },
  "title" : "HKMetadataKeyUDIDeviceIdentifier"
}
-->

# HKMetadataKeyUDIDeviceIdentifier

The device identifier portion of a device’s UDI (unique device identifier).

```
let HKMetadataKeyUDIDeviceIdentifier: String
```

## Discussion

The device identifier can be used to reference the GUDID (Globally Unique Device Identification Database).

This key takes a string value.

> Note:
> In iOS 9.0 and later, the use of this key is discouraged. Use the ``doc://com.apple.healthkit/documentation/HealthKit/HKDevice`` class instead.

---

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)