Renaming a React Native project?
What simply works for me several times is instructed below;
- First copy the directory which your to-be-name-changed application exists. And go to your newly cloned directory.
- Change the name at
index.ios/android.js
file which is given as a parameter toAppRegistry
. - Change the name and version accordingly on
package.json
- delete
/ios
and/android
folders which are remaining from your older app as well as theapp.json
file if you have. - run
$react-native upgrade
to generate/ios
and/android
folders again. - run
$react-native link
for any external dependency. - finally run
$react-native run-ios
or anything you want.
The way I did this for android (hacky, but it works) is just changed the string app_name field in
android/app/src/main/res/values/strings.xml
It will change the name of your installed android app to whatever you put as the value.
You can change the name attribute in package.json
, run react-native upgrade
, and just let react overwrite the android/ios files. Don't overwrite your index files if there is unsaved code, however.
Then change your Appregistry line from
AppRegistry.registerComponent('MyAppIOS', () => MyAppIOS);
To:
AppRegistry.registerComponent('MyApp', () => MyApp);
For iOS, the way to change xcodeproj settings is also available.
Show <your app name> -> Info.plist and add Bundle display name.
changing iOS app name: