Codesign Installer package for distribution outside the Mac App Store

Sometimes you need to distribute your application installers outside Mac App Store. You can code sign it so that it will be recognized by Gatekeeper as identified developer product. Once you code sign the installer with your Apple Developer Id certificate, gatekeeper will allow to open the installer, otherwise it will show a dialog saying “The app cannot be opened because it is from an unidentified developer” (if gatekeeper settings are set to ‘Mac App store and identified developers’).

To know more about Gatekeeper options click here.

Here we will see how to sign the installer package so that gatekeeper won’t block it.

The installers created by PackageMaker with minimum target set to 10.5 and above are flat package while the installers created with minimum target set to 10.4 will create a bundle package.

Bundle type installers cannot be signed using Developer Id Installer certificate. These can be signed using Developer Id Application certificate, but gatekeeper does not pass it.

To sign a flat type installer first you need to enroll to Mac Developer Program and download your Developer Id Installer certificate. Double click the downloaded certificate to load it to keychain.

Now once you have the certificate in your keychain, you may check it via KeyChain Access. The certificate will be named like “Developer ID Installer: Any Name”.

To code-sign your installer package, run the following command in terminal:

productsign –timestamp=none –sign “Your Certificate Name” “/path/and/name/of/the/unsigned/installer” “path/and/name/of/signed/installer

For example, in my case

productsign –timestamp=none –sign “Developer ID Installer: Neha Gupta” “/myApp.pkg” “/signed/myApp.pkg”

The new installer created will be signed by your installer certificate and will be recognized by gatekeeper as a identified developer product. To check the certificate by which package is signed, launch the signed installer package and click the lock sign on the upper right corner.

Written By: Neha Gupta


Memory management in Objective C

How memory management is done in objective C?

The latest OS X and IOS versions (IOS 5, OSX 10.7 and above) supports Automatic Reference Counting (ARC), a memory management enhancement in Objective C. Before that programmers have to follow the Manual Retain Release procedure. Go through the slides below to understand Memory Management in Objective C with reference to IOS and Cocoa. Also learn about the introduction of ARC and how it works.

Topics Covered:

– About Memory Management and IOS, OSX versions

– Reference Counting

– Taking ownership of an Object

– Relinquishing ownership of an Object

– Memory Leak and Dangling pointer

– Strong, Retain and Copy

– Autorelease method

– Autorelease pools

– Dealloc

– Automatic Reference Counting

– Zeroing Weak References

– Garbage Collector

Written By: Neha Gupta

Access/control scriptable application using scripting bridge and Cocoa

mac developers

ScriptingBridge framework in Cocoa can be used to access features from any scriptable application. In this article I will discuss how to access the features of iTunes such as current playing track, duration of the track, playlists etc by using ScriptingBridge.framework in a Cocoa Application. However you can follow the same steps to allow your application to interact with any other scriptable application.

View original post 671 more words