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.
- Wrong bundle ID
- Profile has expired
- Push notification hasn’t been configured yet (if needed)
- Missing certificate
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 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