简体   繁体   English

如何在Linux上运行Dartium?

[英]How to run Dartium on Linux?

I am new to Dart and want to start developing apps for Dart. 我是Dart的新手,想开始为Dart开发应用程序。 Right now, I am simply using dart2js --minify for this, which works well, but is really slow when I need to debug my mistakes by changing the code, running the code, changing the code, running the code, etc.. This requires lots of compiling, so while dart2js is, in general, pretty fast, debugging Dart Web apps with dart2js is really slow. 现在,我只是为此使用dart2js --minify ,它很好用,但是当我需要通过更改代码,运行代码,更改代码,运行代码等来调试错误时,速度确实很慢。需要大量的编译工作,因此,尽管dart2js速度通常很快,但是使用dart2js调试Dart Web应用程序的速度确实很慢。

I would like to use the Dart VM in Dartium and downloaded it per the directions of this video (although admittedly, I didn't watch the whole video because part of it was about Atom which I don't use). 我想在Dartium中使用Dart VM并按照此视频的说明下载(尽管坦白地说,我没有观看整个视频,因为其中有一部分与我不使用的Atom有关)。 However, when I open Dartium ( ./chrome and ./chrome-wrapper ), it doesn't look any different front regular Chrome. 但是,当我打开Dartium( ./chrome./chrome-wrapper )时,它看起来与常规的Chrome没有什么不同。 There is no --no-sandbox warning and the user agent is the same as in Chromium (no (Dart) ). 没有--no-sandbox警告,并且用户代理与Chromium中的相同(否(Dart) )。 When I try to run a Dart Web app with <script type="application/dart" [...]> , it doesn't work. 当我尝试使用<script type="application/dart" [...]>运行Dart Web应用程序时,它不起作用。

I also get the following error when running Dartium (the same error occurs on ./chrome and ./chrome-wrapper ): 运行Dartium时,我还会收到以下错误( ./chrome./chrome-wrapper发生相同的错误):

[18997:18997:0829/163445:ERROR:browser_main_loop.cc(163)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.
Created new window in existing browser session.
[19044:19044:0829/163446:ERROR:zygote_linux.cc(587)] write: Broken pipe
[0829/163446:ERROR:nacl_helper_linux.cc(282)] NaCl helper process running without a sandbox!
Most likely you need to configure your SUID sandbox correctly

However, when I go to the link in the error , the directions refer to a bunch of commands and files I don't recognize. 但是,当我转到error中的链接时 ,这些说明指的是一堆我不认识的命令和文件。

Can someone please help me figure out how to build Dartium? 有人可以帮我弄清楚如何构建Dartium吗? Thank you so much! 非常感谢!

Additional Info: 附加信息:

  • I am running Ubuntu 15.04 and my default browser is Chromium. 我正在运行Ubuntu 15.04,我的默认浏览器是Chromium。
  • When I ran both ./chrome and ./chrome-wrapper , I had my original Chromium closed. 当我同时运行./chrome./chrome-wrapper ,我的原始Chromium已关闭。
  • I have uploaded my project to GitHub . 我已将项目上传到GitHub

Maybe Dartium is connecting to an existing version of Chromium. 也许Dartium正在连接到Chromium的现有版本。 Try to launch Dartium with --user-data-dir=/tmp/dartium_dir . 尝试使用--user-data-dir=/tmp/dartium_dir This will make sure that it launches separately from any existing Chromium. 这将确保它与任何现有的Chromium分开启动。

I guess the best way to check if you run Dartium is to enter about://version in the URL bar and check if Dart: someversion is listed. 我想检查您是否运行Dartium的最好方法是在URL栏中输入about://version并检查是否列出了Dart: someversion I usually start Dartium from WebStorm which lists the following command line in about://version 我通常从WebStorm启动Dartium,它在about://version列出以下命令行

/usr/local/apps/dart/dartium/chrome --no-sandbox --flag-switches-begin --disable-async-dns --enable-devtools-experiments --enable-download-resumption --javascript-harmony --enable-panels --flag-switches-end / usr / local / apps / dart / dartium / chrome --no-sandbox --flag-switches-begin --disable-async-dns --enable-devtools-experiments --enable-download-resumption --javascript-harmony --enable-panels --flag-switches-end

Instead of dart2js it's usually simpler to use pub build . 代替dart2js ,使用pub build通常更简单。 pub build is usually used for deployment only. pub build通常仅用于部署。 For development it usually works best to run the Dart development web server pub serve . 对于开发,通常最好运行Dart开发Web服务器pub serve Pub serve builds to JavaScript on the fly when a non-Dart-capable browser requests a page. 当不具备Dart功能的浏览器请求页面时,Pub服务将即时构建为JavaScript。 If Dartium requests a page it serves the Dart source code instead. 如果Dartium请求页面,它将提供Dart源代码。 If your source changes you automatically get the updates JS when you reload the page in a non-Dart-capable browser. 如果您的源发生更改,则在不支持Dart的浏览器中重新加载页面时,会自动获取更新JS。

(if you change dependencies with pub get or pub upgrade you need to restart pub serve ) (如果您通过pub getpub upgrade更改了依赖性,则需要重新启动pub serve

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

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