A real IDE for #unity3d: how to install JetBrains Rider C# editor on Mac (2017) #unitytips

I joined the EAP for Rider about a year ago, but it had too many problems for me (personally) to make it my main editor on Mac (mostly: it coped poorly with running on non-Windows machines, integration with Unity was wonky). These were all workaroundable, but life’s too short to use a wonky IDE, so I waited, and periodically re-tested to see if it was easy yet.

That day has come! Installing the C# IDE on Mac is finally quick and easy.

August 2017 update: if you’re using Unity v2017, Rider is now supported by Unity directly, so you shouldn’t need to do most/any of this!

Pre-requisites

  1. A Mac, running a recent-ish copy of OS X (I tested on latest: 10.12.3)
  2. A copy of Unity 5.5.0 or later installed on your machine

If you only make games, you probably have 5.5.x or 5.6 installed by now. My game is built in 5.4, and Unity’s backwards compatibility is non-existent (my experience so far: most versions of Unity 5 seem to corrupt each other’s project files), but you only need a copy of 5.5.x+ installed, you don’t need to be actually using it.

(as an Asset Store developer, I have copies of: 4.6, 5.0, 5.1, 5.2, 5.3, 5.4, 5.4.3, 5.4.4, 5.5.0, 5.5.2 currently installed. Unity is cool with this – no problems. Everything “Just Works”)

Alternatively, you can download and install a separate version of Mono, for your Mac, but I had a lot of problems when I did this – it got MonoDevelop confused, it got Rider confused, it got OS X confused. My advice: just don’t. Mono is not supported well enough on OS X yet.

Steps

This bit was confusing. There is no documentation anywhere from Rider explaining how to install Rider with Unity. Instead, there are partial docs, in different places, which pretend that you know everything and that you will read the minds of JetBrains dev-team and guess what to do.

So, to be really clear:

  1. Install Rider (obviously)
  2. Install the Resharper-Unity plugin (not obvious: you’re not using Resharper, and the docs suggest you don’t need it. But you do. NB: this is “auto suggested” by the installer – the installer is great)
  3. Configure Unity to use Rider
  4. Configure Rider to use Unity
  5. Install the Unity3DRider plugin

Every step is required! (as of April 2017) Do not be fooled into thinking you need fewer than “all” of them. i.e. “don’t do what I did the first time round”.

Install Rider

Easy … https://www.jetbrains.com/rider/download/

Install Resharper-Unity plugin

For me, this was automatically offered during the install process, so I accepted it. It Just Works, so I recommend you accept it too.

Configure Unity to use Rider

From the official Jetbrains instructions at bottom of this page:

Set Rider as the default External Script Editor

“This only needs to be done once.

  1. Open Unity.
  2. Go to Edit → Preferences → External Tools.
  3. Select “Browse” in the External Script Editor dropdown and select the Rider application.
  4. On Windows, navigate to %APPDATA%\Microsoft\Windows\Start Menu\Programs\JetBrains Toolbox and select “Rider”
  5. On Mac, select ~/Applications/Jet Brains/Toolbox/Rider.app or /Applications/Rider.app
  6. On Linux, select rider.sh

Install the plugin into your project

From the same official page – except their instructions are slightly wrong (they work, but are overkill).

This needs to be done for each project.

Copy the folder Assets/Plugins/Editor/JetBrains from this repository into Assets/Plugins/Editor/JetBrains in your project.

…Note: you do NOT need to copy the linked files (currently: two .cs files) into “Assets/Plugins/Editor/JetBrains”. The code works fine if you follow whatever standard you’re using in your project. The only requirement is that ONE of the parent/grandparent/etc folders is named “Editor” (this is a Unity feature).

e.g. I put mine in: Assets/Plugins/3rd-party/RiderEAP/Editor/

Configure Rider to use Unity

Tricky. First of all:

Quit Rider and restart it via Unity

Do this by finding any of your scripts in Unity Editor and double-clicking them. If you’ve done the steps above correctly, a new copy of Rider will open, and will open the script automatically.

If you don’t do this, Rider will try and get you to create a new project, which is a road of pain and suffering you want to avoid (you want Unity to managing the project, not Rider).

Nothing works; Fix the bug

If you wait a bit, and watch the status-bar at bottom of the screen, you’ll see an error appear. Click on the status bar for more info (this is standard JetBrains IDE behaviour). You’ll see this error:

Solution ‘MY GAME HERE’ load failed
Rider was unable to detect a Mono runtime on this machine.

Don’t click the link in the error message! The error comes because OS X doesn’t include Mono, and nor does Rider. But this is where your copy of Unity 5.5+ comes in handy. Courtest of this Rider bug report, we learn that we can use the copy of Mono in Unity 5.5, and how.

