After spending too many hours wondering why my document icons weren't showing up under Mac OS X, and finally figuring out that it was caused by a typo in my 'plst' resource, I wrote this utility to help other Mac OS X programmers. Drag a packaged application, or a single-fork application containing a 'plst' resource, or an Info.plist file and drop it on PlistChecker. PlistChecker displays a report listing any problems it found.
What PListChecker does:
- Verifies the UTF-8 encoding.
- Reports any XML/plist parsing errors.
- Reports any undocumented top-level keys.
- Checks the types of the values for most documented keys, and keys within the CFBundleDocumentTypes, UTExportedTypeDeclarations, and UTImportedTypeDeclarations arrays.
- Reports keys recommended by Apple documents that are missing from the plist.
These checks are based on my understanding of what a plist should look like, and should not be taken as gospel. PListChecker does not examine InfoPlist.strings files.
Version 1.0.1 changes: Allow <string>Yes</string> as an alternative to <true/> for LSPrefersCarbon, LSPrefersClassic, LSRequiresCarbon, and LSRequiresClassic.
Version 1.0.2 changes: When launched under an OS version earlier than 9.0, it now shows an alert and quits instead of crashing.
Version 1.1 changes:
- Recognize CFBundleHelpBookFolder, CFBundleHelpBookName.
- Recognize obsolete keys NSIcon, NSExtensions, NSExecutable.
- Recognize document type keys CFBundleTypeMIMETypes, NSDocumentClass, NSExportableAs.
Version 1.2 changes: The UTF-8 check now rejects characters that use 2 bytes when 1 would have sufficed, or that use 3 bytes when 2 would have sufficed.
Version 1.2.1 change: A file starting with a UTF-16 byte order mark is now recognized as UTF-16, rather than incorrect UTF-8.
Version 1.3 changes:
- The report text is now antialiased when running on OS X.
- The About box is movable.
- When dealing with an unbundled application with a 'plst' resource, PListChecker now verifies that the PList type and creator codes match the application's actual type and creator codes, and that the value of CFBundleIconFile is a number.
- There is a specific error message if a standard key is typed with incorrect capitalization.
- The keys LSUIElement and LSHasLocalizedDisplayName are recognized.
- The key CFBundleExecutable is now on the recommended list, though it probably doesn't really serve a purpose for unbundled applications.
Version 1.3.1 changes:
- The keys LSMinimumSystemVersion, LSMultipleInstancesProhibited, LSHasLocalizedDisplayName, LSGetAppDiedEvents are now recognized.
- When the key NSHumanReadableCopyright is missing, you no longer get a warning that a recommended key is missing, because no Apple applications seem to use it.
- In the case of a 'plst' resource, you no longer get a warning when CFBundleExecutable is missing.
Version 1.4 changes:
- There is now a preference dialog with a "verbose" option. With this unchecked, you get either only errors and warnings, or the text "** No problems found! **".
- Application names longer than 31 characters or containing Unicode characters are now displayed correctly.
- The window title now shows the version number after the application name.
- If there is no problem with the character encoding, the report does not mention it.
- The Cut, Clear, and Paste menu commands are disabled, since the report text is read-only.
- There is a Window menu.
- The menu item "About PListChecker" is not followed by an ellipsis.
Version 1.5 changes:
- The top level keys CGDisableCoalescedUpdates, UTExportedTypeDeclarations, UTImportedTypeDeclarations, LSRequiresNativeExecution are recognized.
- The LSUIElement key now expects a string 1 or 0, in accordance with Apple docs.
- The keys LSPrefersCarbon, LSPrefersClassic, LSRequiresCarbon, LSRequiresClassic now expect a value that is either a string 1 or 0 or a boolean.
- The CFBundleDocumentTypes key LSItemContentTypes is recognized.
Version 1.5.1 changes:
- The top level key LSEnvironment is recognized.
- The CFBundleDocumentTypes key NSPersistentStoreTypeKey is recognized.
Last modified: 3 January 2007
Copyright ©2007 James W. Walker