Arduino on Xcode Project — Official Thread

avenue33:
Each release of Xcode changes the way code-sense works.

I suggest to get rid of the whole core library for code-sense block and keep only

#include "Arduino.h"

Also, launch one compilation.

No luck, here's what I did.

  • Changed INO file so only had #include "Arduino.h" in the Code-Sense block
  • Saved and closed the project
  • Went to organizer folder and deleted Derived Data
  • Opened my project
  • The project re-indexed itself
  • Ran Build

Attached is a screenshot of what the code looks like after doing this.

Edit: The auto-complete does seem to work, it's just the colors don't match what I see in your manual.

Screen Shot 2013-04-17 at 8.34.59 AM.png

The procedure you've followed is basically this described on section 4.6 Re-Index the Keywords for Code-Sense.

Strange enough, code-sense, auto-completion and arguments list are displayed usually without problem in my laptop. Now, it isn't a 100% hit and Xcode dedicated forums recommend the procedure you've followed and I've mentioned in the user manual.

Unfortunately, as code-sense implementation changes with every Xcode release and as Apple is more than secretive about the customisation of Xcode, I'm sorry I can't be of much help.

avenue33:
The procedure you've followed is basically this described on section 4.6 Re-Index the Keywords for Code-Sense.

Strange enough, code-sense, auto-completion and arguments list are displayed usually without problem in my laptop. Now, it isn't a 100% hit and Xcode dedicated forums recommend the procedure you've followed and I've
mentioned in the user manual.

Unfortunately, as code-sense implementation changes with every Xcode release and as Apple is more than secretive about the customisation of Xcode, I'm sorry I can't be of much help.

I think code-sense is working but the colors are different from your manual. Or maybe it's partially working.
Can you give me links to the xcode forums you like to go to?

I have another smaller issue, not a show stopper. When I create a new project, xcode does no do a reindex on it's own. But when I go do my first build and where embedxcode does it's thing, the Build is cancelled because the index starts. I did notice the the embedxcode changes all seem to be there, so that's good. Once the indexing is done, if I start another Build, it finishes okay. Is there a way for me to make xcode do the index so it doesn't just start it on it's own and cancel my first Build. I guess I could follow the code-sense same re-indexing procedure, but I'm wondering if there is something more direct. I tried Run > Index, but that didn't work, I guess that's for something else.

ScottG:
I think code-sense is working but the colors are different from your manual. Or maybe it's partially working.

Yes, the colours may vary, due to different available configurations —see attached screen-shot— and due to different interpretation of the functions as Project Class Names or Other Class Names, Project Function and Method Names or Other Function and Method Names.

ScottG:
Can you give me links to the xcode forums you like to go to?

Sure, Newest 'xcode' Questions - Stack Overflow and http://apple.stackexchange.com

ScottG:
I have another smaller issue, not a show stopper. When I create a new project, xcode does no do a reindex on it's own. But when I go do my first build and where embedxcode does it's thing, the Build is cancelled because the index starts. I did notice the the embedxcode changes all seem to be there, so that's good. Once the indexing is done, if I start another Build, it finishes okay. Is there a way for me to make xcode do the index so it doesn't just start it on it's own and cancel my first Build. I guess I could follow the code-sense same re-indexing procedure, but I'm wondering if there is something more direct.

On embedXcode releases up to 40, the preparation of the project is done the first time compilation is asked for, but actually before the compilation really starts. As Xcode tries to do two thinks at the same time, it realises the project has been changed by the preparation and thus stops the compilation.

On embedXcode releases 41 and on, the preparation of the project is still done the first time compilation is asked for, but this time after compilation is completed, avoiding conflicts of multi-tasking.

The preparation provides Xcode with all the references required for building the index, so code-sense, auto-completion and argument list can work.

ScottG:
I tried Run > Index, but that didn't work, I guess that's for something else.

As explained in section 5. Build and Upload the Project — 5.1. Select a Target,

Index is a proxy target solely used for code-sense. Do not launch it.

avenue33:
On embedXcode releases up to 40, the preparation of the project is done the first time compilation is asked for, but actually before the compilation really starts. As Xcode tries to do two thinks at the same time, it realises the project has been changed by the preparation and thus stops the compilation.

On embedXcode releases 41 and on, the preparation of the project is still done the first time compilation is asked for, but this time after compilation is completed, avoiding conflicts of multi-tasking.

Isn't release 38 (April 8) the latest release?
Ref: Arduino on Xcode Project — Official Thread - #281 by avenue33 - Libraries - Arduino Forum

Please find a new release of embedXcode

embedXcode • Apr 12, 2013 release 39 • Arduino architecture new variables
embedXcode • Apr 13, 2013 release 40 • Arduino Duemilanove configuration file
embedXcode • Apr 16, 2013 release 41 • Estimated RAM usage

