Codesign Check

Keychain access for iOS apps is tied up to the provisioning profile you use to sign the binary. So, what happens if you release a new build, signed using a different provisioning profile?.

Yes! your guess is accurate!. You loose access to anything you’ve stored in the keychain, resulting in (probably) deauthentication.

There is a command that allows you to verify the “Keychain Access Group” for a given executable. By means of this, you’ll be able to verify if your new release will have the same access than your previous build (assuming you also have that binary!).

Take notes…

codesign -d --entitlements - /path/AppName.OSX.1.0.2.xcarchive/Products/Applications/AppName.app/

Fixing ‘”A newer version of this app is already installed on this computer” Alert

I’ve just got a nice alert, while trying to install a Mac App from the AppStore, saying the following:

"A newer version of this app is already installed on this computer."

Solutions?

  1. Nuke the app’s Xcode build folder.

    Location: ~/Library/Developer/Xcode/DerivedData/

  2. Execute the following command:

    /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user

Now you should be good to go!

Sparkle in Sandbox Mode

If you’re trying to distribute updates for your OSX app, outside the AppStore, still, with the AppSandbox enabled, you’ve come to the right place.

In the official Sparkle repository, you can find this pull request. Since it hasn’t been updated in a while, and the settings were fixed for OSX Lion, i’ve just forked the pull request, and pushed a couple fixes here.

Allright, so, how should you proceed?

  1. Clone the repository!
  2. Open the Build Phases of your target and…
    1. Add Sparkle.framework as a dependency
    2. Link Sparkle.framework library
    3. Copy Sparkle.framework to ‘Frameworks’
  3. If you’ve done things right, your ‘Build Phases’ tab should look something like this:

    OSX Sparkle Sandboxed

  4. Add a ‘Run Script‘ phase with the following snippet:

     

LOCATION=”${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}”
IDENTITY=”Developer ID Application: [INSERT YOUR IDENTITY NAME HERE]”
find “$LOCATION” -name ‘*.framework’ -exec codesign –verbose –force –sign “$IDENTITY” {}/Versions/Current \;
codesign –verbose –force –sign “$IDENTITY” “$LOCATION/../XPCServices/com.andymatuschak.Sparkle.SandboxService.xpc”

 

That’s it. After hitting ‘Archive’, your app should be able to auto-update itself.

References:
Codesign in Mavericks and Xcode 5 (Stackoverflow)
Codesign in Mavericks and Xcode 5 (Hockeyapp)
Sparkle (Thanks Andy, for sharing such an awesome project)

%d