Getting Started with Porting

Technology Overview

Mac OS X is an operating system with a modern GUI and application support frameworks layered on top of a UNIX-based core. Because of this design, there are many layers at which you might port your application.

If you want to port a UNIX or Linux application to Mac OS X, you should focus primarily on Darwin. The lowest layer of Mac OS X, Darwin includes the kernel, device drivers and driver support frameworks, a BSD personality layer, and various libraries and command-line utilities.

For GUI developers, Mac OS X provides three primary programming environments: Carbon, Cocoa, and Java.

Carbon is a procedural C-based environment based on classic Mac OS APIs, similar to that of Win32 on Windows and X11 on UNIX/Linux. Cocoa is an Objective-C/Java-based programming environment, including an advanced, object-oriented GUI toolkit. Objective-C allows you to integrate C++ and C code into Cocoa applications, while Java-Cocoa allows you to integrate some Java code. Finally, Mac OS X provides a full Java development kit (JDK), which makes porting Java code easy.

Mac OS X also provides a number of cross-platform APIs such as OpenGL that may be of particular interest if you develop games or other highly graphic-intensive applications.

You can find more information about these environments by reading the getting started pages for Getting Started with Carbon, Getting Started with Cocoa, and Getting Started with Java.

Start Here

Before you begin porting an application to Mac OS X, you should read Porting and Mac OS X Technology Overview. This will help you familiarize yourself with Mac OS X at a broad, general level.

You should also spend time getting used to the Mac OS X developer tools. A good place to start is by reading Getting Started with Tools.

Choose a Learning Path

There are generally two stages of any porting effort. The first stage is making your application compile on Mac OS X. The second stage is making your application look and feel like a native Mac OS X application.

Porting from Other Environments

Creating a Mac OS X Look and Feel

For more information on making your application look like other native Mac OS X applications, read Apple Human Interface Guidelines.

Next Steps

The Porting Reference Library includes the following high-level resource pages, which can be bookmarked for easy access.

  • Guides

    Conceptual and how-to information for porting.

  • Reference

    Focused, detailed descriptions in reference format for porting.

  • Sample Code

    Sample applications demonstrating a wide variety of porting issues and solutions.

  • Technical Notes

    Late-breaking documents on issues related to porting.

  • Technical Q&As

    Programming tips, code snippets, and FAQs by Apple’s support engineers.

  • Mailing Lists

    Apple has several mailing lists for discussing porting topics: To discuss importing UNIX-based software to Mac OS X, join unix-porting. To discuss Darwin software development, join darwin-development. You may also be interested in discussion of Macintosh games development (mac-games-dev) and OpenGL on the Macintosh (mac-opengl). In addition, there are lists for discussing software development in Carbon (carbon-development) and Cocoa (cocoa-dev).

You may also find this website helpful:

© 2004, 2008 Apple Inc. All Rights Reserved. (Last updated: 2008-10-15)

Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.