简体   繁体   English

Apache Cordova:运行cordova无需启动浏览器应用程序即可运行浏览器

[英]Apache Cordova: running cordova run browser without launching browser app

I have Apache Cordova app on my dedicated server. 我的专用服务器上有Apache Cordova应用程序。 Access it via console. 通过控制台访问它。 But when I run 'cordova run browser' I get error 但是当我运行“ cordova run browser”时,我得到了错误

Static file server running @ http://localhost:8000/index.html CTRL + C to shut down Error executing "google-chrome --user-data-dir=/tmp/temp_chrome_user_data_dir_for_cordova http://localhost:8000/index.html ": [21075:21075:0423/054416:ERROR:browser_main_loop.cc(271)] Gtk: cannot open display: 运行@ http:// localhost:8000 / index.html CTRL + C关闭的静态文件服务器执行“ google-chrome --user-data-dir = / tmp / temp_chrome_user_data_dir_for_cordova http:// localhost:8000 / index时出错。 html “:[21075:21075:0423/054416:ERROR:browser_main_loop.cc(271)] Gtk:无法打开显示:

And thus I cannot start test server with my app. 因此,我无法使用我的应用程序启动测试服务器。 How I can avoid automatic browser start? 如何避免浏览器自动启动? Thanx 谢谢

I know it's been a while but what I did to avoid opening browser was editing the file under './platforms/browser/cordova/run' and changing the line: 我知道已经有一段时间了,但是为了避免打开浏览器,我要做的是在'./platforms/browser/cordova/run'下编​​辑文件并更改行:

return cordovaServe.launchBrowser({target: args.target, url: projectUrl});

to: 至:

return cordovaServe;

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

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