user-assigned-device-name entitlement possible with automatically managed signing?

Is there a way to get the new com.apple.developer.device-information.user-assigned-device-name entitlement to work with automatically managed signing, or is it required to change to manual signing to use this entitlement?

Someone else had the same problem as me in this reply on another post: https://developer.apple.com/forums/thread/708275?answerId=730156022#730156022 but it was suggested they start a new thread but I don't think they started such a thread so I am.

I was hoping, perhaps naively, that after getting approval for the entitlement and adding it to our entitlements file that it would "just work" but i'm getting the error:

Provisioning profile "iOS Team Provisioning Profile: [redacted bundle id]" doesn't include the com.apple.developer.device-information.user-assigned-device-name entitlement.

Really hoping to avoid having to manually manage signing or at least know for sure that it is unavoidable before I move to it.

Answered by DTS Engineer in 732232022

Is there a way to get the new com.apple.developer.device-information.user-assigned-device-name entitlement to work with automatically managed signing … ?

Yes.

My understanding is that, when you’re granted the entitlement, you’re granted it for a specific App ID. To enable it on that App ID, go to Certificates, Identifiers & Profiles, edit the App ID, and enable User Assigned Device Name under Additional Capabilities. Once you do that, any profile you create for that App ID will include this entitlement in its allowlist.

At that point you can add the entitlement to your .entitlements file and Xcode’s automatic code signing should take things from there. At least that’s what it did when I tested it (-:

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Accepted Answer

Is there a way to get the new com.apple.developer.device-information.user-assigned-device-name entitlement to work with automatically managed signing … ?

Yes.

My understanding is that, when you’re granted the entitlement, you’re granted it for a specific App ID. To enable it on that App ID, go to Certificates, Identifiers & Profiles, edit the App ID, and enable User Assigned Device Name under Additional Capabilities. Once you do that, any profile you create for that App ID will include this entitlement in its allowlist.

At that point you can add the entitlement to your .entitlements file and Xcode’s automatic code signing should take things from there. At least that’s what it did when I tested it (-:

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

This worked, thank you very much!

This works for iOS. But building the same app for Catalyst fails to launch: LaunchServices launcher has returned an error, until you remove the entitlement manually. Note that Catalyst does require the entitlement, but won't let you build with it even if it is granted and part of your app identifier. For now I have to manually delete the entitlement from the entitlements file every time we build for Catalyst, and meanwhile the Catalyst app is hobbled without this functionality. I did already file this 2 weeks ago as FB11746132.

I did already file this 2 weeks ago as FB11746132.

Thanks.

This is just an Xcode problem, right? You don’t need the entitlement on the Mac, it’s just that Xcode’s build system doesn’t understand that fact and so includes it in your Mac Catalyst build.

If so, you can work around this as follows:

  1. Fork your .entitlements file into iOS and Mac Catalyst variants.

  2. In Build Settings, conditionalise the Code Signing Entitlements (CODE_SIGN_ENTITLEMENTS) build setting so that the Mac Catalyst build references the Mac Catalyst-specific file.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Unfortunately this is not just an Xcode problem. There are effectively 2 issues here.

  1. Xcode does not allow launching/development with the UADN entitlement on Ventura as per above posts.
  2. Ventura requires this entitlement to get the device name.

Note that #2 is my assumption because it works on macOS 12 and returns "iPad" on Ventura 13.0.1. Which is the same behavior iOS uses without the entitlement. But since it is impossible to build with said entitlement, I can't be certain. What I do know is that there seems to be no way to get the device name on Ventura today. Which is why I filed the bug. My assumption is that the entitlement is therefore required on Ventura, but impossible to use.

it works on macOS 12 and returns "iPad" on Ventura 13.0.1.

Oh, yeah, so it does.

Well, that’s just silly. Restricting access to the device name on macOS was not a goal of this feature. Moreover, it’s possible for a Mac Catalyst app to get this info via other means:

  • There are a variety of unsupported techniques that I’m not going to go into.

  • On the supported front, a Mac Catalyst app can run a not-Catalyst helper tool [1] and that can access the name without restrictions.

  • There may be other, simpler, supported solutions, but I wasn’t able to find one in the time I have available here. The obvious ones (the localizedName on NSHost, CSCopyMachineName, and SCDynamicStoreCopyComputerName) are all unavailable in Catalyst.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

[1] While Process (aka NSTask) is not available in Catalyst (r. 82912914), posix_spawn is.

Just pinging this thread that as reported above and in FB11746132, it is still impossible to submit Catalyst apps to the App Store that include this entitlement. The failure in that case is during upload of the build to the App Store from Xcode. However, in the intervening years since this issue began, I can now run apps from Xcode with this entitlement. So the remaining issue appears to be solely on the App Store submission side.

user-assigned-device-name entitlement possible with automatically managed signing?
 
 
Q