如何在 react native 中运行的第一个应用程序上启动远程调试?
我使用开发人员菜单启动Debug JS Remotely
并重新加载应用程序,因此无法调试仅在第一次运行时出现的代码。
如何在 react native 中运行的第一个应用程序上启动远程调试?
我使用开发人员菜单启动Debug JS Remotely
并重新加载应用程序,因此无法调试仅在第一次运行时出现的代码。
我终于在这篇文章中找到了解决方案。
可以以Debug JS Remotely
编程方式启动iOS
import { NativeModules } from 'react-native';
if (__DEV__) {
NativeModules.DevSettings.setIsDebuggingRemotely(true)
}
需要react-native-devsettings-android库才能运行此代码android
您需要用本机代码对其进行硬编码。
对于android,我相信它是这个: