Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing default JavaScript editor for iOS simulator

I am using react-native to develope an iOS app. When I click on an error on the iOS simulator, it opens Sublime Text as the editor.

Is there a way to change the behaviour so it opens the error file in another IDE(webstorm)?

I've tried deleting Sublime Text or changing the file association in Get Info, none of them worked.

like image 646
NameTaken Avatar asked Nov 08 '16 14:11

NameTaken


People also ask

How do I change the simulator in React Native iOS?

Specifying a device​ You can specify the device the simulator should run with the --simulator flag, followed by the device name as a string. The default is "iPhone 13" . If you wish to run your app on an iPhone SE (2nd generation), run npx react-native run-ios --simulator='iPhone SE (2nd generation)' .

How do I run a React Native project in Xcode?

Using Xcode directly The second way to build and run a React Native app is to use Xcode directly, which is the method I use. Inside Xcode navigate to File → Open and browse to your project directory. In the iOS folder, select appName. xcodeproject or appName.


1 Answers

You should add an environment variable named REACT_EDITOR in your profile file and set it to your IDE of choice. I work with zshell so I added the following line to my .zshrc file

export REACT_EDITOR="/Applications/IntelliJ\ IDEA.app/Contents/MacOS/idea"

Don't forget to close all of your terminal windows and restart the react-native packager before you try it.

like image 83
Ofir D Avatar answered Oct 13 '22 04:10

Ofir D