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)

Hawaiian Awesomeness

I’ve been lucky enough to spend a couple days with several friend in Oahu island. Let me just say this: Hawaii is awesome.

During january, when it’s supposed to be winter, the water temperature is perfect pitch. Wifi is great, and the food is super tasty, not sure why, yet.

Next time… Maui maybe?

IMG_0396

IMG_0394

Generating a Mac Iconset

You’ll need to create PNG assets with the following sizes and filenames:

[cc]
icon_16x16.png
icon_16x16@2x.png
icon_32x32.png
icon_32x32@2x.png
icon_128x128.png
icon_128x128@2x.png
icon_256x256.png
icon_256x256@2x.png
icon_512x512.png
icon_512x512@2x.png
[/cc]
All of those assets should go into a folder named ‘Icon.iconset’.
Afterwards, just fire Terminal and type the following command:

[cc]
iconutil -c icns
[/cc]

If all went well, you should have a .icns file right there!.

Reference: Apple’s Guidelines.

Removing “@2x” substring from files

If you’re reading this, probably… it’s because the Art Designers of your team just sent you a bunch of SD assets, with the @2x substring… and you don’t wanna spend the next 30 minutes cleaning that up… right?

If that’s the case, you’ve come to the right place. Fire Terminal, open the containing folder, and type the following:

[cc]
find . -type f -name “*@2x*” -exec sh -c ‘echo mv “$0” “${0/@2x/}”‘ ‘{}’ \;
[/cc]


Note:
you might have just noticed that this will actually echo the replacement. That’s for safety. Validate the output, and proceed removing the ‘echo’ command call.

Fixing Codesign Issues with Helper Apps

I’ve been getting “Invalid binary” errors, while trying to upload a binary to the AppStore. The solution can be found in stackoverflow, i’m just pasting it here, for future reference…

1. Re-Codesign the Helper app from terminal:
[cc]codesign -f -s “3rd Party mac Developer Application:” -i “com.bundle.YOUR.HELPER” –entitlements path/to/helper/entitlements YOUR-HELPER.app[/cc]

2. 

Remove provisioning profile from Helper app, adding a “Run script” into the “Build Phases”:

[cc]rm “${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Contents/Library/LoginItems/YOUR-HELPER.app/Contents/embedded.provisionprofile”[/cc]

After this, i managed to upload the binary!