Renaming a React Native project?

前端 未结 16 644
独厮守ぢ
独厮守ぢ 2020-11-28 02:45

Are there instructions for what needs to be changed in order to rename a React Native project? I have an app called something along the lines of MyAppIOS and I want to renam

相关标签:
16条回答
  • 2020-11-28 03:13

    I am probably a bit late, but for the people looking for a solid solution, there is a react-native-rename npm package which can do the magic.

    0 讨论(0)
  • 2020-11-28 03:15
    • First of all copy the address which your want to-be-name-changed application exists. And go to your newly cloned directory.

    • Replace the name at the index.ios/android.js file which is given as a parameter to AppRegistry.

    • update the name and version accordingly on package.json remove /ios and /android folders which are remaining from your older app and from the

    • run $react-native upgrade to generate /ios and /android folders again. and run $react-native link for any external dependency.

    • finally, run $react-native run-ios or else.

    0 讨论(0)
  • 2020-11-28 03:17

    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 to AppRegistry.
    • Change the name and version accordingly on package.json
    • delete /ios and /android folders which are remaining from your older app as well as the app.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.
    0 讨论(0)
  • 2020-11-28 03:18

    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.

    0 讨论(0)
  • 2020-11-28 03:18

    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:

    enter image description here

    0 讨论(0)
  • 2020-11-28 03:20
    1. For IOS app, change in xcodeproj settings is also available.

    Open Info.plist file from your project directory/ios/{appname} directory and change Bundle display name.

    <key>CFBundleDisplayName</key>
    <string>NEW APP NAME</string>
    
    1. For android app, you can change in android folder of your project directory.

      cd android/app/src/main/res/values/

    open strings.xml file and change you app name in

     <string name="app_name">NEW APP NAME</string>
    
    0 讨论(0)
提交回复
热议问题