1

I have built a linux app with flutter using : flutter build linux in my ubuntu VM.

My goal is to run this linux app in an embbeded device so i need to copy the required files to this device (running under linux) and then execute the equivalent of main.dart in the embbeded device.

I am very new to this, so what are the directories / files needed to run the standalone linux app ?

I see a bundle directory inside the /build/linux/x64 folder after running flutter build linux but i don't understand any files written inside / how to execute the whole app... And even if it's the correct directory to copy in my embbeded device.

EDIT : Running the app by trying to execute ./my_app_name on the corresponding file gives the following error :

-bash: ./my_app_name: cannot execute binary file: Exec format error

And i am guessing this is a not a shell script...

Tom3652
  • 2,540
  • 3
  • 19
  • 45

1 Answers1

2

After running the command flutter build linux, you should find all the required files to run it in build/linux/release/bundle

Just copying/pasting it on your device shall work (if the device is supported).

There is an official guide explaining how to build and release your app onto the Snap Store: https://flutter.dev/docs/deployment/linux

Important note :
As described in the official documentation, a Flutter app supports Linux Debian, 64-bit. Meaning that if you try to run your app on a 32-bit distribution, it won't start.

FDuhen
  • 4,097
  • 1
  • 15
  • 26
  • Thanks for your quick reply. Do you mean there is no "execution" script to run or anything ? The user should be allowed to run it or not so i am quite surprised there is no file to run to run the whole app. – Tom3652 Aug 08 '22 at 14:02
  • I have seen this documentation but i have no plans releasing on the snap store for now, thanks anyway. – Tom3652 Aug 08 '22 at 14:04
  • 1
    There is no script generated, you should only have your binary in the folder linked in my answer. You should see a file which has your app name, and a simple ./your_app_name should work (can't test it rn, i'm not on my Linux) – FDuhen Aug 08 '22 at 14:35
  • oh alright thanks for the explanation, will try it out as soon as i can. There is indeed a file with my project name – Tom3652 Aug 08 '22 at 14:52
  • It doesn't work unfortunately i will update the question with the provided result – Tom3652 Aug 08 '22 at 15:20
  • Did you run the command on your working computer or on your other device ? – FDuhen Aug 08 '22 at 18:57
  • on my other device, i have not tried on my working computer you are right – Tom3652 Aug 08 '22 at 20:06
  • You are actually right it's working fine ! this means that it's my other device that has a problem to run the script. Thank you so much – Tom3652 Aug 08 '22 at 20:09
  • 1
    https://docs.flutter.dev/development/tools/sdk/release-notes/supported-platforms <-- Flutter requires a Unix system 64-bit to be able to run. It may change in the future – FDuhen Aug 09 '22 at 05:34
  • Update your answer with your comment with supported Unix version and i will accept it – Tom3652 Aug 09 '22 at 09:18
  • The answer was updated with the missing infos – FDuhen Aug 09 '22 at 09:39