How can I test and debug at chrome for Android App - angularjs

I have made a simple android app using ionic and AngularJs and I run this app then it works in a a browser while I run app in Emulator then it is not working.So I want to find issue what is reason that it is not working so for this purpose I want to do testing and debugging
I have made a simple android app using Ionic and AngularJS and whenI run this app then it works in a browser while I run this app in Emulator then it is not working.
Please tell me how can I test and debug in a chrome for android app.And also tell me detail with step.

You can build the app in debug mode and then connect your computer to your Android phone that you want to test the app. After that, you install the app via the .apk that you just generated then start the app. Now that your app is running in your phone that is connected to your computer, you can debug via Google Chrome by inspecting it. Here is how to do so in details.

Related

Background location tracking not working in apk but working in debug mode

Actually I'm developing an app in react native which requires background location access it's working fine in debug mode but when I generate apk it's not working. My question is do I have to submit it to play console even if the app is for testing to test the apk?
You need to added permission to your project.
https://docs.expo.dev/guides/permissions/
Just follow this doc or you can add permission into react native project also..

How to debug React-Native (Expo) app apk bugs?

Is there any method to catch errors and bugs in built apk?
I tries to build with expo:build and also with EAS. In first one on some screens it freezes. In EAS build app just shutting down.
In dev mode app just works fine.
1)You can use an automated error logging system like Sentry to track errors at production. If your app uses an EAS build, you can use native crash reporting in addition to tracking javascript errors with the Sentry. But if your app uses the classic build system you can track only javascript errors with the sentry.
2)If your Android app is on Google Play, you can look at the crashes section of the Google Play Console.
3)You can connect your Android device which installed apk to your computer and run adb logcat to view the logs.
4)You can use also logcat with the Android Studio to look at the error logs of your app.
More info: https://docs.expo.dev/workflow/debugging/

Camera is not defined in Cordova

I have implemented a camera functionality in an ionic-angular based application.I am getting an error Camera is not defined.The above mentioned error is occurring when I am using the command ionic serve.The issue doesn't exist when command ionic browser is used.Also getting the same error Camera is not defined when I deployed the app to firebase.Any suggestions for steps I need to follow while deploying the app to firebase to avoid the error ?
Below is the behavior I could see.
I used the command ionic serve.
The Camera plugin doesn't loads in browser view and I could see the following error.
Error from browser
On using the command ionic run browser,Could see camera getting loaded.This is browser view.ionic run browser
This application is deployed using firebase deploy command and hosted in a firebase environment.I could see the same behavior ie(Camera not loading) when accessed the url through an android phone(Moto X Play). Is this expected?.Do I need to execute some other steps while deploying my application to firebase.
Also I have included the ngCordova dependencies in my app.js and included the cordova.js just before ng-cordova.js in my index.html.Currently this app is not installed in playstore or Apple app store.This application is developed in ionic and can be viewed in mobile device by accessing firebase hosting url in which the application is deployed.
Camera plugin is a cordova plugin.and some cordova plugins doesn't support in browser. so install your app into mobile, it will work fine.

How to convert an existing AngularJS 2 web app to a Cordova app?

I have a webapp which I build with Angularjs 2.0, I want to convert it to android apk and install it on android phone and test.
I dont have any experience in building mobile native app or converting webapp to native app.
I have gone through How to convert an existing AngularJS web app to a Cordova app?
Any suggestion/guidance will be helpful.
The most simple explanation is you will need to put your angular files in the www folder, setup your configuration file, make sure the android platform is installed, then run the Android emulate and/or build command to see if it works. That's a very oversimplified version.
Once you've got it working there's a process to go through to prepare the apk to be uploaded to the Google Play Store. You have to be a registered developer for the play store, which is $25/year.
https://scotch.io/#vijayk036/building-hybrid-mobile-apps-using-cordova-and-angularjs-for-android
https://thebhwgroup.com/blog/converting-angularjs-website-cordova-app-ios-and-android

Ionic Framework app works with "ionic serve" but not in Ionic View app

I have a very small Ionic app I've been working on (just a couple angular routes/views). When I run it using "ionic serve", the app loads in my browser as expected. However, when I upload it using "ionic upload" and view it in the Ionic View app, it appears as though none of my javascript works, or my routes are not working.
How can I debug this issue? Are there build tools to detect errors or anything along those lines?
As #Keval says if you're running Android you can debug on-the-fly using Chrome
enable Developer options on your device (Settings > About, then find Build number and keep tapping it...yes really!)
In Developer options, enable USB debugging checkbox
plug in with a USB cable
run your app on the device.
At some point your device will then show a popup requiring you to accept debug commands from the remote computer, click Accept. If it doesn't appear the first time, unplug and replug usually fixes it
head to chrome://inspect in desktop Chrome, and click inspect under your device
A new Chrome window will open with all the juicy abilities you need - inspect code, set breakpoints, look at network speeds, access the console and so on
You can also do this on iOS via Safari http://developer.telerik.com/featured/a-concise-guide-to-remote-debugging-on-ios-android-and-windows-phone/
I had the same issue recently. The problem was that I stored my Ionic views NOT in /templates folder.
Please, check, maybe my answer will be useful for you.

Resources