簡體   English   中英

如何在React Native中首次運行時啟動遠程調試

[英]How start remote debug on the very first run in react native

如何在以本機運行的第一個應用程序上啟動遠程調試?

我使用開發人員菜單Debug JS Remotely啟動Debug JS Remotely ,並且應用程序重新加載,因此無法調試僅在第一次運行時發生的代碼。

我終於在本文中找到了解決方案。

可以在iOS上以編程方式Debug JS Remotely啟動Debug JS Remotely

import { NativeModules } from 'react-native';

if (__DEV__) {
 NativeModules.DevSettings.setIsDebuggingRemotely(true)
}

需要react-native-devsettings-android庫才能在android上運行此代碼

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM