简体   繁体   English

VS2017 如何在 windows 手机模拟器上调试 uwp 托管的 web 应用程序

[英]VS2017 How to debug uwp hosted web app on windows phone emulator

I built a javascript uwp hosted web app with visual studio 2017. The app is a simple javascript app with a start page pointing to one of our web servers.我使用 Visual Studio 2017 构建了一个 javascript uwp托管网络应用程序。该应用程序是一个简单的 javascript 应用程序,其起始页指向我们的一个网络服务器。 The server returns a page with javascript inside it.服务器返回一个包含 javascript 的页面。 The app works fine.该应用程序运行良好。

In the VS2017 "DOM Explorer" window, I can see both downloaded HTML and Javascript.在 VS2017 的“DOM Explorer”窗口中,我可以看到下载的 HTML 和 Javascript。 But, alas, I cannot figure how to add a breakpoint in the script, step next, and so on.但是,唉,我无法弄清楚如何在脚本中添加断点、下一步等等。

Is there an easy way to enable step by step debugging on such applications?是否有一种简单的方法可以在此类应用程序上启用逐步调试?

I would suggest that you could debug your app with Microsoft Edge F12 Developer Tools directly.我建议您可以直接使用 Microsoft Edge F12 开发人员工具调试您的应用程序。

You could use Microsoft Edge to open your website and press F12 to open the developer tools.您可以使用 Microsoft Edge 打开您的网站,然后按 F12 打开开发人员工具。 In the developer tools, you could switch the browser profile to windows phone in the "Emulation" tab.在开发人员工具中,您可以在“仿真”选项卡中将浏览器配置文件切换到 windows 手机。 Then, in the debugger tab, you could add some break points to debug your javascript code in it.然后,在调试器选项卡中,您可以添加一些断点来调试其中的 javascript 代码。

If you want to debug UWP APIs, you need to use visual studio to deploy the app to your local machine, and then, you would need to start it from the start menu of windows.如果要调试 UWP API,需要使用 Visual Studio 将应用程序部署到本地计算机,然后需要从 Windows 的开始菜单启动它。 After the app started, you could press F12, the Edge developer tools would be opened, then, you could add some break points to debug.应用程序启动后,按F12,Edge 开发者工具会被打开,然后,您可以添加一些断点进行调试。

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

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