how do i stop the IDE from using mac library and

force it to use documents/arduino?

What exactly do you mean by "use"?

When arduino is installed on Mac and run for first time, it creates Arduino folder in the Mac user's Documents folder. Are you saying you've this folder is not there?

It is possible to set the Arduino IDE to use any pathway by making changes in Preferences. Have you checked to see where the IDE is being pointed to?

actually there is this Arduino15 that keeps showing up. But I notice, on my other machine it is not there. Is that because I had to install a prior version to get some kit i bought to work?

sevenoutpinball:
actually there is this Arduino15 that keeps showing up.

The only way to prevent the creation and use of the /Users/{username}/Library/Arduino15 folder is to run the Arduino IDE in portable mode (which will cause a folder inside the Arduino IDE installation to be used instead:
https://www.arduino.cc/en/Guide/PortableIDE
Of portable mode on macOS, the documentation says this:

The portable installation is not officially supported on Apple's Mac operating systems for several reasons. One of them is related to the package signature (we sign the Arduino IDE package): adding any content - like additional cores, libs and sketches - to the package will break the signature. A consequence of that is the reaction of the Gatekeeper that could even stop the app from starting. This is related to the OS and not to our IDE. Anyway, if you want to experiment you can check this forum thread and try by yourself the solutions developed by the community.

So that's discouraging, but there is information at the forum link that tells you how it can be done if you still want to have a try.

sevenoutpinball:
But I notice, on my other machine it is not there.

I don't own a Mac, but I know that on Windows and Linux the folder was in the same location, but named Arduino when using the Arduino IDE 1.0.x versions. Unless you're running in portable mode, I'm pretty sure that all Arduino IDE versions have created a separate data folder.

This folder is used to:

  • Store the preferences.txt, which contains your File > Preferences settings.
  • Store hardware packages you download via Boards Manager.
  • Store the index files, and archive files of Boards Manager and Library Manager downloads.

Hi Pert,

I've been trying to set up portable mode on my mac but run into a problem when I create the portable directory in the app bundle. The app will not start after I do that. If I remove the portable directory, the app starts fine. I think gatekeeper (macOS Mohavi) is preventing the app from running because it has been modified. Do you know a way around this?

Steve

I have multiple directories with different code and libraries in each of them. The way I control all of this is a bit kludgey, but it works for me.

First off, I use an external editor called Atom(open source, free). Each of my Arduino project folder's is kept as a separate project in Atom.

Next, the kludgey part. I keep multiple copies of the Arduino15 folder, one for each Arduino project folder. Before compiling and uploading, I put the appropriate Arduino15 folder into my home's Library folder. After that I compile and upload.

Note: the Library folder is hidden and not normally accessible. CMD+shift+dot reveals hidden folders on the Mac.

Like I said, kludgey, but for the Mac it works. By the way, I highly recommend Atom as a source code editor. It's very powerful and very very customizable.

sslupsky:
The app will not start after I do that.

I'm sorry to hear that. Well, it was worth a try anyway.

sslupsky:
Do you know a way around this?

I have zero experience with Mac and don't have access to one to try things out so I could only parrot what was said on the forum thread I linked above. Others here on the forum are knowledgeable about Mac so hopefully one of them will be able to provide assistance.

pert,
I bought my first Apple computer, the Apple IIe when it first came out. It was then that I got hooked on computers and programming. I've been using Apple computers ever since.

I was also on the ground floor when DOS first come out and I've been playing with DOS and then Windows ever since.

And I can't forget getting introduced to UNIX and C, shortly after C was first released.

So, I guess I've been around the block a few times :slight_smile:

I accept your qualifications DBMcDonald. So, please tell sslupsky how they can appease Gatekeeper after putting the Arduino IDE in portable mode.

As noted in the PortableIDE installation notes, there is no solution for the Mac due to the way executables are handled. As the note indicates, Mac executables are a "package", a folder of files and sub-folders that the OS interprets as an executable. Making changes to this entity is like trying to hack an .exe file in Windows.

The only correct solution would be for the Arduino IDE developers to change the requirement of putting the Portable folder in the IDE installation directory to putting it in the user's Arduino directory in the same way the Libraries directory is handled.

Thanks pert & DBMcDonald for taking the time to get back to me.

I have not been able to address the issue with Gatekeeper. That issue pretty much prevents me from being able to use the "Portable" method documented by Arduino.

However, I did find a bit of a work around using symbolic links. When I first tried to use a symbolic link in the package directory to link to my local Git repo, the compile failed. I finally tracked the problem down to the package version number. The package that was installed was a different version from the one I downloaded from the Git repo. So, even though I used the same directory name as the installed package, the compile would fail. I surmise from this experience that there is a version check and that was causing the compile failure. I updated my installed package to be the same as the Git package and then created the symbolic link to my localGit repo. Voila! the compiles started to work again.

So, for anyone that stumbles across this, you need to ensure that the version of the installed package and the Git repo you clone are the same. Also note, you cannot have multiple directories as mentioned by westfw in this post: How to change the default path of Arduino core - Installation & Troubleshooting - Arduino Forum The reason is that Arduino recognizes both directories and looks in both of them when it compiles the code. Which directory it uses appears to be random (I am sure there is some logic but I do not know what it is). I had a situation where all but one of the files was being pulled from the local Git repo and one was being pulled from the "original" package. I had to move the "original" package directory out of the path to prevent the compiler from using it.

I agree with DBMcDonald, having all the libraries in one place would be a great way to operate. We can always make as many backups as we need later.