Let’s say you’re a moron like me, want to upgrade to the new iOS beta, just bought a new iPhone and forgot to add your UDID to the Provisioning Portal before updating to the new beta. When the install is complete, iTunes will error out. Oh, right, it’s because you didn’t add the UDID to your developer account. It gets worse.
You can’t recover the UDID through iTunes when the phone is in DFU mode. You can’t recover it from System Profiler when it’s in DFU mode.
But, if you’re not a complete moron, you made a backup before you installed the beta os. Right? Right. You’re in luck!
If you have a backup of your iPhone somewhere on your computer, you can easily grab the UDID from there…. The UDID is simply the name of the backup folder itself, which is stored under~/Library/Application Support/MobileSync/Backups You may also be able to find it in a registration PLIST file in your ~/Library/Lockdown folder, since a copy of your iPhone “activation” credentials are stored there. Again, the name of the file is your UDID. (source)
Thank you, Google. I owe you one. Apple Tech Support didn’t know that trick, Apple Developer Support didn’t know that trick, but now I’m sitting pretty.