23

I'm finding many articles on the web where it is implied that you can view the .mobileprovision file contents in a text editor. For example, this Urban Airship post:

When push notifications are enabled for an app, the aps-environment key will appear in the .mobileprovision file specifying the provisioning profile:

<key>Entitlements</key>
<dict>
    <key>application-identifier</key>
...

However the mobilprovision files I have (obtained within the last few days) contain 466 1/2 rows of 8 groups of 4 hex digits, (e.g. 4851 3842 4176 2845 0a09 01a2 404d 4382). How can I view this type of file?

jwl
  • 10,268
  • 14
  • 53
  • 91
  • 1
    For the curious, the first few bytes decoded to ASCII to `HQ8B Av(E` then head into control-characters.. – sarnold Jun 12 '12 at 00:04

4 Answers4

41

Provisioning Profiles are encoded. To decode them and examine the XML you can use this via command line:

security cms -D -i #{@profilePath}

where #{@profilePath} is the filepath to your .mobileprovision file.

A fuller Ruby example is:

require 'plist'
profile = `security cms -D -i #{@profilePath}`
xml = Plist::parse_xml(profile)
appID = xml['Entitlements']['application-identifier']
Alfie Hanssen
  • 16,964
  • 12
  • 68
  • 74
16

If you want Sublime Text 2 to be able to read .mobileprovision profiles this is the setting

"enable_hexadecimal_encoding": false,
Skabber
  • 369
  • 3
  • 10
15

You are using a text-editor that is a bit too clever for you :D.

Your editor finds out that the file actually is binary and shows it as a hex-dump - for example Sublime 2 does it that way. Open that same file using TextEdit. You will see a couple of lines of binary garbledegock and then some plain-text (XML) that should contain the information you are looking for.

However, do not edit that file using TextEdit, that will render it unusable!

Till
  • 27,559
  • 13
  • 88
  • 122
  • 1
    Yes I am using Sublime 2! I haven't been using it that long and didn't realize it would do this kind of thing... TextEdit does show the XML content... thanks – jwl Jun 12 '12 at 14:46
12

You can use openssl to output the contents of the signed profile.

openssl smime -in /path/to/your.mobileprovision -inform der -verify
Skabber
  • 369
  • 3
  • 10