-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Once you're done Building the Dartino binaries, you can run your Dartino
code in two ways: (1) from source and (2) from snapshot. In the following
examples, we assume that you are running on a 32-bit Linux system. You'll have
to adjust the path to the dartino
and dartino-vm
binaries on other platforms.
This is the easiest way of running Dart code on top of Dartino. You simply pass
the .dart
file to run to the dartino
binary that matches your platform:
$ out/ReleaseIA32Clang/dartino run hello.dart
Hello, World!
Running from a snapshot is also simple. You just instruct dartino
to output a
snapshot and then you run it separately with the raw dartino-vm
binary:
$ out/ReleaseIA32Clang/dartino export hello.dart to hello.snapshot
$ out/ReleaseIA32Clang/dartino-vm hello.snapshot
Hello, World!
Normally, dartino run
will launch the dartino-vm
binary. But if you want to
run the dartino-vm
on a device (a phone, tablet, smart lightbulb, etc.) it is
often easier to start the VM and tell the compiler to attach to the already
running VM. For example, on the device, run:
$ ./out/ReleaseIA32Clang/dartino-vm
Waiting for compiler on 127.0.0.1:64745
Then forward a port from your laptop to port 64745 on the device, for example, using ssh from the laptop:
$ ssh -L 64745:127.0.0.1:64745 hostname-of-device
Finally, on the laptop, run the compiler:
$ ./out/ReleaseIA32Clang/dartino attach tcp_socket 127.0.0.1:64745
Connecting to 127.0.0.1:64745
$ ./out/ReleaseIA32Clang/dartino run hello.dart