electron项目远程打开控制台
(此方法用来解决远程用户时无法用自定的写入文件的方法打开控制台的问题)
在壳的部分下的main.js中加入以下的代码
(function() {
const app = require('electron').app;
app.commandLine.appendSwitch("remote-debugging-port", `5555`);
app.commandLine.appendSwitch("remote-debugging-address", "127.0.0.1");
})();

在cmd里运行项目exe文件,会输出一个ip地址

复制 127.0.0.1:5555 在浏览器打开

点击项目名称就能看到项目已经打开控制台了
1万+

被折叠的 条评论
为什么被折叠?



