为什么我们在制作 index.android.bundle 文件的同时对 React Native 进行更改?

Why we are making index.android.bundle file while do changes in react native?

每次我都需要在android工作室制作index.android.bundle文件。

命令 1:react-native bundle --platform --dev false --entry-file index.android.js --bundle-output android /app/src/main/assets/index。 android.bundle/ --assets-dest android/app/src/main/res

命令 2 : react-native 运行-android.

请告诉我我们是否需要每次都点击以查看模拟器上的小变化,否则我做错了什么....

另外请告诉我如何启用 android 监视器以调试更改或检查 React Native 文件的日志。

谢谢

我终于找到了这个问题的解决方案,React-naive js 基于即时刷新,用户能够在模拟器中看到结果..

在开始 React js 开发之前,您需要按照以下步骤操作

  1. 打开两个命令提示符 window 和 运行 一个 window : react-native 运行-android 和其他命令 npm start.
  2. react-native 运行-android
  3. 现在您可能会遇到错误:无法连接到开发服务器
  4. 现在你需要运行"npm start"
  5. 你的模拟器是运行 localhost:8081 服务器即时

您也可以在浏览器中查看:localhost:8081 显示 React packager 服务器是 运行ning。

在此之后按 Ctrl + D,然后按 Ctrl + M 进行调试或在模拟器中重新加载您的更改。

您可以检查上述方法以解决问题。

谢谢!