Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
386 views
in Technique[技术] by (71.8m points)

ios7 - Is there a way since (iOS 7's release) to get the UDID without using iTunes on a PC/Mac?

I'm developing an app for my company and we're going through the process of slowly letting people into the "beta" by adding their iPads to the company's iOS Dev Center accounts. From there we do an ad hoc build for local Intranet distribution.

At my last gig, I would direct people to one of those "find my UDID for me" apps, then get them to send me the UDID it found.

iOS 7 has cut this off - those apps are all gone now and if you do still have one, it returns some GUID that has nothing to do with the UDID.

So what I'm having to do is connect each of these things to my Mac, then get the UDID from iTunes, which is kind of a hassle (but less tedious than trying to explain to them how to get it from iTunes, assuming they even have it installed). And sometimes it tries to sync with my Mac, which doesn't seem to have any effect other than putting on provisioning profiles I don't want on the device. And at least once I've had an iPad just suddenly decide to upgrade itself from iOS 6 to iOS 7 which I'm not sure is related to being plugged in (and in this case the user didn't want it upgraded).

So is there any other way to get the UDID from the iPad other than plugging it into a machine?

TO BE CLEAR: I'm not trying to get the UDID in an app, I'm just trying to think of the quickest way to get the UDID to add to the device list in our developer profile for distribution.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Navigate to http://get.udid.io/ from Safari on your iOS device. It works like a charm and requires neither iTunes nor any other computer. No app installed either.

EDIT:

Also, have a look at Getting a device UDID from .mobileconfig if you (understandably) would rather have this .mobileconfig certificate hosted on a server of yours.

MAKE YOUR OWN:

Have a copy of the .mobileconfig example hosted on your server and write 2-3 small scripts in your favorite language to handle the following flow:

  1. Navigate on Safari to a URL redirecting to enroll.mobileconfig below. This makes iOS open the Settings app and show the profile.
  2. Upon accepting the profile, iOS switches back to Safari and posts the DeviceAttributes array to the URL specified enroll.mobileconfig.
  3. The POST data will contain a .plist file with the requested attributes (see example below). One of which will be the holy UDID.

Remark: You should probably have some user friendly messages. Specifically, we even have a step 0. where the user is asked to provide their name and e-mail that we store temporarily in the HTTP session and then redirect the request to the mobileconfig profile. We ultimately match this info with the iPhone data and send a friendly confirmation e-mail. HTH.

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>http://support.devcorp.com/uuid/returnurl/</string>
            <key>DeviceAttributes</key>
            <array>
            <string>DEVICE_NAME</string>
            <string>UDID</string>
            <string>PRODUCT</string>
            <string>VERSION</string>
            <string>SERIAL</string>
            </array>
        </dict>
        <key>PayloadOrganization</key>
        <string>DevCorp Inc.</string>
        <key>PayloadDisplayName</key>
        <string>Profile Service</string>
        <key>PayloadVersion</key>
        <integer>1</integer>
        <key>PayloadUUID</key>
        <string>C5FB9D0D-0BE7-4F98-82CC-5D0EA74F8CF8</string> <!-- any random UUID -->
        <key>PayloadIdentifier</key>
        <string>com.devcorp.profile-service</string>
        <key>PayloadDescription</key>
        <string>This is a temporary profile to enroll your device for ad-hoc app distribution</string>
        <key>PayloadType</key>
        <string>Profile Service</string>
    </dict>
</plist>

sample .plist POSTed by the iPhone to the given URL

<?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>PRODUCT</key>
    <string>iPhone4,1</string>
    <key>SERIAL</key>
    <string>DNPGWR2VCTC0</string>
    <key>UDID</key>
    <string>b01ea7bc2237fed21bfe403c6d2b942ddb3c12c3</string>
    <key>VERSION</key>
    <string>11A465</string>
</dict>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...