react-native 项目更名步骤

刚开始开发项目的时候,更没有想好一个项目名称,如何才能更名一个RN APP名称呢,可按照如下方式操作即可。

使用说明

更改package.json

{
  "name": "dounineApp",
   ...
}

android

更改android/settings.gradle

rootProject.name = 'dounineApp'
...

更改android/app/src/main/res/values/strings.xml

<resources>
    <string name="app_name">dounineApp</string>
</resources>

更改android/app/src/main/java/com/xxxx/MainActivity.java
请自行替换原xxxx项目名

public class MainActivity extends ReactActivity {

    /**
     * Returns the name of the main component registered from JavaScript.
     * This is used to schedule rendering of the component.
     */
    @Override
    protected String getMainComponentName() {
        return "dounineApp";
    }
}

IOS

更改Info.plist文件
Info.plist

更改AppDelegate.m文件
AppDelegate.m

原文地址:https://www.cnblogs.com/Free-Thinker/p/8509081.html