sony / flutter-embedded-linux

Embedded Linux embedding for Flutter
BSD 3-Clause "New" or "Revised" License
1.16k stars 122 forks source link

Debug - Can only start Dart VM service, not observatory #380

Closed jvieira88 closed 10 months ago

jvieira88 commented 10 months ago

Hi,

I'm trying to debug an application running on a x64 machine, but I'm getting a similar behaviour with an arm64 so I think I must be doing something wrong. I've been trying to follow the documentation to get this going but once I start running the application using the flutter-clientand pointing at the bundle path, I get a message flutter: The Dart VM service is listening on http://127.0.0.1:12345/, while looking at the documentation I was expecting to see something like flutter: Observatory listening on http://127.0.0.1:12345/. With the Dart VM I cannot actually debug the application.

I'm sure I'm doing something wrong but couldn't quite figure out what it is. I'll briefly detail the steps I followed bellow in the hope someone knows what's wrong.

1- Get and build flutter-embedded-linux, building for Wayland backend (Stand-alone Wayland app).

cd /opt
git clone https://github.com/sony/flutter-embedded-linux.git
cd /opt/flutter-embedded-linux
mkdir build
cd build
wget https://github.com/sony/flutter-embedded-linux/releases/download/1ac611c64e/elinux-x64-debug.zip
unzip ./elinux-x64-debug.zip
cmake -DUSER_PROJECT_PATH=examples/flutter-wayland-client -DCMAKE_BUILD_TYPE=Release ..
cmake --build .

This results in having the flutter-client and the flutter-elinux artifacts for debug in /opt/flutter-embedded-linux/build.

2- Build the application in debug mode from within the application workspace. export PATH=$PATH:/opt/flutter-elinux/bin && FLUTTER_ELINUX_CUSTOM_RUN_ARGS=\"--width=480 --height=800\" flutter-elinux run -d elinux-wayland --disable-service-auth-codes --device-vmservice-port=12345 --host-vmservice-port=42771

This results in a bundle folder being created. This does show the following message but I'm trying to debug using the bundled application:

A Dart VM Service on eLinux is available at: http://127.0.0.1:42771/
The Flutter DevTools debugger and profiler on eLinux is available at: http://127.0.0.1:9101?uri=http://127.0.0.1:42771/

3- Run the bundled application (in debug) using the flutter-client: export PATH=$PATH:/opt/flutter-elinux/bin && export PATH=$PATH:/opt/flutter-embedded-linux/build && LD_LIBRARY_PATH=/opt/flutter-embedded-linux/build/ FLUTTER_ENGINE_SWITCHES=2 FLUTTER_ENGINE_SWITCH_1="observatory-port=12345" FLUTTER_ENGINE_SWITCH_2="disable-service-auth-codes" /opt/flutter-embedded-linux/build/flutter-client --bundle=/home/jv/projects/FlutterElinuxAgraPro/agra_pro/build/elinux/x64/debug/bundle

This prints a message flutter: The Dart VM service is listening on http://127.0.0.1:12345/ but gives no access to Flutter DevTools debugger.

HidenoriMatsubayashi commented 10 months ago

I'm not sure what you want to do and why you don't use flutter-elinux tool. To get the following log, you have to use flutter tools (dart code). But, I think you can use A Dart VM Service on eLinux is available at: http://127.0.0.1:42771/ as observatoryUri.

The Flutter DevTools debugger and profiler on eLinux is available at: http://127.0.0.1:9101?uri=http://127.0.0.1:42771/

Thanks. Closing.