Apple Plugin Development plugin development

I used to receive an emails about How to: Apple plugin development? then responded with enough details to begin their journey.  Then I thought create an article around Apple plugin development for community.

I believe this article would provide guidance for your plugin development. Have queries use Disqus thread at the end of article.

Attention: Apple doesn’t support officially plugin development for Hence no documentation & support around it. Okay let’s say the word ‘No warranties :)’

If I get an enough time, will do article for –

  • Custom menu & menu commands into the
  • Utilizing preferences file, so migration/upgrade is easy for users
  • Custom preferences panel & preferences file
  • Custom window

Steps to create a plugin

Note: Following steps using Xcode 5.1.1, could be used with other version too. Ensure values are placed in appropriate places.

Step 1

Create a Xcode project type ‘Bundle‘ and Click ‘Next

  • Enter  Product Name
    • For example: SampleMailPlugin
  • Enter Company Identifier
    • For example: com.myjeeva
  • Click Next
  • Save dialog appears, save SampleMailPlugin Xcode project to hard drive

Step 2

Select a Project in the navigator, target is selected by default

  • Fill up following Key value as per need (All the values here goes to Info.plist)
    • Bundle name
    • Bundle identifier
    • Bundle version
  • Enter Class Prefix under ‘Project Document‘ Section
    • For example: SMP

Step 3

Select a Project

  • Go to ‘Info‘ Tab and pick OS X Deployment Target
  • Go to Build Settings Tab
    • Select  ‘Base SDK‘ per choice
    • set ‘Debug Information format‘ value to  DWARF
    • set ‘Installation Directory‘ value to $(HOME)/Library/Mail/Bundles
    • set ‘Info.plist‘ value to  SampleMailPlugin-Info.plist
    • set ‘ProductName‘ value to  SampleMailPlugin

Step 4

Select ‘SampleMailPlugin‘ group on Project Navigator

  • Create a Objective-C class
    • For example: create SampleMailPlugin class, prefix is pre-populated
  • Now SMPSampleMailPlugin.h & SMPSampleMailPlugin.m gets created

Step 5

Select project root ‘SampleMailPlugin‘ on the Project Navigator

  • Select ‘SampleMailPlugin‘ target from popup menu
  • Go to Info Tab (All the values here goes to Info.plist)
    • Add a Key Principle class and choose type as String enter value as ‘SMPSampleMailPlugin‘. This is entrypoint for  mailbundle
    • Add a Key SupportedPluginCompatibilityUUIDs and choose type as Array
      • Fill UUID (mail version is 7.3) – D1EFE124-86FF-4751-BF00-80B2C0D6F2E4
      • Get your UUID, use for development; this command might help you  defaults read /Applications/ PluginCompatibilityUUID
  • Go to ‘Build Settings‘ Tab
    • set ‘Installation Directory‘ value to $(HOME)/Library/Mail/Bundles
    • set ‘Wrapper Extension‘ value to mailbundle
  • Go to ‘Build Phases‘ Tab
    • Add new ‘Build Phase‘ of type Copy Files
    • Double click ‘Copy Files‘ label and Update the heading to Local Deploy
    • Select ‘Destination‘ value as Absolute Path
    • set ‘Path‘ value to ~/Library/Mail/Bundles. It deploys the current build into mentioned local path
    • Click on ‘Plus‘ sign button then choose SampleMailPlugin.mailbundle or just drag a SampleMailPlugin.mailbundle form Project Navigator to here

Step 6

Select SMPSampleMailPlugin.m file on the Project Navigator

  • Create a class method called + (void)initialize { .... }
  • Add following Code Snippet into method initialize

  • Add following interface definition into  SMPSampleMailPlugin.m

Step 7

Let’s build the plugin and test.  Press Command + B  or go to Product menu click Build.

Step 8

Look at our new build mail plugin and

  • Open up Finder hold Command + Shift key and press  G
  • Type ~/Library/Mail/Bundles hit the ‘Go‘ button, now SampleMailPlugin.mailbundle should be there
  • Open up
  • Type ‘Mail‘ in right upper Search text box in to limit message to

Step 9

Final goal, open up Now you should similar message in

Step 10 (Optional)

If you’re using or developing plugin for a first time; Plugin support may not be enabled in, so execute below command in the Restart the

I believe you’re Happy, spread the word of ReplyWithHeader Mail plugin and give some star on and :)


If you have any queries, please leave a comment below!

  SampleMailPlugin Archive