Open up Rider’s preferences (cmd-, as normal for OS X):

UPDATE June 2017: Jetbrains has made a breaking-change to Rider, and this setting no longer exists. If the old way was working for you, you must now re-do it with the following setting instead:

…thanks to Ilya for figuring this out, and Kirill from JetBrains for telling us the new setting-name.

…hit the button on the right to browse, and navigate to the folder: " /Applications/Unity/Unity.app/Contents/MonoBleedingEdge" (NB: if you have different versions of Unity installed, you’ll want to navigate to /Applications/Unity-5.5, or Unity5.6, instead – wherever you installed your 5.5+ version to).

Rider will think for a bit – watch that status bar – and you should see the left-hand pane auto-update to look exactly like it does in MonoDevelop (sorry no “before” screenshot, I didn’t think to capture it in time):

Party

Final step: realise you now have a real IDE, with wonderful, 21st-century, source control options, formatting THAT WORKS (@MonoDevelop/Xamarin: don’t call us, we’ll call you…never), intelligent code-hints and auto-fixes, etc. Knock yourselves out…

10 thoughts on “A real IDE for #unity3d: how to install JetBrains Rider C# editor on Mac (2017) #unitytips

  1. Louis

    THIS PART:
    “Install the plugin into your project

    From the same official page – except their instructions are slightly wrong (they work, but are overkill).

    This needs to be done for each project.

    Copy the folder Assets/Plugins/Editor/JetBrains from this repository into Assets/Plugins/Editor/JetBrains in your project.
    …Note: you do NOT need to copy that int “Assets/Plugins/Editor/” etc. Just make sure the Editor folder is somewhere in your project. The JetBrains team have got this wrong: you’re supposed (according to Unity’s optional guidelines) to make the structure “…(anything)…/JetBrains/Editor/”, and allow the user to put it where they want. The code works fine if you re-order the folders as they should be, so you’re safe to follow whatever standard you’re using in your project.”

    Where do I find the original file to copy over to my project/assets/plugins/editor/jetbrains folder? Did they change something recently because I can’t figure out what you’re talking about. Are you trying to say /Applications/Rider.app/Contents/Plugins/rider-fsharp folder?

  2. adam Post author

    Ugh, sorry, I forgot to link that in directly. I’ve updated it with a direct link and clearer instructions. Enjoy Rider!

  3. PixelHacked

    Awesome Post.

    As of today’s date. I simply installed Rider and selected the Unity plugin during the installer process. Afterwards, I just created the Plugins folder and added the two scripts from the GitHub repro and voila….works like a charm.

    Thanks.

  4. adam Post author

    Enjoy Rider :).

    I had one of the recent builds self-destruct on me – corrupted itself and wouldn’t work any more in Unity – but delete + re-install fixed it. In general, the Rider builds seem more than stable enough for production work right now.

  5. Mochamad Iqbal Dwi Cahyo

    Awesome. Been experience using Android Studio, now switching to Unity and Rider come to life. Development will never be easy, this ways :D

    Thanks @adam for bringing this great tutorial for us!

  6. Ilya Belyy

    In case someone else run into this problem:

    After the previous version “expired” and refused to launch, Rider could no longer see unity types.
    The ‘mono’ path is missing completely from preferences menu, so I could not point it to Unity.
    As a workaround I had to install the vanilla mono on my Mac.

  7. adam Post author

    The latest build DOES NOT WORK AT ALL for me, I’m talking to JetBrains staff trying to figure out why not, and workarounds.

    The mono-path might be (almost certianly is!) part of the problem – Ilya, I’ll email you separately, I think JB guys would like to hear from you / help (they gave me a special old build that works temporarily).

  8. Michael Thomas

    Thanks for the instructions. Since Rider 2017.1 it seems to work out of the box. So Iinstalled Rider, selected it in Unity Preferences as Editor and started working. I clicked on a script file in unity and Rider started. The first time Rider is starting with a Unity project it does a lot of indexing (please be patient). The Unity Plugin is installed automatically as event log says:
    Unity: plugin installed
    Rider plugin v2.0.2.2395 for the Unity Editor was automatically installed for the project ‘xlarn2’
    This allows better integration between the Unity Editor and Rider IDE.
    The plugin file can be found on the following path:
    ..\Assets\Plugins\Editor\JetBrains\Unity3DRider.cs.
    Please switch back to Unity to make plugin file appear in the solution.

    Awesome!

  9. adam Post author

    Nice. I’d heard that it was being integrated officially with Unity for 2017 – good to hear it works!

Leave a Reply

Your email address will not be published. Required fields are marked *