Android installation of .apk (hybrid app developed with ionic) - android

I have a strange behavior, I have developed a hybrid app with ionic, afterwards I have installed it at my mobile with this command:
everything was fine, but on my phone I cannot find this app and also cannot find this paths and the file .apk:
/data/local/tmp/android-debug.apk
pkg: /data/local/tmp/android-debug.apk
What I'm doing wrong?

To run on device -
ionic run android
This will install application on mobile

Testing as a native app
$ ionic run android
More about testing as a native app
To generate a release build for Android
$ cordova build --release android
Android Publishing

Related

ionic cordova run android --prod events not working properly

I have installed ion2-calendar in my ionic application using npm install ion2-calendar moment --save and i have made some changes on its files located in node_modules/ion2-calendar/dist/components/month.component.js, i have added (panEnd) and (panStart) in its dates.it is working good using ionic serve and ionic cordova run android.but the events are not working when we make build usinng --prod option like
ionic cordova run android --prod
the build was successfull and we can run the app on mobile,but the added event does not works.is there anything we need to do to add this changees in production build?
I had the same situation but I solved this doing this step and rebuilding the project for production.
try production build commands
after removing local page module file (i.e login.module.ts) of each of your page!
I mean do this
To
NOTE!! if that does not work for your do post your logs by testing your device logs using
CHROME DEV tools. you can inspect device logs there using
chrome://inspect/#devices
make sure you are using ADB drivers for your android on your machine!
you won't require this for IOS though you can directly check your log commands in XCODE Console!

How to debug Ionic app stack at white screen?

I have built an ionic app. When I serve it via ionic serve (on browser), everything runs as expected. But when I do build it for android the app loads, shows the splash-screen and then just a blank white screen.
I have built the same app as configured (the cordova part) and replaced the src folder with the boilerplate that comes when you initialize a new app with ionic start and it runs just fine. Leading me to conclude that the problem is in my javascript code.
I would like to know how to debug this and how to find the console output when the device is running on an actual device. Is it possible to view the errors via adb and specifically when running on android?
Any Help please
My system information:
Cordova CLI: 6.5.0
Ionic Framework Version: 2.0.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.1.7
Ionic App Scripts Version: 1.0.0
OS: Linux 4.8
Node Version: v7.6.0
You can do through 2 ways:
1. IONIC RUN COMMAND
Run your application with the following command:
ionic run ios --livereload --consolelogs
this let you see the errors at the console and fix them up.
Here there is more documentation
http://gonehybrid.com/how-to-debug-the-white-screen-of-death-in-your-ionic-app/
2. CHROME
Additionally you can debug your app with Chrome, if you're running your app into an ADV or compiling in a device connect to your PC, open your browser and type in navbar chrome://inspect/ here will appear the list of webviews, here must appear your app and you can launch the Debug tools.

How to install ionic app in android device through terminal?

I am developing an ionic android app and it generates the output apk file inside
project->platforms->android->build->outputs
Then inorder to test the app, i am forced to manually copy the apk file to my device to install app on it. So is there any way by which i can directly install the apk in my device when i build the ionic project through terminal? In android studio, the app get installed on the device when we run the project. I am looking for same kind of methode with ionic.
I suppose you are running ionic build android.
You need to run the command ionic run android.
If your ANDROID_HOME path is correctly set, it will run in your connected device or if no device is connected, it will start your android emulator device.
You can also run this command ionic run android --device. If your ANDROID_HOME path is correctly set, it will run in your connected device as well.

Install specific apk

I am doing an Ionic project. Also I have added Crosswalk. So when I run ionic run android, android-debug.apk is installing in my phone. But I need to install the Crosswalk app (means android-armv7-debug.apk).
Is there any way to install this app by using the command ionic run android instead of copying this file?
Thanks
I don't know if this is possible with an ionic comand.
But you can do this.
ionic build android
adb -d install /path/to/file/android-armv7-debug.apk

Sencha Touch 2.3 / Cordova : Build run directly on device

I created an app for android with Sencha Touch 2.3 and Cordova. I used the following command to build and run the apk:
sencha app build -run native
However, this runs the app on the emulator but I would like to directly run it on the usb connected android device. Is it possible?
I already tried commands like these but it didn't work.
sencha app build -device native
or
sencha app build -run -device native
It is possible. There is a difference between Sencha and Cordova commands and both are for different purpose. Once you want to make apk for your android device. Just go through the steps here. But i will advice you to use build of your app to work with in your cordova app.
After making build of your project, Check the following steps:
cordova create yourapp com.example.yourapp YourApp
cd yourapp
cordova platform add android
cordova build android
After this you should copy your project and paste it into the immediate www folder of your cordova project. And then run
cordova run android
NB: sencha app build native
Deploy the .apk file in your emulator or real device to test the app

Categories

Resources