Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Create Flutter tools for embedded Linux #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
HidenoriMatsubayashi opened this issue Apr 4, 2021 · 8 comments
Closed

Create Flutter tools for embedded Linux #59

HidenoriMatsubayashi opened this issue Apr 4, 2021 · 8 comments
Assignees
Labels
enhancement New feature or request tools Topics of tools

Comments

@HidenoriMatsubayashi
Copy link
Contributor

Currently, we need to build Flutter Engine to use this embedder ourselves. We also need to use a specific Flutter SDK to build Flutter apps. These tasks are bothered, so we will create a tool to support such as flutter build embedded-linux and flutter run -d embedded-linux, etc.

@HidenoriMatsubayashi HidenoriMatsubayashi added the enhancement New feature or request label Apr 4, 2021
@HidenoriMatsubayashi HidenoriMatsubayashi self-assigned this Apr 4, 2021
@HidenoriMatsubayashi HidenoriMatsubayashi added the tools Topics of tools label Apr 4, 2021
@HidenoriMatsubayashi HidenoriMatsubayashi removed their assignment May 14, 2021
@HidenoriMatsubayashi
Copy link
Contributor Author

@HidenoriMatsubayashi
Copy link
Contributor Author

Custom devices in Flutter SDK works fine.

$ flutter config --enable-custom-devices
$ touch ~/.flutter_custom_devices.json

~/.flutter_custom_devices.json which is an example I've tried with my localhost.

{
  "custom-devices": [
    {
      "id": "embedded-linux",
      "label": "Embedded Linux Device",
      "sdkNameAndVersion": "Target Embedded Linux Device",
      "disabled": false,
      "ping": [
        "ping",
        "-w",
        "500",
        "-c",
        "1",
        "localhost"
      ],
      "pingSuccessRegex": "ttl=",
      "postBuild": null,
      "install": [
        "scp",
        "-r",
        "${localPath}",
        "user@localhost:/tmp/${appName}"
      ],
      "uninstall": [
        "ssh",
        "user@localhost",
        "rm -rf \"/tmp/${appName}\""
      ],
      "runDebug": [
        "ssh",
        "user@localhost",
        "<path>/flutter-client -b /tmp/${appName}"
      ],
      "forwardPort": [
        "ssh",
        "-o",
        "ExitOnForwardFailure=yes",
        "-L",
        "127.0.0.1:${hostPort}:127.0.0.1:${devicePort}",
        "user@localhost"
      ],
      "forwardPortSuccessRegex": "Linux",
      "screenshot": [
        "ssh",
        "user@localhost",
        "fbgrab /tmp/screenshot.png && cat /tmp/screenshot.png | base64 | tr -d ' \\n\\t'"
      ]
    }
  ]
}
$ flutter devices
3 connected devices:

Linux (desktop)                • linux          • linux-x64      • Ubuntu 20.04.2 LTS 5.4.0-66-generic
Chrome (web)                   • chrome         • web-javascript • Google Chrome 89.0.4389.82
Embedded Linux Device (mobile) • embedded-linux • linux-arm64    • Target Embedded Linux Device

$ flutter run -d embedded-linux --verbose

@HidenoriMatsubayashi HidenoriMatsubayashi self-assigned this May 17, 2021
@HidenoriMatsubayashi
Copy link
Contributor Author

HidenoriMatsubayashi commented May 18, 2021

At least now, I think flutter-tizen's approach is better than using custom devices in Flutter SDK. Because custom devices in Flutter SDK don't support building a custom embedder. However, if we develop Android apps, iOS apps, Linux desktop apps, and Embedded Linux at the same time, we need to use two tools... Also, Extension for VSCode is an issue.

For the time being, we will go with making a new tool like flutter-tizen.

If we create a custom tool / flutter tool fork, it will be a pretty big maintenance burden. So, I'll consider to add some options into Flutter SDK.

@HidenoriMatsubayashi
Copy link
Contributor Author

I'm creating a new tool for this embedder, which is flutter-tizen based. Also, I'm going to create a new repo.

@HidenoriMatsubayashi
Copy link
Contributor Author

I published flutter-elinux.

@doesnotexist
Copy link

doesnotexist commented Sep 27, 2022

Would the fork of the flutter CLI tool that is maintained in flutter-elinux be deprecated if this PR flutter/flutter#90958 or something similar is merged? Or are there more differences in how the flutter-elinux fork functions compared to the official flutter CLI that would still be necessary even after that PR is merged?

@christopherfujino
Copy link

I suspect you'd still need to maintain your fork.

@doesnotexist
Copy link

doesnotexist commented Oct 5, 2022

Ok, that makes sense. Since commands like flutter-elinux build support flags such as --target-backend-type
and that downloading artifacts are retrieved from https://github.com/sony/flutter-embedded-linux/releases (or an alternative specified url by an environment variable ELINUX_ENGINE_BASE_URL )

Though it does appear that providing specifying artifact urls was considered for custom-devices flutter/flutter#79406 (comment)

I wonder if deprecating the fork is possible if custom-devices supported specifying artifact urls and something like the keys in the aformenetioned PR, namely configureNativeProject and buildNativeProject. Would those keys or something very similar supplant the custom flags like --target-backend-type?

I'm not sure what other issues are solved by the fork. Perhaps VSCode Extension mentioned above?

"Also, Extension for VSCode is an issue."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request tools Topics of tools
Projects
None yet
Development

No branches or pull requests

3 participants