2017-03-08 48 views
0
  • 我执行我使用CMD

react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/禁用JS服务器

  • 反应本地项目的离线捆绑作为bundinling离线我没有做在运行命令react-native run-android后每次启动JS服务器。

有什么办法,以避免启动JS服务器

回答

2

内部,react-native run-android开始打包和gradlew运行installDebug任务。

要只是在你的项目根目录下运行installDebug,:

cd android && ./gradlew installDebug 
在Windows 7中的报错`
+0

''不被识别为内部或外部命令。所以我将它作为'cd android'运行,然后'gradlew installdebug',但现在应用程序仅安装并且不会在设备上自动启动。我需要安装后手动启动应用程序。有没有其他解决方法 – Akki

+1

是的,'./'适用于类Unix系统。 问你的问题,你可以通过adb启动任何调试应用程序: 'adb -s shell am start -n /。MainActivity' –