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...

1 Answer 1

5

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.

Sign up to request clarification or add additional context in comments.

11 Comments

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.
I have seen this documentation but i have no plans releasing on the snap store for now, thanks anyway.
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)
oh alright thanks for the explanation, will try it out as soon as i can. There is indeed a file with my project name
docs.flutter.dev/development/tools/sdk/release-notes/… <-- Flutter requires a Unix system 64-bit to be able to run. It may change in the future
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.