First, ensure you're using at least version 0.60.4 of React Native.
If you have an existing app based on an earlier version of React Native, you will have to upgrade it first. See Upgrading to new React Native Versions for how to do this. Make especially sure that all changes to
android/app/build.gradle have been applied, as detailed by the React Native upgrade helper. After upgrading the app, make sure everything works before trying to switch to Hermes.
Each Hermes release is aimed at a specific RN version. The rule of thumb is to always follow Hermes releases strictly. Version mismatch can result in instant crash of your apps in the worst case scenario.
Hermes requires Microsoft Visual C++ 2015 Redistributable
android/app/build.gradle file and make the change illustrated below:
Also, if you're using ProGuard, you will need to add these rules in
Next, if you've already built your app at least once, clean the build:
That's it! You should now be able to develop and deploy your app as normal:
Android app bundles are supported from react-native 0.62.0 and up.
If you've recently created a new app from scratch, you should see if Hermes is enabled in the welcome view:
To see the benefits of Hermes, try making a release build/deployment of your app to compare. For example:
Note that this is very different with the "Remote JS Debugging" from the In-App Developer Menu documented in the Debugging section, which actually runs the JS code on Chrome's V8 on your development machine (laptop or desktop).
Chrome connects to Hermes running on device via Metro, so you'll need to know where Metro is listening. Typically this will be on
localhost:8081, but this is configurable. When running
yarn start the address is written to stdout on startup.
Once you know where the Metro server is listening, you can connect with Chrome using the following steps:
chrome://inspectin a Chrome browser instance.
Configure...button to add the Metro server address (typically
localhost:8081as described above).
You should now see a "Hermes React Native" target with an "inspect" link which can be used to bring up debugger. If you don't see the "inspect" link, make sure the Metro server is running.