You can automate all the migration steps below by running the following command in your existing React Native project. The CLI will detect your project and guide you through the migration process interactively, automatically updating all necessary files and configurations.
If you prefer to do it manually or encounter any issues, follow the steps below.
Install dev dependencies:
Remove @react-native-community/cli and related packages.
Add .rock/ folder with caches to .gitignore:
Add rock.config.mjs file:
Move any project config from react-native.config.js to platform arguments in rock.config.mjs, for example:
translates to:
Update Android files:
In android/app/build.gradle set the cliFile with the new path:
In android/settings.gradle change:
Update iOS files:
In ios/Podfile change:
In "Bundle React Native code and images" Build Phase in Xcode add:
Cleanup native files:
Update scripts in package.json:
Run new commands:
Additionally rename flags:
--mode to --variant for Android commands--mode to --configuration for iOS commands--buildFolder to --build-folder for iOS commands--appId to --app-id for Android commands--appIdSuffix to --app-id-suffix for Android commandsAnd remove unsupported flags:
--interactive/-i – the CLI will prompt you for input where necessary--list-devices - when no devices are connected, you'll be prompt with a full device selectionConfigure GitHub Actions for remote builds in your workflow
iOS:
Android:
For more setup options see GitHub Actions configuration