Xcode Integration

I'd like to use the Xcode 3.1 IDE to develop, compile, link and upload to an Arduino Duemilanove with ATMEGA 328, but the only help I can find for this is dated and unlikely to work today.

I would hope that Xcode could be cajoled to support full integration with all the tool bar options behaving as expected. Obviously, the Run command would need to be replaced with an Upload button. Surely, this has to be possible, but I can't figure it out.

I'm also very confused about the various release versions for the tools, but the current Arduino-013 versions do work. Maybe these could be moved to an Xcode friendly location, but where?

So, I'm hoping that someone has figured all this out and may be able to help. Maybe someone has developed an "easy install" shell script and a few Xcode Project Templates.

Is any of this possible? Does anyone know how to do this?


Check the archives and playground for instructions on building arduino apps using the "command line" or "makefiles", and see the section on the "build process internals": http://arduino.cc/en/Hacking/BuildProcess That should turn up useful info.

I am working on full Xcode integration. Previous attempts/solutions at Xcode integration used a makefile which is not the experience I was looking for. This is not a simple task because most of what needs to change to make this happen is not publicly documented by Apple. The goal is to allow an Xcode developer to build sketches in the same fashion as building an OS X native app.

chumbud: I really hope you’re able to crack this, as it seems a large number of people will extremely grateful. The best I can do at the moment is as follows:-

1 - create a new Arduinio project using the Arduino IDE with a name such as MyProject-A (this where all the source files must live).
2 - create a new Xcode project and name it MyProject-X.
3 - Add the existing MyProject-A.pde file to the Xcode project.
4 - In the MyProject-A.pde info box, tell Xcode to treat it as a sourcecode.cpp.cpp type.
5 - Edit away in Xcode, adding new C++ classes, etc. and add the following statement to the top level class h file:-

  *  NB: comment or uncomment the follwing defines accordingly

      #import <iostream>
      typedef uint8_t byte;
      #define ALOG(msg) /* do nothing */
      #ifdef ENABLE_XLOG
            #define XLOG(msg) { std::cout << (msg) << std::endl; }
            #define XLOG(msg) /* do nothing */
      #import "WProgram.h"
      #define XLOG(msg) /* do nothing */
      #ifdef ENABLE_ALOG
            #define ALOG(msg) { Serial.println(msg); }
            #define ALOG(msg) /* do nothing */

6 - Command-B to check the syntax till happy.
7 - From finder, open the Arduino project.
8 - If minor alterations are needed, Xcode will pick them.

Unfortunately, it’s always necessary to reopen Arduino when changes have occurred in Xcode. Otherwise, both IDE’s could have been used concurrently.

PS. I’ve bought the book “Xcode 3 UNLEASHED” by Fritz Anderson, so maybe this might reveal a secret or two.