How to see debug console when app installed through apk in flutter? - android

I am able to see debug console in the terminal when I am run the command flutter run
but when I run the command flutter build apk --split-per-abi
it's given me two application
so when I am installing one of this apk in my android phone, I am not able to see any debug output or my print.
I want to know how can I do this because my app is working fine in debug mode but when I installed flutter build apk --split-per-abi this apk, my app crash after two or three pages because of an external plugin.
How can I check debug console when I am installed the app through apk?

flutter attach
and then start your application. Or using adb logcat:
adb logcat *:S flutter:V

Related

React Native app crashes after installed on real device

Just rebuilt React Native app as the previous version failed in building on Android emulator. The React Native is upgraded from 0.66 to 0.67 and a few other modules, such as React Native gesture handler, were upgraded as well.
The app works fine on Android 2021.1.1 Patch 2 emulator. However after downloading the release package from the distribution server, the app installed on Android 10 device quits as soon as launching without giving any error.
What is the problem with the release package? Here is the build steps:
./gradlew bundleRelease
bundletool build-apks to build mypackage.apks with signature.
unzip it into mypackage.apk
Connecting android device to dev Mac using USB cable, the app was launched successfully on the real device. And the app can be launched successfully late as well. I notice that the size of the app is 77MB which is about twice as big as the app installed from the universal apk.
If you need to check apk on real device, follow this build steps:
Release APK Generation.
Place your terminal directory to Android using:
cd android
Then run the following command:
For Windows:
gradlew assembleRelease
For Linux and Mac OSX:
./gradlew assembleRelease
As a result, the APK creation process is done. You can find the generated APK at android/app/build/outputs/apk/app-release.apk. This is the actual app, which you can send to your phone or upload to the Google Play Store. Congratulations, you’ve just generated a React Native Release Build APK for Android.
There are frequent errors that show up in this process sometimes, which is typical to a React Native app, given React Native is continuously evolving. We are laying out here the most frequent React Native build errors that we ran into, to save you time and headaches.

Share flutter app as APK which works on real devices

I want to build APK from the flutter project and share it to someone to review. I followed the docs, but the problem is when he tries to open the APK he gets
"there was a problem parsing the package"
I tried it on another device and gets
"App not installed"
I think the problem is in the APK file, So how I can build a correct APK that works on real devices?
I keep the name of the file "app.apk" does that matter?
from the Flutter docs, to build an APK from the command line:
Run flutter build apk
(The flutter build command defaults to --release.)
This command results in an APK file:
[project]/build/app/outputs/flutter-apk/app-release.apk
take note of the path and ask name(app-release.apk)
if you would like to debug why the apk not running on physical device, install this app https://fbflipper.com/ on your system, and connect your mobile device though a usb cable, now when you run the apk, on the flipper app you will receive crash report that will help you understand why your app is crashing!

flutter apk test on my friends' android devices

I've finally completed building my own first flutter app, a lot thanks to SO. But I've still got an issue about testing my flutter apk in others' devices. So, finally i got 'app-release.apk', 'app.apk' and few more apk-related files. So excited, I sent those files to my friends, but friends told me that the app is well downloaded but not able to open it. So here's the question! Is there any additional essential commands to successfully open the apk file on real android device? If so, is there really no way to install and successfully open and use .apk or .aab flutter app in my friends' android device? I want to test my app in friends' device BEFORE google's review is done! Thank you in advance [:
Hey congratulations that you have completed the first app.
you have to run this command
flutter build apk --split-per-abi
this command gives your three apk file so you have to ask your friend that which processor he has. Depends on it you will give it.
<app dir>/build/app/outputs/apk/release/app-armeabi-v7a-release.apk
<app dir>/build/app/outputs/apk/release/app-arm64-v8a-release.apk
<app dir>/build/app/outputs/apk/release/app-x86_64-release.apk
Make sure your app is running perfectly in release mode as well
you can verify it via flutter run --release -v.
-v means verbose you can see the complete logs of your flutter app
I use VSCode so can't comment on AS. Basically though, to give your friends apks that they can side load on Android devices. In the terminal, first do a Flutter clean and when it completes execute 'flutter build apk --target-platform android-arm64'. The resultant app.apk in your outputs folder should be able to run on their devices.

Flutter: How to create a development APK that can be installed on the phone

I recently started working with flutter. I have been making several test applications. They all work well on emulators.
But now I want to be able to use them on my cell phone.
I took the APK that is generated when I run the application in the emulator, indicated in this route:
But it always fails to install
So far, my applications are simple, Hello world, Add numbers, etc.
Any ideas?
How should I do it correctly?
First: Open your Terminal/Shell/Command Line and open the directory of the Flutter App in there (cd PATH_TO_YOUR_FILE)
You probably want to create a profile-mode apk for testing. This build still helps debugging while having the speed of the --release version:
This creates a single APK which works on all devices (x64, arm64 and arm), it's probably pretty big:
flutter build apk --profile
If the people who install your App know which devices they have, you can use the split-per-abi command which creates three different APKs for all architectures (x64, arm64 and arm)
flutter build apk --profile --split-per-abi
If you want to have a release build, you can use what #Niteesh commented:
flutter build apk --release --split-per-abi
Release-builds can be uploaded to Google-Play (also the internal testing)
Read more: https://flutter.dev/docs/testing/build-modes
the apk that is generated when you run the app is the debug-apk, it contains lots of overheads which helps in flutter hot reload and hot restart. The size of debug apk version is also a lot.
use this command to generate release version of apk
flutter build apk --split-per-abi
After execution of the command, you get the path of the apk, something like this
√ Built build\app\outputs\flutter-apk\app-armeabi-v7a-release.apk (7.0MB).
Then you can install that apk on your phone

React Native + Android: Release build "Unfortunately App, has stopped"

I am trying to prepare my app for release.
When I run the app from android studio it works fine. But when I upload a beta build to the Play Store or I run adb install android/app/app-release.apk and try to run the app on my phone, it shows the Unfortunately App, has stopped message.
How can I debug this? Is there a way to run the release build on my phone through android studio so that I can view the logs?
I have never tried, but leave your device plugged in to USB. Run adb logcat in the terminal.
There's probably additional settings to filter for your specific application package

Categories

Resources