Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I change the project and app name of ReactNative project with react-native 0.60

Tags:

react-native

It's simple issue but I don't know how to do it. I'm looking for some references, but there are problems.

  1. I'm using react-native : 0.60.5. Hence there is no eject method or command.
  2. The project was not created with expo.
  3. After I referenced How to Rename A React Native App and error Unrecognized command "eject", then I follow the process below.

    • change the app.json's name and diplayName field to name which I want to change
    • remove android/ and ios/ directory
    • use react-native upgrade --legacy true

But there is no change on the project name and app name.

Is there any way to change the project and app name? Thanks.

like image 839
wallah Avatar asked Oct 20 '25 04:10

wallah


1 Answers

Please check the below steps :

if you want to change both the app name and the package name (i.e. rename the entire app), the following steps are necessary:

  • Make sure you don't have anything precious (non-generated, manually copied resources) in the android/ and ios/ subfolders.

  • Delete both the android/ and ios/ folder.

  • Change the "name" entry in your package.json to the new name.

  • Change the app name in both your index.android.js and index.ios.js: AppRegistry.registerComponent('NewAppName', () => App);

  • Run react-native upgrade to re-generate the platform subfolders.

  • If you have linked resources (like custom fonts etc.) run react-native link.

  • If you have other generated resources (like app icons) run the scripts to generate them (e.g. yo).

  • Finally, uninstall the old app on each device and run the new one.

Hope it helps. feel free for doubts

like image 199
Gaurav Roy Avatar answered Oct 22 '25 04:10

Gaurav Roy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!