Mail.app plugin compatibility for macOS Sierra (10.12)

Posted: July 27th, 2016 | Author: | Filed under: macOS, Mail, Programming | Tags: , , , , , , , , , | 1 Comment »

 
Mail.app in macOS 10.11 and earlier used to check the plugins compatibility using the SupportedPluginCompatibilityUUIDs key in the plugin’s Info.plist. For example a Mail plugin would only be compatible with macOS 10.11.6 if its Info.plist contained the following:

<key>SupportedPluginCompatibilityUUIDs</key>
<array>
   <string>71562B89-0D90-4588-8E94-A75B701D6443</string>
</array>

  
Mail.app version 10.0 in macOS Sierra (10.12) now uses a different key to check the plugins compatibility. It now requires a key with the format Supported%ld.%ldPluginCompatibilityUUIDs where “%ld.%ld” is the operating system version like “10.12”.

If you want to make your Mail.app plugin compatible with macOS Sierra, you will need to add a key in your Info.plist like:

<key>Supported10.12PluginCompatibilityUUIDs</key>
<array>
    <string>36CCB8BB-2207-455E-89BC-B9D6E47ABB5B</string>
</array>

Note that the UUID “36CCB8BB-2207-455E-89BC-B9D6E47ABB5B” is for macOS Sierra 10.12 beta 3.

  
Also by default the Mail plugins support is disabled. In order to enable it you first need to run in the Terminal the following:

defaults write com.apple.mail EnableBundles -bool true

  
Related post: Disable swipe to delete in Mail.app on OS X 10.11


Determining the running kernel mode on 10.6

Posted: March 6th, 2010 | Author: | Filed under: macOS, Programming | Tags: , , , , , , , | 1 Comment »

It might be useful in some cases to know if the MacOS kernel is running in the 32-bit or 64-bit (K64) mode. This is useful for example if you write an application like ‘System Profiler’ that displays the details of the currently running system:

'System Software Overview' in the 'System Profiler' app

Obviously this post only applies to intel machines running on Snow Leopard (see my previous post ‘Intel 64-bit summary’). To simplify the code, I assume that you compiled your application with the 10.6 SDK.

In the IOKit framework on 10.6 the function OSKextGetRunningKernelArchitecture is defined as followed in the OSKext.h header:


/*!
 * @function OSKextGetRunningKernelArchitecture
 * @abstract Returns the architecture of the running kernel.
 *
 * @result
 * The architecture of the running kernel.
 * The caller does not own the returned pointer and should not free it.
 *
 * @discussion
 * This function consults the kernel task and returns a pointer to the
 * NXArchInfo struct representing its architecture.
 * The running kernel's architecture does not necessarily match that
 * of user space tasks (for example, a 32-bit user space task could be
 * running with a 64-bit kernel, or vice-versa).
 */
CF_EXPORT const NXArchInfo *
OSKextGetRunningKernelArchitecture(void)
                AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER;

This function is the one I use to determine the current running kernel mode:

#import <Foundation/Foundation.h>
#import <mach-o/arch.h>

// OSKextGetRunningKernelArchitecture is not available in
// the 10.6 SDK headers, but exported since 10.6.
extern const NXArchInfo *OSKextGetRunningKernelArchitecture(void);

static BOOL Is64BitKernel()
{
	BOOL isK64 = NO;
	
	const NXArchInfo *archInfo = OSKextGetRunningKernelArchitecture();
	if (archInfo != NULL)
	{
		isK64 = ((archInfo->cputype & CPU_ARCH_ABI64) != 0);
	}
	
    return isK64;
}

int main (int argc, const char * argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
	
	fprintf(stderr, "Is 64-bit kernel: %d\n", Is64BitKernel());
   
    [pool drain];
    return 0;
}

And don’t forget to link against the IOKit framework.

Also note that it is quite easy to make the previous code compiling with the 10.5 (or earlier) SDK by dynamically getting the address of the OSKextGetRunningKernelArchitecture function and checking if the address is not NULL.


Intel 64-bit summary

Posted: January 8th, 2010 | Author: | Filed under: macOS | Tags: , , , , , , , , , , | 6 Comments »

Since people are confused regarding Intel 64-bit, here is a brief summary of what can run on which Intel processor.

To run a 64-bit application, you obviously need a 64-bit processor. All the machines that Apple currently ships have a 64-bit processor.

  • Only the ‘Intel Core Solo‘ and ‘Intel Core Duo‘ processors are 32-bit. On such machines, you won’t be able to run 64-bit apps.
  • The ‘Intel Core 2 Duo‘ and ‘Xeon‘ processors are 64-bit.

Useful link on Apple Support: How to tell if your Intel-based Mac has a 32-bit or 64-bit processor.

If you have a 64-bit processor (‘Intel Core 2 Duo’ or better), there are 3 levels of 64-bit applications:

  • to run a 64-bit faceless application: you need 10.4 and later.
  • to run a 64-bit application with UI (Cocoa): you need 10.5 and later.
  • to run the 64-bit kernel (and run 64-bit kernel extensions): you need 10.6 and later and a K64-capable machine (the EFI needs to be 64-bit). By default only the Xserve (2008 and later) will run the 64-bit kernel. On other K64-capable machines, you have to explicitely turn on the 64-bit kernel to use it.

Useful link on Apple Developer: Introduction to 64-Bit Transition Guide.