如何在 Visual Studio 代码中调试 React Native 应用程序? [英] How to debug react native apps in visual studio code?

查看:71
本文介绍了如何在 Visual Studio 代码中调试 React Native 应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Visual Studio 代码 IDE 来开发 React Native 应用程序,而不是使用 expo 库.

I am using visual studio code IDE to develop react native app and am not using expo library.

在此之前,我在 android studio 工作,在那里进行调试非常简单.

Before that I was working on the android studio, debugging in that is straightforward and simple.

现在对于 react-native,我想知道如何使用 Visual Studio 代码 IDE 调试我的应用程序?

Now for react-native, I wanted to know how to debug my app using visual studio code IDE?

推荐答案

第 1 步:通过摇动手机或在您的机器中输入此命令(如果您正在运行 Android)打开您的手机中的应用设置.

Step1: Open app Setting in your mobile by shaking your mobile or by typing this command in your machine if your running android.

adb shell input keyevent 82

Step2:选择Debug JS Remotely,这是第二个选项.第三步:在浏览器中输入 Url http://localhost:8081/debugger-ui/步骤4:再次通过摇动或运行步骤1中显示的命令打开应用设置并选择重新加载选项,这是第一个选项

Step2: Select Debug JS Remotely which is the second option. Step3: In your Browser type Url http://localhost:8081/debugger-ui/ Step4: Again Open App Setting by shaking or running the command shown in step 1 and select Reload option which is first option

现在您可以在浏览器中获取所有控制台日志,还可以通过放置断点并逐步分析值来远程调试您的应用.

Now You can get all console logs in the browser and also you can debug your app remotely by putting breakpoints and analyze the values step by step.

这篇关于如何在 Visual Studio 代码中调试 React Native 应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