<!--
{
  "availability" : [
    "macCatalyst: 13.0.0 -",
    "macOS: 10.13.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ColorSync",
  "identifier" : "/documentation/ColorSync/ColorSyncRegisterDevice(_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "ColorSync"
    ],
    "preciseIdentifier" : "c:@F@ColorSyncRegisterDevice"
  },
  "title" : "ColorSyncRegisterDevice(_:_:_:)"
}
-->

# ColorSyncRegisterDevice(_:_:_:)

Registers a device of the given class with ColorSync.

```
func ColorSyncRegisterDevice(_ deviceClass: CFString!, _ deviceID: CFUUID!, _ deviceInfo: CFDictionary!) -> Bool
```

## Parameters

`deviceClass`

The class of the device to register.

`deviceID`

The identifier of the device to register.

`deviceInfo`

A dictionary containing the information needed to register a device.

## Return Value

`true` on success and `false` in case of failure.

## Discussion

The `deviceInfo` dictionary requires the following keys:

- [`kColorSyncDeviceDescriptions`](/documentation/ColorSync/kColorSyncDeviceDescriptions): A `CFDictionary` with localized names of the device.
  Localization keys must be five-character strings containing a language code and region code
  in the `lc_RG` format, and must contain (at least) the `en_US` locale.
- [`kColorSyncFactoryProfiles`](/documentation/ColorSync/kColorSyncFactoryProfiles): A `CFDictionary` of factory profile info dictionaries. The keys
  are the profile IDs and the values are the profile info dictionaries.

It may also include the following optional keys:

- [`kColorSyncDeviceHostScope`](/documentation/ColorSync/kColorSyncDeviceHostScope): The host scope of the device; one of `kCFPreferencesCurrentHost`
  or `kCFPreferencesAnyHost`. If you don’t specify it, the framework assumes `kCFPreferencesCurrentHost`.
- [`kColorSyncDeviceUserScope`](/documentation/ColorSync/kColorSyncDeviceUserScope): The user scope of the device; one of `kCFPreferencesCurrentUser`
  or `kCFPreferencesAnyUser`. If you don’t specify it, the framework assumes `kCFPreferencesCurrentUser`.

The factory profiles dictionary (the value for the key [`kColorSyncFactoryProfiles`](/documentation/ColorSync/kColorSyncFactoryProfiles) in
`deviceInfo`) requires the following keys and values. A ProfileID (of `CFStringRef` type)
identifies each profile and serves as the key. The value associated with the key
is a profile info dictionary that describes an individual device profile.

- [`kColorSyncDeviceDefaultProfileID`](/documentation/ColorSync/kColorSyncDeviceDefaultProfileID): The associated value must be one of the ProfileIDs
  present in the dictionary. Presence of this key is not required if there is only one factory
  profile.

Each profile info `CFDictionary` requires the following keys:

- [`kColorSyncDeviceProfileURL`](/documentation/ColorSync/kColorSyncDeviceProfileURL): The `CFURLRef` of the profile to register.
- [`kColorSyncDeviceModeDescriptions`](/documentation/ColorSync/kColorSyncDeviceModeDescriptions): A `CFDictionary` with localized device mode names for the
  profile. Localization keys must be five-character strings containing a language code and
  region code in the `lc_RG` format, and must contain (at least) the `en_US` locale.
  For example, `en_US` “Glossy Paper with best quality”.

Example of a `deviceInfo` dictionary:

```
<<
    kColorSyncDeviceDescriptions   <<
                                        en_US  My Little Printer
                                        de_DE  Mein Kleiner Drucker
                                        fr_FR  Mon petit immprimeur
                                        ...
                                    >>
    kColorSyncFactoryProfiles       <<
                                        CFSTR("Profile 1")  <<
                                                                kColorSyncDeviceProfileURL    {CFURLRef}

                                                                kColorSyncDeviceModeDescriptions    <<
                                                                                                        en_US Glossy Paper
                                                                                                        de_DE Glanzpapier
                                                                                                        fr_FR Papier glace
                                                                                                        ...
                                                                                                    >>
                                        ...

                                        kColorSyncDeviceDefaultProfileID  CFSTR("Profile 1")
                                    >>
    kColorSyncDeviceUserScope   kCFPreferencesAnyUser

    kColorSyncDeviceHostScope   kCFPreferencesCurrentHost
<<
```

> Note: Scope for factory profiles is exactly the same as the device scope.

> Note: Pass `kCFNull` in lieu of the profile URL, or no URL key/value pair at all, if a
> factory profile is not available. This enables setting a custom profile.

> Note: For compatibility with the legacy API, create the profile
> keys as `CFString`s from `uint32_t` numbers as follows:
> `CFStringRef key = CFStringCreateWithFormat(NULL, NULL, CFSTR("%u"), (uint32_t) i);`

---

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)