Fix: Get Device UDID for Ad Hoc Provisioning Without iTunes in Xcode

Fix: Get Device UDID for Ad Hoc Provisioning Without iTunes in Xcode

Written by

in

Quick answer: Connect the device to a Mac and open Xcode’s Devices window (Window → Devices and Simulators) to copy the UDID. For remote collection, host a .mobileconfig profile on your server that posts the UDID back when installed via Safari, or use a trusted third-party service like get.udid.io.

Why this happens

Apple removed programmatic access to the hardware UDID in iOS 7. Apps can no longer call UIDevice.uniqueIdentifier; any identifier that starts with FFFF is a vendor-specific replacement, not the real UDID. This change broke the old workflow where testers ran a “send my UDID” app and emailed the result. For ad hoc distribution you still need the true 40-character UDID to register each device in the Apple Developer portal, but iTunes is no longer the only — or even the best — way to obtain it.

How to fix it

1. Use Xcode’s Devices window (fastest for local devices)

  1. Connect the iPhone or iPad to a Mac via USB.
  2. Open Xcode → Window → Devices and Simulators (⌘⇧2).
  3. Select the device in the left sidebar.
  4. The Identifier field shows the UDID. Click it once to copy.

No iTunes, no sync, no provisioning profiles installed. Works on macOS Sonoma and later with Xcode 15+.

2. Host a .mobileconfig profile for remote collection

When testers are off-site, serve a configuration profile that asks iOS to POST the UDID back to your endpoint.

enroll.mobileconfig

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>PayloadContent</key>
  <dict>
    <key>URL</key>
    <string>https://your-server.com/udid/callback</string>
    <key>DeviceAttributes</key>
    <array>
      <string>UDID</string>
      <string>DEVICE_NAME</string>
      <string>PRODUCT</string>
      <string>VERSION</string>
    </array>
  </dict>
  <key>PayloadOrganization</key>
  <string>Your Company</string>
  <key>PayloadDisplayName</key>
  <string>UDID Collection</string>
  <key>PayloadType</key>
  <string>Profile Service</string>
  <key>PayloadVersion</key>
  <integer>1</integer>
  <key>PayloadUUID</key>
  <string>GENERATE-A-UNIQUE-UUID</string>
  <key>PayloadIdentifier</key>
  <string>com.yourcompany.udid-collection</string>
</dict>
</plist>

Flow
1. Tester opens https://your-server.com/udid/enroll in Safari on the device.
2. Server responds with the .mobileconfig (Content-Type application/x-apple-aspen-config).
3. iOS opens Settings → Install Profile. Tester approves.
4. iOS POSTs a plist containing UDID, DEVICE_NAME, etc., to your callback URL.
5. Your backend parses the plist, stores the UDID, and returns a friendly confirmation page.

Security note: Serve the profile over HTTPS, validate the callback origin, and delete the UDID after adding it to the Developer portal.

3. Use a trusted third-party service (no server maintenance)

If you don’t want to run your own endpoint, services like get.udid.io let the tester visit a URL in Safari and immediately see their UDID on screen. They can copy/paste it into an email or Slack. Verify the service’s privacy policy before using it for corporate devices.

4. Apple Configurator 2 (bulk, supervised devices)

For fleets of company-owned iPads:
1. Install Apple Configurator 2 from the Mac App Store.
2. Connect multiple devices via USB hub.
3. Select all → File → Export → Device Information → choose UDID.
4. CSV export contains every UDID for batch upload to the Developer portal.

How to prevent it

  • Migrate beta distribution to TestFlight — no UDID collection needed.
  • For enterprise apps, enroll devices in MDM (Jamf, Mosyle, Kandji) which reports UDIDs automatically.
  • Store collected UDIDs in a secure, access-controlled spreadsheet; delete after provisioning profile update.
  • Never log UDIDs in client-side analytics or crash reporters.

FAQ

Is the UDID the same as identifierForVendor?

No. UIDevice.current.identifierForVendor changes if all apps from your team are deleted. The hardware UDID never changes and is required for ad hoc provisioning profiles.

Can I get the UDID from an iCloud backup or Finder on macOS?

Yes. In Finder (macOS Catalina+), select the device → General tab → click the serial number until it cycles to UDID. Right-click to copy.

Does the .mobileconfig method require a paid Developer account?

No. The profile is unsigned and only requests read-only device attributes. It works with a free Apple ID, but you still need a paid account to register the UDID in the Developer portal and build ad hoc profiles.\n

Sources & credits

Parts of this guide are adapted from content licensed under CC BY-SA 3.0; this article is shared under the same license.