How to run a standalone linux app built with flutter? - flutter

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

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.

Related

How to run ionic app on my mobile device?

I found one answer "adb devices"commend to know list of devices attached.But my doubt is where to type this commend and how to know my android SDK paths connecting with ionic .please exp in detail
1.) Enable debugging over USB
2.) Install drivers for mobile device
3.) Run adb devices in cmd.exe
$ ionic platform add android
$ ionic run android
Chapter 2: Installation
Windows users developing for Android: You'll want to make sure you
have the following installed and set up.
NOTE: Whenever you make changes to the PATH, or any other environment
variable, you'll need to restart or open a new tab in your shell
program for the PATH change to take effect.
Java JDK
Install the most recent Java JDK (NOT just the JRE).
Next, create an environment variable for JAVA_HOME pointing to the
root folder where the Java JDK was installed. So, if you installed the
JDK into C:\Program Files\Java\jdk7, set JAVA_HOME to be this path.
After that, add the JDK's bin directory to the PATH variable as well.
Following the previous assumption, this should be either
%JAVA_HOME%\bin or the full path C:\Program Files\Java\jdk7\bin
Apache Ant
To install Ant, download a zip from here, extract it, move the first
folder in the zip to a safe place, and update your PATH to include the
bin folder in that folder. For example, if you moved the Ant folder to
c:/, you'd want to add this to your PATH: C:\apache-ant-1.9.2\bin.
Android SDK
Installing the Android SDK is also necessary. The Android SDK provides
you the API libraries and developer tools necessary to build, test,
and debug apps for Android.
Cordova requires the ANDROID_HOME environment variable to be set. This
should point to the [ANDROID_SDK_DIR]\android-sdk directory (for
example c:\android\android-sdk).
Next, update your PATH to include the tools/ and platform-tools/
folder in that folder. So, using ANDROID_HOME, you would add both
%ANDROID_HOME%\tools and %ANDROID_HOME%\platform-tools.

Persistent error coming from libusb0

