Memention Blog

Provision this!


Wait a minute? Has it really been over a year since my last post, oh man I have been busy. Hopefully most of that is behind me now. The last four months I have been on paternity leave with my son Max. Been tuning out the job in more ways than one. But I haven’t been un-occupied with gizmos, gadgets and other techie toys. Hope to share some of my experiences with Bluetooth 4.0 LE, Servos, Arduinos and other stuff.

But my first small step to get back to sharing here will be about easy checking provisioning profiles for continuous integration building and catching those irritating failures before needing to actually build.

The provisioning profiles can cause failures in a number of ways.

Here I will only focus on the three first, being lazy again.

Just by looking into a profile one can see that there is plist in there. The files is actually some binary thing but parts of it looks like a plain plist in XML.

My plan is pretty straight forward. Extract the plist part, decode the valid parts, and for a kicker add return codes for any required fields. First it’s just a matter of plain C coding to scoop out the plist part and turn it into an manageable piece of data with NSPropertyListSerialization.

[NSPropertyListSerialization propertyListWithData:content_part // NSData
                                          options:NSPropertyListImmutable
                                           format:nil
                                            error:nil];

But for the messaging part for an external script to make decisions about failures the command line tool just return different non-zero codes. One could use different output strings but at the moment I just felt that simple return codes would give a nicer bash script.

profile=profile.mobileprovision

# Test Bundle ID
if ! lsmp -b com.memention.kwizlr -q $profile
then
  echo Profile has incorrect bundle id
fi 

# Test expiration date
if ! lsmp -e -q $profile
then
  echo Profile has expired
fi
 
# Test Push Notification
if ! lsmp -p -q $profile
then
  echo Profile lacks Push Notification config
fi 
    
# Test for Enterprise profiles
if ! lsmp -E -q $profile
then
  echo Profile is no Enterprise profile
fi 

You can get the code at github

Added option for Enterprise profile check. Script changed above.

By Edward Patel, 30 Aug 2012




Show comments

Archive

Getting there13 Mar 2014
Throwing pebbles12 Jul 2013
Provision this!30 Aug 2012
Break what?18 Aug 2011
That old thing04 May 2011
Removing a Step15 May 2010
Make It Work22 Feb 2010
KISS server31 Jan 2010
tig on Mac12 Dec 2009
The XML Runner31 Oct 2009
Get some software from Memention
Powered by Jekyll and Disqus.
Copyright © 2010-2013 Memention AB