Change App Name In React Native

前端 未结 14 867
滥情空心
滥情空心 2020-12-22 20:29

I\'m trying to figure out how to change a ReactNative app name. The installed APK on my device is simply \"App\", with the Android icon. How can I change this?

I\'ve

14条回答
  •  误落风尘
    2020-12-22 21:13

    I find that, 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.

提交回复
热议问题