react-native中更改android/ios的入口文件

android

1.android /app/build.gradle

project.ext.react = [
    entryFile: "index.android.js"
]

2.android/app/src/main/java/com/项目名/MainApplication.java

@Override
 protected String getJSMainModuleName() {
   return "index.android";
 }

ios

ios/项目名/AppDelegate.m

jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
posted @ 2018-12-22 15:26  qiqi715  阅读(521)  评论(0编辑  收藏  举报