简体   繁体   English

React-Native iOS 热重载和调试模式在真实设备中不起作用

[英]React-Native iOS hot reloading and debug mode not working in real device

Background:背景:

I am working on a react-native app for a while and it was working fine till now.我在 react-native 应用程序上工作了一段时间,到目前为止它运行良好。 Currently facing some issues in the iOS on the same version that has been completely tested and verified before.目前在iOS上面临一些问题,之前已经完全测试和验证过。

Issue:问题:

Currently live reloading, hot reloading and even debug mode doesn't seem to work for my app.目前实时重载、热重载甚至调试模式似乎不适用于我的应用程序。 The app runs only for the first time, it wouldn't work if I try to relaunch the app from Xcode.该应用程序仅第一次运行,如果我尝试从 Xcode 重新启动该应用程序,它将无法工作。

It stops at the splash screen always so I have to completely delete the app from the device and redeploy it from Xcode.它总是停在启动屏幕上,所以我必须从设备中完全删除应用程序并从 Xcode 重新部署它。 I don't know what is causing this issue.我不知道是什么导致了这个问题。 It seems working fine on other laptops so I doubt the problem is with my Xcode.它似乎在其他笔记本电脑上运行良好,所以我怀疑问题出在我的 Xcode 上。

This issue is not project-related as I have created a new app to test it out and experiencing the same outcome.此问题与项目无关,因为我创建了一个新应用程序来对其进行测试并体验相同的结果。 Could anyone help me with this?谁能帮我解决这个问题?

Please read the things I have already tried before answering with some common things.在回答一些常见的事情之前,请阅读我已经尝试过的事情。 Thank you in advance.先感谢您。

Few things I have tried:我尝试过的几件事:

  • Cleaned the project.清理了项目。
  • Cleaned the Xcode Derived Data清理了 Xcode 派生数据
  • Deleted the watchman cache.删除了守望者缓存。
  • Updated Xcode, iPhone, and watchman to the latest version将 Xcode、iPhone 和守望者更新到最新版本
  • Pods re-installed.重新安装 Pod。

Reason for Issue:问题原因:

Version mismatch for iOS device and Xcode. iOS 器件和 Xcode 的版本不匹配。 iOS version: 14.6 and Xcode version 12.5 as Xcode 12.6 is not released yet is there any workaround? iOS 版本:14.6 和 Xcode 版本 12.5,因为 Xcode 12.6 尚未发布,是否有任何解决方法?

This means you have a error on your code pls provide some code这意味着您的代码有错误请提供一些代码

Delete main.jsbundle in ios folder.删除main.jsbundle文件夹中的ios

Generate new main.jsbundle生成新的main.jsbundle

react-native bundle --reset-cache --entry-file./index.js --platform ios --dev false --assets-dest./ios --bundle-output./ios/main.jsbundle

@Prince, did you get this resolved? @Prince,你解决了吗? I started facing this issue after iPhone device ios upgrade to 14.5 till 15.0.2.在 iPhone 设备 ios 升级到 14.5 到 15.0.2 之后,我开始面临这个问题。 Xcode 13.1 Xcode 13.1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM