Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Retrieve S/Ns of iPods connected to your computer' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Retrieve S/Ns of iPods connected to your computer
Authored by: babbage on Apr 14, '11 09:53:41AM

Like everything else in plist XML or binary format, this file can be read more easily through the `defaults` command through Terminal, or Property List Editor if you think Terminal is scary but have XCode installed.

Here's what I get when I run it and filter the output through grep to just get the models & serials I have recorded on my laptop:

$ defaults read com.apple.iPod | egrep 'Device|Serial'
    Devices =     {
            "Serial Number" = 2X43XXXXXXX;
            "Serial Number" = JQ40XXXXXXX;
            "Serial Number" = JQ42XXXXXXX;
            "Device Class" = iPod;
            "Serial Number" = 5F64XXXXXXX;
            "Device Class" = iPod;
            "Serial Number" = 5U53XXXXXXX;
            "Serial Number" = JQ52XXXXXXX;
            "Device Class" = iPod;
            "Serial Number" = JQ54XXXXXXX;
            "Device Class" = iPod;
            "Serial Number" = Q273XXXXXXX;
            "Device Class" = iPod;
            "Serial Number" = Q272XXXXXXX;
            "Device Class" = iPod;
            "Serial Number" = 2Z81XXXXXXX;
            "Device Class" = iPod;
            "Serial Number" = Q292XXXXXXX;
            "Device Class" = iPod;
            "Serial Number" = 8K63XXXXXXX;
            "Device Class" = iPhone;
            "Serial Number" = 7T72XXXXXXX;
            "Device Class" = iPhone;
            "Serial Number" = 8802XXXXXXX;

Much easier than trying to read the raw XML, and it's also important to be aware that plist files can either be in XML or binary format, so it might not readable in the first place. The good thing about the `defaults` command is that it understands both formats, so you don't have to worry about how or even where the plist file you care about is stored on disk, as you just call it by name and get the contents you're looking for.

---
--
DO NOT LEAVE IT IS NOT REAL


[ Reply to This | # ]
Retrieve S/Ns of iPods connected to your computer
Authored by: nathanator11 on Apr 14, '11 10:06:18AM

Cool idea; I hadn't though of using `defaults`.

Even just using `defaults read com.apple.iPod` is more readable.



[ Reply to This | # ]