Perform Manual Procedures

The following procedures are provided in case important changes have been done to the project, as the automatic procedure can only be launched once.

Declare Sketch .pde or .ino File as C++ File

This manual procedure is no longer required as it is included in the automatic procedure.

The sketch .pde or .ino file is considered as plain text. For code-sense, it should be declared as C++ file.

  • Select the sketch .pde or .ino file.

In the rightmost column,

  • Click on the drop-down list of File Type.

  • Select C++ source.

Now, the sketch is considered as C++ code for code-sense.

Declare User's Sketchbook

This is an optional procedure as, by default, embedXcode reads the path automatically from the configuration file of each IDE.

The user's sketchbook is a folder where the user's sketches are saved, among them the libraries in a dedicated sub-folder Libraries.

It is defined on the IDE of each board, Arduino, Energia, Maple, Teensy or Wiring.

By default, embedXcode takes the value for SKETCHBOOK_DIR automatically from the configuration of Arduino, Digistump, Energia, Maple, Teensy or Wiring.

Please note that each IDE has its own sketchbook directory. So changing the board also changes the sketchbook.

To set one sketchbook directory for all boards, proceed as follow:

  • Select the project on top of the leftmost list,

  • Select the project under the PROJECT list,

  • Select the Build Settings pane,



  • At the very bottom, double-click on SKETCHBOOK_DIR,

  • Either type in the name of the folder

  • Or drag-and-drop it from a Finder window.

The ~ character, shortcut for the Home folder, is accepted.

Add User's Libraries

The manual procedures are no longer required as they are now included in the automatic procedure.

However, if you change the platform, you may need to add manually the user’s libraries for the new platform.

  • First, make sure the sketchbook folder has been created with a Libraries or libraries subfolder.

To install the Sketchbook/Libraries or Sketchbook/libraries folder.

The name of the folder for the libraries can have a capitalised first letter Libraries or not libraries.

  • Then, for each board, open the corresponding IDE and define the sketchbook path in the Arduino in the menu Arduino > Preferences > Sketchbook location.

The same procedure applies for all the other IDEs: Digistump, Energia, Maple, Teensy or Wiring.

  • Back on Xcode, open the Sketchbook group on the project hierarchy.

  • Right-click to obtain the contextual menu.

  • Choose Add file to...

  • Still in Xcode, select the Library sub-folder on the sketchbook folder.

  • Check Index under Add to target.

  • Either Create groups for any added folders or Create folder references for any added folders is relevant. Select one.

  • Don't check Copy items into destination group's folder (if needed) to avoid duplicating files.

  • Finally, validate with Add.

As an alternative,

  • Drag and drop the Libraries folder under the Sketchbook group.

 + Check Index under Add to target.

  • Both Create groups for any added folders and Create folder references for any added folders are relevant.

  • Don't check Copy items into destination group's folder (if needed) to avoid duplicating files.

  • Finally, validate with Finish.

The project hierarchy shows now all your libraries.

Before and after

Xcode adds the .cpp files of the libraries but omits the .h headers.

This is an option and needs to be done manually.

Declare Sources for Code-Sense

The selection of a board defines the headers for code-sense. So Xcode needs to be taught where to find them.

  • Select the target Index and the Build Phases pane.

  • Go a the bottom of the list and click on the + button.

A list shows up.

  • Select all the .h and .cpp files and click on Add.

Define the Directories for the Targets

This manual procedure is no longer required as it is included in the automatic procedure.

The template doesn't allow to specify the exact directory for the targets. In case of a building error, the click-to-error feature may not work properly for the main sketch and the local libraries.

So Xcode needs to be taught where to find them.

This is an optional procedure.

  • Select the target All.

  • By default, the template mentions all -C $(PROJECT) as arguments.

  • Remove -C $(PROJECT) from the arguments and add $(PROJECT) as directory.

  • Feel free to update other targets you use often, as Build and Make.