SDK DEVSUGAR: RE-SIGNING APPLICATIONS

TUAW’s devsugar series helps deliver developers to collection as well as tricks which they competence not nonetheless be informed with. Today’s tip centers upon signing already-compiled as well as already-signed applications with a brand new law signature.

A whilst back, we posted about a proceed to pointer already-compiled applications with your personal certification in sequence to improved concede developer-to-developer distribution. By re-signing an application, it allows we to implement it upon any of a inclination we have purebred to your comment during Apple but carrying to go by a bitch as well as worry of normal ad-hoc distribution. In addition, it creates it simpler to rise applications upon a contractor’s machines, to boat them to a client, as well as afterwards have them sealed as well as shipped to App Store regulating a client’s identity.

A simple command-line resolution is as follows. It calls codesign (found in /usr/bin) to pointer a application, regulating a default keychain object which matches “iPhone Developer”. It’s a accessible script, generally for spontaneous beta distributions.

#! /bin/bash

export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate

codesign -f -s "iPhone Developer" $1

There are, however, multiform problems with this approach. First, it assumes we usually wish to pointer with growth (typically “Debug build”) credentials. That’s not starting to work if we need to re-sign for distribution. (Solution? Change iPhone Developer to iPhone Distribution). Second, it assumes we usually have a single developer or placement form in your keychain. (Solution? Change iPhone Developer, for example, to iPhone Developer: Company Name to only compare only a single keychain entry.) Third, it assumes a chairman we do a re-signing knows how to have use of a authority line. For that, a resolution is a small some-more complicated.

Recently, this subject came up upon a developer e-mail list which we moderate: how do we have it simpler for a non-technical customer to re-sign an application, routinely for distribution. As a solution, we put onward a offer which a single could hide a on tip of bombard book function in to an AppleScript droplet. After consulting with a couple of colleagues, as well as entertainment their requirements, we motionless to give a plan a try. we built an AppleScript focus which signs any focus forsaken onto it.

You can find a operative duplicate of a focus at my website. App Signer iterates by any apps forsaken onto it, checks to safeguard either any record (or bundle, really) ends with an “.app” extension, as well as afterwards attempts to pointer those files regulating /usr/bin/codesign.

Users can name to pointer with Developer credentials, Distribution credentials, or name Other to open a prompt as well as come in content for keychain disambiguation. (See a shade shot during a tip of this post for an e.g. of a disambiguation dialog.) The focus displays formula for any application, a single during a time.

Please note a following caveats:

  • I have no try to pledge which a app forsaken onto this focus is essentially an iPhone app (rather than, contend a Macintosh application).
  • When operative with on-device keychains, a temperament used to pointer a focus has to compare a focus id set onward in a Info.plist record for a application, differently keychain entrance will fail.
  • This is a giveaway application. It is offering underneath a BSD license. Use it during your own risk. Credit regularly appreciated.
  • The open source github card file for App Signer can be found here.
  • To emanate a application, open a AppleScript source in Script Editor as well as name File > Save As > File Format: Application.

Leave a comment

Your comment