I'm using a Python application that accesses a USB device (pipsta printer) and executes a routine. It's running fine outside the container, but when it comes to the container it returns a error like this:
(File "usr/local/lib/python2.7/dist-packages/usb/backend/libusb0.py", line 386, in _check:
raise USBError(errmsg, ret)
USB.core.USBError: [Errno None] couldn't opendir(): No such a file or directory)
In my dockerfile, I've included all the packages relevant to Python and USB, and I also moved the relevant files to /etc/udev/rules.d and restarted udev.
Make sure you:
followed every step from assembly instruction and https://bitbucket.org/ablesystems/pipsta/wiki/Pipsta%20First-Time%20Setup
printer is connected to the power
printer is connected via usb to raspberry
printer's led doesn't blink (should be green constantly)
proper usb library is installed (or try to install different version of the usb library). What version are you using? python: print(usb.__version__) , it works fine for me with version 1.0.0rc1
is printer visible to the os? command: ls /dev/ap1400
I know this is an old question (I've only just encountered it). The following is a paraphrasing of the FAQ. The following steps should help diagnose the problem.
Download the latest set of Pipsta examples..
Extract the contents of the zip file.
Change directory to where the files were extracted
Change directory to the Examples folder.
Using a terminal run the command python verify_pipsta_install.py. This will try and help diagnose problems.
The following will should fix the python usb library error.
If your Pipsta printer firmware is V9.2.03 please upgrade the firmware to V9.2.08 using the fpu (both can be found in the downloads section of bit bucket.
Install the latest version of the Pipsta examples (download from bitbucket).
Copy the new pipsta/Examples/system_scripts/ to /etc/udev/rules.d/60-ablesystems-pyusb.rules
Restart the Raspberry Pi
If the printer still fails to be discovered then -
The following workaround may work.
1. Unplug the printer from the USB port
1. Enter the command sudo lsusb
1. Reconnect the printer
1. Enter the command sudo lsusb
If the printer has been detected by the Linux environment then either /dev/ap1400 or /dev/pipsta should exist in the filesystem.
NOTE The Pipsta now has Debian packages to help with installation. I have a link limit on my account but search for pipsta-printer-utilities-1.1.1-Linux.deb and pipsta-cups-driver-0.3.0-armhf.deb for more information.

How to add Java sub directory to Resources directory of mac app bundle

I would like to use install4j to make it easier to deploy my Java application to Windows, Mac, and Linux. I am evaluating install4j on my Windows development machine to make sure it can do what I need before I purchase it.
So far, I can get it to work for Windows and Linux but not for the Mac. The Mac app bundle that I cobbled together (without install4j) currently has the following structure where the Java dir contains external jar files (such as derby.jar) required by my application.
myApp.app
Contents
MacOS
Resources
Java
Perhaps I can use a simpler structure but this is what I have for now and it works. Unfortunately, the structure install4j builds does not work (it cannot find my derby.jar) and I cannot figure out how to get install4j to duplicate the app bundle directory structure that I know does work.
Any suggestions?

buildozer android debug deploy (run)

I am currently stuck in deploying an app into into my phone.
The app is part of this tutorial. Everything concerning the main.py and buildozer.spec files is set according this tutorial. The app works just fine when run in Eclipse (though some console "errors").
My phone is a Samsung GT-15500, Android version 2.2. and i am also running an apk installer and kivy launcher.
Additionally inside my phone files /mnt/sdcard i cant find a /kivy directory in order to place my app and a simple text file as mentioned here.
Anyway, the thing is that both in the tutorial and the kivy docs the following command: buildozer android debug deploy run fails into my machine. The given error is produced:
# Android packaging done!
# APK Kivyapp1-1.2.0-debug.apk available in the bin directory
# Run '/home/user/.buildozer/android/platform/android-sdk-21/platform-tools/adb devices'
# Cwd None
/home/user/.buildozer/android/platform/android-sdk-21/platform-tools/adb: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
# Command failed: /home/user/.buildozer/android/platform/android-sdk-21/platform-tools/adb devices
I am suspecting there has something to do with my ADT and SDK tools, configuration etc.
Any suggestions??
Oh and thanks in advance for your time.!
Edit: I am running a Linux Mint 16 distro
Edit2: corrected main.app to main.py and added info about the error.
Everything concerning the main.app
Just to be clear, you mean main.py right?
My phone is a Samsung GT-15500, Android version 2.2. and i am also running an apk installer and kivy launcher.
Have you tried kivy programs in the kivy launcher? Do they work? Phones old enough to use android 2.2 can sometimes have some graphics driver problems or bugs even if they technically meet the kivy requirements.
This wouldn't affect the buildozer compilation though, it's just another thing.
The given error is produced:
Could you set your log_level to 2 in buildozer.spec (the video covers this), run the build again, and paste the full log here. It isn't possible to debug from that single line.
==============
Edit: Okay, it looks like the apk is actually built correctly, and you should be able to find it in the 'bin' subfolder of wherever you ran buildozer. Assuming that's the case, you can try copying it to your phone some other way (email or whatever should work).
The step that's actually failing is the 'deploy' part that should push the apk to your device. I don't know what the error is, and I've never seen buildozer complain about curses before, though I guess you could check that you have curses installed?
My best suggestion is to investigate by navigating to the directory with adb in and playing with it manually. You can look up the commands, like adb install ... to install an apk to your phone - that's what buildozer tries to do.
You should also check that adb is enabled on your phone.

Installing Python Imaging Library on my iPhone's Python interpreter

I've been learning python for some time now. Recently I needed to install in my Mac the Image module for Python, and after a while I achieve this running a mpkg installer specially for my OS, so far everything was ok and I could run my script.
Now I'm in the needing of running my script in my jailbroken iPhone, which already has a python interpreter, and I need to install this Image module again but this time on my phone.
Is there another way to do it? How can I do it manually?
I found out how
I downloaded the PIL 1.1.7 source from http://www.pythonware.com/products/pil/ and untared the Imaging-1.1.7.tar.gz file, then I made the following commands:
cd Imaging-1.1.7/
python setup.py install
You can also follow the instructions on the README file in Imaging-1.1.7/ for building the package on your own.
that's it