AudioUnit new project template for Xcode 5/6/7

AudioUnit new project template for Xcode 5/6/7


I finally got around to this: When apple updated past the first version of Xcode 4, they pulled the AudioUnit new project templates and never replaced them. This led to much pain and gnashing of teeth on the part of developers and would-be developers looking into AudioUnits for the first time. So with much pain and annoyance, I spent the weekend updating their ‘most recent’ AudioUnit effect template to make them compatible with the most recent Xcode versions (as well as making a few personal changes).

I included those instructions in a readme file with the archive, but let me explain here in greater detail. This should build a working project right out of the box after these three steps:

1) Download the template:

2) Drop this template in either ‘home/Library/Developer/Xcode/Templates’ or ‘/Applications/’

3) Make sure to have Apple’s Core Audio Utility classes’ “CoreAudio” folder in the top level of your developer directory — the default now is in the /Applications/… . (You can alternatively change the path to the source files in the *.xctemplate if you prefer a different location).


Now you are good to go! Here is the result:


Make a new project:


Select our new template:


and set our options:


“Product Name:” will be both our project and product name.
“Organization Name:” is either your name or your company.
“Organization Identifier:” is your 4-char manufacturer code from Apple (just make it up if you don’t have one, just make sure that it is 4 letters.
“Subtype:” is the unique 4-char identifier for you plugin. Make sure it is UNIQUE to each plugin.

You will be presented with a window something like this:


You can see that it is a very simple structure, with all the relevant files in the main directory. I tried not to obscure anything important or convolute the code with too many options. I added localized project strings and version plists to the template directory for convenience, but I did not include them in the default build. Those can be added to the project to *.xctemplate plist if you wish.

Since I left MOST of the options at the Apple default values, you may want to change them to suit you. If left as-is, it will build with the most recent SDK in 64-bit mode only, and without ARC. I modified the template to provide legacy support for 32-bit and the carbon component manager resource, just because I like supporting older gear where possible. However, I did not try any of the PowerPC SDKs because I don’t have a machine to test them on… sorry.

The default build location is the DerivedData folder. If you wish, you can add a script build phase to move the build to your plunges folder. This is the script that I use:

rm -rf $HOME/Library/Audio/Plug-Ins/Components/$PRODUCT_NAME.component
cp -r “$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.component” “$HOME/Library/Audio/Plug-Ins/Components/$PRODUCT_NAME.component”

Simply click the + to add a script phase:


Then past the script:


In the near future, I will write a blog on customizing the template, but for now… Happy coding!



(UPDATE 12/2015: confirmed working in Xcode 7.2)


About alexkenis

Guitarist, philosopher, tinkerer


  1. Hey, I downloaded the template and every time I try to run a blank template it gives me this error.
    /Applications/ ### /Applications/ – Undefined variable (RES_ID) not allowed in expression.
    /Applications/ ### /Applications/ – Expected number, but got ‘,’
    /Applications/ ### /Applications/ – Undefined variable (RES_ID) not allowed in expression.
    /Applications/ ### /Applications/ – Expected number, but got ‘,’
    /Applications/ ### /Applications/ – Undefined variable (RES_ID) not allowed in expression.
    /Applications/ ### /Applications/ – Expected number, but got ‘)’
    /Applications/ ### /Applications/ – Undefined variable (RES_ID) not allowed in expression.
    /Applications/ ### /Applications/ – Expected number, but got ‘,’
    /Applications/ ### /Applications/ – Since errors occurred, /Users/JoshuaGonzales/Library/Developer/Xcode/DerivedData/okay-crqydipwmhigxkgyxvlgrpiaakzq/Build/Intermediates/’s resource fork was not written.
    Command /Applications/ failed with exit code 2

    do you know how to fix it? I tried everything.

  2. I tried the template again with the new Xcode 7.3, and it works fine for me. MAYBE the rez bundle identifier is malformed? I would check to be sure it is 4-characters long, and includes only uppercase and lowercase letters, and then try again.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: