Easiest way to install the Ionic android app I created on a mobile - ionic-framework

On this website (https://ionicframework.com/docs/intro/deploying/) I read that I should give this command on the command prompt: ionic cordova run android --prod --release
I tried it but it only tried to start the app on an emulator (I have some problems with it, so it didn't actually start the emulator). Does this command also create a file I can put on my mobile and install the app? I don't want to put the app on Google play, just on my mobile.
I tried putting the android-debug.apk on my mobile and running it but my mobile couldn't install it (.../platforms/android/build/outputs/apk/android-debug.apk)
I'm not trying to test the app on my mobile, I'm trying to install it.

If you want to deploy the apk to your device
ionic cordova run android --device is indeed correct. (try adding --device)
You only need --prod --release when building for production (longer buildtime).
Before running (= building, installing and starting your app) check if your device has USB-debugging enabled. You can check if your device is connected by running adb devices. Since the run command includes building, yes run should create a apk for you.
As you said you also could install the apk manually. Here make sure to use the correct apk. android-debug.apk is the development build (no --release tag) and since your trying to run a production one (--release) you are looking for android-release.apk or android-release-unsigned.apk.

go to settings -> security in your phone then check Unknown sources (Allow installation of apps from sources other than the play store) and try to put the android-debug.apk again. this should work

Related

app-release is not installed in real device Flutter

I am releasing apk this way(shown on image)
I have release apk file from build/flutter/Build apk but is not installed in any real devices and its give me error "App is not installed as package appears to be invalid". Can you please help me how to solve this error I am stuck in this problem. This app is run nicely in debug mode from run command.
I have tried this solution:
Uninstall old app and then tried to installed this app
Restart real device and then tried to install this app
Create new apk release file and tried.
Flutter clean and Flutter get done.
Tried to install more than 5 devices but same error in every real device.

How do I install Flutter app on Android phone?

I couldn't install flutter app on my android phone. How can I do it? I can run by usb debugging However I want to install it on my phone. Can someone help me please?
If you use IntelliJ Idea (it should also work on Android Studio), you can go to
Build -> Flutter -> Build APK, (in the menu bar)
and after building, your apk will appear in
build/app/outputs/flutter-apk/app-release.apk,
just send the file to your phone and install, your phone will probably tell you not do download cause it isn't checked and secured or something, just ignore and install anyway
Connect your Android device to your computer with a USB cable.
Enter cd [project].
Run flutter install.
Source: here
You need to build the app to get the apk. For building apk use this command in console: flutter build apk and if you want to build your apk in smaller size then use this command in console: flutter build apk --split-per-abi.
After building apk you will find it in [project]\build\app\outputs\flutter-apk\app-armeabi-v7a-release.apk here.
If you don't want to build apk and just want to test your app you can run it in profile mode by using this command in console: flutter run --profile.
In android studio under the tools-> build -> build apk will create and app for you and you can get and the output location will show you after the builing the app

flutter debug APK not installing on mobile

Am not able to install the APK in my mobile generated by gradle. it's working fine on an emulator but when I try to install on my mobile its starts installing and in the middle, it gives the error APK not installed. Am running android 10. Paths from where I picked the debug APKs are as follow.
<project>/build/app/outputs/apk/debug/app-debug.apk
<project>/build/app/outputs/apk/debug/app.apk
<project>/build/app/outputs/flutter-apk/app-debug.apk
It seems your apk does not have certificate yet.
you cant install it just like that. you can either certify it build release android app
or set your phone to install app form unknown source. in app settings or security settings
If you're trying to manually install the app-debug.apk, you should rather consider generating app-release.apk but if you can't debug the app, then you might considering opening up your developer options.

How to install custom build AOSP apps in Android phone

I have build MMS app from AOSP (Build no: LMY48M) using the following command
make -j8 Mms
The command produces a Mms.apk file, that I would like to install in my Nexus 5 phone. The phone is rooted and has Android Build number LMY48M installed.
The phone should contain a Mms app installed with the same app Id of my Mms.apk file. I wanted to remove the installed Mms app from the phone as I have root permission. I do not find any Mms application whatsoever. SMS functionality is being provided by Hangouts app.
Moreover, when I tried to install the generated Mms.apk file, it shows permission screen with the install button. Tapping on install button starts the installation process but stops in few seconds with error "App not installed."
Any suggestion is appreciated. Thank you.
You should try copy paste the apk into system->app instead of installing
You should install the apk using the adb install command:
adb install -r Mms.apk
This should install the latest apk and will perform an update of the previous version of the Mms.apk if it is already present.
The tricky part here is if it is already present the new apk must be signed with the same cert as the existing one. I'm not sure if those are public certs or not but it's worth a try.
lunch aosp_arm-eng command is for emulator and won't work for device build, rather use specific command for the device. For Nexus 5 you need to use command lunch aosp_hammerhead-userdebug (Ref: https://source.android.com/source/running.html#selecting-device-build)
P.S you should download the same branch as of your device build number. For instance, my Nexus 5 device has build number LMY48M, so I should download branch android-5.1.1_r14. For more information, https://source.android.com/source/build-numbers.html
Now you can install the Mms.apk file just tapping on it from device. You do not need to uninstall/remove Hangouts.
The Mms application has been replaced in Lillipop by Hangouts app. If you would like to install the Mms app as an internal app then you need to make the following folder structure in your rooted device,
system/priv-app/Mms/Mms.apk
and restart the device.

My Ionic app works fine on browser but does not open in my phone

my ionic project works fine with ionic serve --lab ,but while copied the.apk file in build folder to my phone and install the app but blank screen appears ,
Please can anyone suggest what might be my problem
my app is using google maps,key is provieded for both app and browser in index.html
Have you tried running it in the emulator ? Since its much easier to see the error logs . Try ionic emulate android -l or ios -l (whichever OS you are building for) and then once the execution starts run the command consolelogs it will log all the activity and you will have a better understanding about why its not working.
+1 for using Chrome Remote Debugging feature. It give you the same output as you would receive from running you app in the browser.
Additionally, I have found that sometimes if your app is already compiled, the ionic CLI doesnt always copy your current files into the APK, and uses the older cached files instead. If you are banging your head against the wall, run the following commands to make sure you have your latest code in your APK.
ionic platform remove android
ionic platform add android
ionic run android
I suggest you use the Chrome Remote Debugging feature. I encountered the same, and looked for answers to my symptom for hours. Once I connected to the chrome remote debugger, I got the console.log back, and noticed there was a problem in my routing setup.
It was a problem with ionic CLI. I've updated it to the latest and reinstalled all dependencies.