在Mac上默认情况下在Chrome上启用远程调试吗? [英] Enable remote debugging on Chrome by default on mac?

查看:638
本文介绍了在Mac上默认情况下在Chrome上启用远程调试吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力将VS Code调试器作为常规工作流程的一部分附加到Chrome.

I am working on getting the VS Code debugger to attach to Chrome as part of my regular workflow.

我一直保持Chrome运行,而备受好评的VS Code Live Server扩展程序在我喜欢的新标签页中打开了我的项目.我希望能够将VS Code调试器附加到此实例,但是看来我必须使用以下命令行从命令行启动Chrome:

I keep Chrome running all the time, and the highly-regarded VS Code Live Server extension opens my project in a new tab, which I like. I would like to be able to attach the VS Code debugger to this instance, but it looks like I have to start Chrome from the command line with

sudo /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222

几个问题:

  1. 是否可以修改Chrome的配置文件,使其始终以该标志集开头?
  2. 这是愚蠢的事吗?
  3. 我真的需要上面一行中的sudo吗?有些资料来源没有它.
  4. 或者,有没有一种方法可以创建一个桌面/工具栏快捷方式来启动chrome并启动远程调试功能?
  1. Is there a way to modify Chrome's configuration file so that it always starts with that flag set?
  2. Is that a stupid thing to do?
  3. Do I really need the sudo in the line above? Some sources do not have it.
  4. Alternatively, is there a way to create a desktop/toolbar shortcut to chrome that will start it will remote debugging enabled?

谢谢!

PS我看到了相关的 SO问题对于Windows .

PS I see the related SO question for Windows.

推荐答案

Mac上已经有许多不再可行的答案了.我找到了一个,并建立了一个可双击的图标. 我将其发布在GitHub上.

There are various Mac answers that used to work that don't anymore. I found one that does and built a double-clickable icon. I posted it on GitHub.

显然,使用Automator也很容易.

Apparently it's pretty easy to do using Automator, also.

这篇关于在Mac上默认情况下在Chrome上启用远程调试吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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