Adjusting VM Options for Android Studio on Mac

After six weeks of being knee-deep in iOS, I am switching back to the Android side of my brain, which includes finally getting into Android Studio.

For those of you in the same boat as me and wanting/needing to tweak your VM options on Mac OS X, you will follow the same basic procedure as editing VM options on IntelliJ, which JetBrains's Serge Baranov spells out in a couple of posts.

  1. Find Android Studio in your /Applications folder.
  2. Right-click on Android Studio and select "Show Package Contents."
  3. Open the bin directory.
  4. Copy idea.vmoptions to ~/Library/Preferences/AndroidStudioPreview.
  5. Open ~/Library/Preferences/AndroidStudioPreview/idea.vmoptions in your text editor of choice.
  6. Tweak them settings.

If you wanted, for instance, to change the value for ${USER}, which is used in the Java file header, you can add the following:

    -Duser.name=Elisabeth Braddock

(Of course, inserting the user name of your choice.)

Curious as to why we copy idea.vmoptions to the Prefences folder rather than just editing the original options file (as works with Eclipse)? Serge warns that changing the file violates the application signature. On the perk-y side of things, utilizing a copy means your tweaks will persist through application updates.

Note: The folder name "AndroidStudioPreview" will more than likely change whenever Android Studio does a proper release. So do not forget to verify the preferences directory, all you future Android devs.