Arduino 1.5 new compilation variables are now included.
Estimated RAM usage and total RAM are displayed after compilation.

---- Size ----
Binary sketch size:  654 bytes (of a 16384 byte maximum)
Estimated SRAM used: 8 bytes (of a 512 byte maximum)
==== Make done ====


Based on the results of the survey, support for chipKIT, Maple and Wiring is put on hold until new boards or new versions of the IDEs are released.

As always,
• Website: http://embedxcode.weebly.com
• Download: http://embedxcode.weebly.com/download
• User guide: http://embedxcode.weebly.com/tutorial

I just installed release 41. I created a new project, but the embedxcode script isn't doing anything: core libraries are not added, file type is not changed etc. The build says it's successful, but I get these errors:

==== Build done ==== 
/bin/sh: Utilities/embedXcode_prepare: Permission denied
Showing first 200 notices only
Command /Applications/Xcode.app/Contents/Developer/usr/bin/make emitted errors but did not return a nonzero exit code to indicate failure

I have Xcode 4.6.1 on Mac 10.7.5

I attached the log.

Xcode log.txt (620 KB)

Strange, I haven't modified the embedXcode_prepare utility, built as 10.7 compatible.

Please try with release 42 just uploaded.

avenue33:
Strange, I haven't modified the embedXcode_prepare utility, built as 10.7 compatible.

Please try with release 42 just uploaded.

I installed r42 and still have the problem, but only when the new project is on a network drive (connected as WebDAV. When I create a project on the local drive it's fine. My computer has full rights to the network drive. Any suggestions?

Hi!

Have you tried Repair permissions with the disk utility?

avenue33:
Have you tried Repair permissions with the disk utility?

Disk Utility only lists my local disks, not network drives.

Can you give me some information as to what embedxcode is doing regarding this error?

==== Build done ==== 
/bin/sh: Utilities/embedXcode_prepare: Permission denied
Showing first 200 notices only
Command /Applications/Xcode.app/Contents/Developer/usr/bin/make emitted errors but did not return a nonzero exit code to indicate failure

Maybe that can help me figure out why it won't run when creating a new project on my network drive.

embedXcode only displays the error message provided by the system.

It seems the network connection prevents the utility from running successfully.

You can try to run embedxcode_prepare from the terminal window.

avenue33:
You can try to run embedxcode_prepare from the terminal window.

How do I do that?

ScottG:

avenue33:
You can try to run embedxcode_prepare from the terminal window.

How do I do that?

  • Create a new embedXcode project with Xcode, e.g. embed1
  • Close Xcode
  • Launch Terminal
  • Look for the full path of embedXcode_prepare at
    /Users/home/Documents/Xcode/embed1/embed1/Utilities/embedXcode_prepare
  • Look for the full path of embed1.xcproject at
/Users/home/Documents/Xcode/embed1/embed1.xcodeproj
  • Type in Terminal the command
    /Users/home/Documents/Xcode/embed1/embed1/Utilities/embedXcode_prepare /Users/home/Documents/Xcode/embed1/embed1.xcodeproj

home is the folder with your name.

avenue33:

ScottG:

avenue33:
You can try to run embedxcode_prepare from the terminal window.

How do I do that?

  • Create a new embedXcode project with Xcode, e.g. embed1
  • Close Xcode
  • Launch Terminal
  • Look for the full path of embedXcode_prepare at
    /Users/home/Documents/Xcode/embed1/embed1/Utilities/embedXcode_prepare
  • Look for the full path of embed1.xcproject at
/Users/home/Documents/Xcode/embed1/embed1.xcodeproj
  • Type in Terminal the command
    /Users/home/Documents/Xcode/embed1/embed1/Utilities/embedXcode_prepare /Users/home/Documents/Xcode/embed1/embed1.xcodeproj

home is the folder with your name.

I get permission denied:

mac_eth1:Utilities Scott$ /Volumes/srgshare/Arduino_Sketches/Test_webdav/Test_webdav/Utilities/embedXcode_prepare /Volumes/srgshare/Arduino_Sketches/Test_webdav/Test_webdav.xcodeproj
-bash: /Volumes/srgshare/Arduino_Sketches/Test_webdav/Test_webdav/Utilities/embedXcode_prepare: Permission denied
mac_eth1:Utilities Scott$

Unfortunately, I'm afraid I won't be of much help on this OS X-related issue. File permissions are always tricky,me specially in shared volumes.

You could trysudo chmod -R 777 /Volumes/srgshare/Arduino_Sketches/Test_webdav

avenue33:
Unfortunately, I'm afraid I won't be of much help on this OS X-related issue. File permissions are always tricky,me specially in shared volumes.

You could trysudo chmod -R 777 /Volumes/srgshare/Arduino_Sketches/Test_webdav

That didn't work. I'm using jungledisk software to create the network drive. I'll see if their tech support can help.

Can you try on your Mac hard disk instead?