I'm now able to run a Dart app using
gcloud --verbosity debug preview app run app.yaml
and also to deploy and run on AppEngine
gcloud --verbosity debug preview app deploy app.yaml
but I haven't found a way to connect a debugger to the Dart app running on the development server.
I found http://dartbug.com/21067 but still couldn't find a way to make it work.
See also https://groups.google.com/a/dartlang.org/forum/#!topic/cloud/OK1nJtg7AjQ
Update 2015-02-27
The app can be run without Docker and then be debugged like any Dart command line application: Source. https://groups.google.com/a/dartlang.org/d/msg/cloud/zrxgOHFz_lA/q5CdLLQPBAgJ
Update 2014-11-27
Debugging from DartEditors debugger started working with the bleeding Dart build
1.8.0.edge_042017
. I assume that the next dev build (probably1.9.0-dev1.0
) will include the related fixes as well?Detailed steps how this works can be found here: https://groups.google.com/a/dartlang.org/d/msg/cloud/OK1nJtg7AjQ/u-GzUDI-0VIJ
Build a custom Docker image with the latest Dart dev build
1.8.0-dev.4.6
.The Dart team is actually preparing an easy way to do this yourself (see https://github.com/dart-lang/dart_docker)
Installe the latest bleeding_edge on the host system (using this script https://gist.github.com/zoechi/d240f56a32ed5649797f or manual download from http://gsdview.appspot.com/dart-archive/channels/be/raw/latest/editor/darteditor-linux-x64.zip)
Add this to the
app.yaml
fileSee How to disable health checking for `gcloud preview app run` for more details about customizing health checking.
Launch the server code of your app with
glcoud --verbosity debug app run app.yaml
orglcoud --verbosity debug app run app.yaml index.yaml
Wait until the Docker container is ready (check with
docker ps
if theCommand
column shows a value starting with/dart_runtime/dart_
Open DartEditor
Open Menu
Run > Remote Connection...
Connect to:
Command-line VM
Host:
localhost
if you dont use
boot2dockeror the IP address returned by the command
boot2docker ip`Port:
5005
Select Folder...
select the directory which contains the source code of your project.Click
OK
Set breakpoints and continue as usual.
Old
A first step is using the Observatory which includes a browser based debugger UI.
To make this work add the following lines to the
app.yaml
fileThis might be useful as well to make the
server.dart
wait until we had the chance to set breakpoints using the observatory.boot2docker
gives us the Docker ip (192.168.59.103) and after starting withgcloud preview app run app.yaml
we can connect tohttp://192.168.59.103:8181
which should open the Observatory GUI.