Flutter hot reload with an embedded device

Jun 1, 2023

Pieter Scholtz

{
  "$schema": "file:///home/pieter/development/flutter/packages/flutter_tools/static/custom-devices.schema.json",
  "custom-devices": [
    {
      "id": "ti",
      "label": "TI AM6254",
      "sdkNameAndVersion": "TI AM6254",
      "platform": null,
      "enabled": true,
      "ping": [
        "ping",
        "-c",
        "1",
        "-w",
        "1",
        "192.168.151.124"
      ],
      "pingSuccessRegex": null,
      "postBuild": [
        "ssh",
        "root@192.168.151.124",
        "mkdir -p /tmp/${appName}/data/flutter_assets"
      ],
      "install": [
        "scp",
        "-r",
        "-o",
        "BatchMode=yes",
        "${localPath}",
        "root@192.168.151.124:/tmp/${appName}/data"
      ],
      "uninstall": [
        "ssh",
        "-o",
        "BatchMode=yes",
        "root@192.168.151.124",
        "rm -rf \"/tmp/${appName}/data/flutter_assets/*\""
      ],
      "runDebug": [
        "ssh",
        "-o",
        "BatchMode=yes",
        "root@192.168.151.124",
        "flutter-pi /tmp/${appName}"
      ],
      "forwardPort": [
        "ssh",
        "-o",
        "BatchMode=yes",
        "-o",
        "ExitOnForwardFailure=yes",
        "-L",
        "127.0.0.1:${hostPort}:127.0.0.1:${devicePort}",
        "root@192.168.151.124",
        "echo 'Port forwarding success'; read"
      ],
      "forwardPortSuccessRegex": "Port forwarding success",
      "screenshot": null
    },
    {
      "id": "pi",
      "label": "rpi",
      "sdkNameAndVersion": "rpi3",
      "platform": null,
      "enabled": true,
      "ping": [
        "ping",
        "-c",
        "1",
        "-w",
        "1",
        "192.168.1.123"
      ],
      "pingSuccessRegex": null,
      "postBuild": null,
      "install": [
        "scp",
        "-r",
        "-o",
        "BatchMode=yes",
        "${localPath}",
        "pi@192.168.1.123:/tmp/${appName}"
      ],
      "uninstall": [
        "ssh",
        "-o",
        "BatchMode=yes",
        "pi@192.168.1.123",
        "rm -rf \"/tmp/${appName}\""
      ],
      "runDebug": [
        "ssh",
        "-o",
        "BatchMode=yes",
        "pi@192.168.1.123",
        "/tmp/app"
      ],
      "forwardPort": [
        "ssh",
        "-o",
        "BatchMode=yes",
        "-o",
        "ExitOnForwardFailure=yes",
        "-L",
        "127.0.0.1:${hostPort}:127.0.0.1:${devicePort}",
        "pi@192.168.1.123",
        "echo 'Port forwarding success'; read"
      ],
      "forwardPortSuccessRegex": "Port forwarding success",
      "screenshot": null
    }
  ]
}

Leave a Comment

Your Email address will not be published