Connect the React Native Emulator to Intellij IDEA

Florian Hirsch
Dec 12, 2017 · 2 min read

React Native displays a red screen when an error occurs in debug mode:

The great thing here is that you can jump to the source file by clicking the relevant line of the stack trace. This is incredible helpful if the error is located in your dependencies. The node_modules folder of my current project counts 731 subdirectories. Searching manually is absolutely frustrating.

In my case the source file was always opened in Visual Studio Code while I’m developing with Intellij IDEA. I never knew how to configure this until I noticed this hint:

When you see Red Box with stack trace, you can click any stack frame to jump to the source file. The packager will launch your editor of choice. It will first look at REACT_EDITOR environment variable, then at EDITOR. To set it up, you can add something like export REACT_EDITOR=atom to your ~/.bashrc or ~/.zshrc depending on which shell you use.

No idea why I didn’t notice this earlier but perhaps I’m not the only one … Remaining question is: How do you open Intellij IDEA from command line?

In IDEA go to “Tools” -> “Create Command-line Launcher…”. Then set the path of the launcher script and export it in your .*rc file.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store