Not able to run ionic app in my device to debug application - ionic-framework

Iam trying to run the ionic app in my device for logging errors . I am using the following command
ionic cordova run android -l -c -s --debug
The app is installing in my device but its showing ERR_CONNECTION_REFUSED and the application is closing.
Can some one give solution to this issue ? Thanks

For Livereload the phone and the development machine (dm) have to be on the same network and the mentioned Port has to be reachable (no Firewall on dm, etc.)
Your phone Shows 4g as Network. Ist has to be in your wifi

Related

Building a Flutter web app while being connected to the internet gives me an internal server error.?

When I run my flutter web project in a debug version of Chrome while being connected to internet, I get the following build message:
Launching lib\main.dart on Chrome in debug mode...
Building application for the web...
Attempting to connect to browser instance..
Debug service listening on ws://127.0.0.1:55339/mh67GZ3e4D0=
Which probably means that the website is hosted locally with port 55339.
But the chrome windows is opened with the port 55063 and which is completely blank.
When I try to open "127.0.0.1:55339", which supposedly should open my web project gives me an error:
Internal Server Error
But when I disconnect from Internet and build the project , Project builds successfully and executes perfectly, as in the proper window is opened.
What could possibly go wrong while I am connected to internet, something related to proxy?
How do I build the project while still being connected to internet?
try to run with this command: flutter run --release -d chrome -v

Ionic 3. Unable to load page via devApp

I'm a first time using Ionic 3 framework to create cross-mobile native application.
I had some problem when I test program with devApp application.
On browser it runs well, but on mobile shows error:
Unable to load page. The request time out.
Does somebody know how to solve this problem?
This could be triggered by so many reasons like bad code, network issues and so on
So I suggest you to:
Close your Devapp completly
Disconnect from Wifi
Close App in your browser
do a fresh new ionic serve -c
Start DevApp again
Connect to Wifi again
Start your App on Device
If this doesnt work you need to show us your code from app.component.ts and index.html and also your ionic info
Ionic devApp connects to your app using device internal ip on the same router. It might change everytime you connect.
Find the internal ip (ubuntu: ifconfig -a) and manually enter the ip and port using the option manually enter address in the sidebar.

ionic app run perfectly on browser but not working on devApp and android apk

This question is related to ionic 3 and I want to know how to run an ionic app using a real device.
I have developed an hybrid application and I was not able to connect my app with server. It works fine in my laptop browser. But it does not work in devApp and android apk.
I have tried many solutions but was not able to get the perfect solution. I have made a proxy server to access the api by ionic devApp but it doesn't even show a single error.
I think this problem is related about CORS.
Use the additional parameter of --devapp when running your ionic serve.
ionic serve --devapp
Should work now.
For me allowing port 8100 in my firewall was needed. Then everythig works.
CORS is not a problem when you build your app on a real device.
To run your app on android device :
ionic cordova platform add android
ionic cordova build android
ionic cordova run android (Connect your device before executing this)
Try Reinstalling cordova-plugin-whitelist plugin.
I'd the same problem. But I just uninstalled and installed again the ionic DevApp and it solved it.
Try using the command ionic serve -c this for view the app into Ionic devApp
I am not sure if this helps now - In your DevAPp you have settings where you can manually enter IP address and port. This will be the private IP (192.x.x.x) and 8100 that is displayed when you start the ionic serve --devapp from the terminal.

How to prevent launch Ionic app on emulator

I'm working on ionic App and I'm trying to run App on real Android device, But when I run ionic run android in terminal, I get the following error:
Running command: "C:\Program Files (x86)\nodejs\node.exe"
D:\wamp\www\pars-app\pars-app\hooks\after_prepare\010_add_platform_class.js
D:\wamp\www\pars-app\pars-app
add to body class: platform-android
ANDROID_HOME=D:\Sdk\android-sdk
JAVA_HOME=C:\Program Files\java\jdk1.8.0_45
No target specified, deploying to emulator
ERROR running one or more of the platforms: No emulator images (avds)
found.
1. Download desired System Image by running: "D:\Sdk\android-sdk\tools\android.bat" sdk
2. Create an AVD by running: "D:\Sdk\android-sdk\tools\android.bat" avd HINT: For a faster emulator, use an Intel System Image and install
the HAXM device driver
You may not have the required environment or OS to run this project
How to prevent run app on windows emulator? I want to run app on real device that conected to my computer.
I am using windows 8 and Huawei with Android 4.2.2
::note
I have read these questions, But I didn't got the answer!
Why not work Ionic app testing on android real device?
Ionic run android does not run app on device
ionic run android - configurations not running app on device
As a complement to #OClyde answer, you could try :
adb kill-server
adb start-server
To have infos about these commands :
adb --help
Nb : Sometimes, for a reason i do not know, the connection between my phone and the computer break. Running this fixes it.
To make sure that your app is not installed to an emulator but to your device, take the following steps:
Open up your console and run adb devices. This should give you a list of all devices available (real devices as well as running emulators) to the Android Debug Bridge. If the adb command is not recognized check that you have installed the Android SDK correctly and that you've set all the necessary environment variables accordingly.
The adb devices command might give you output similar to this:
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
This indicates that the ADB wasn't ready before, so in this case just try to un- and replug your device and run adb devices again to see if the device is listed afterwards.
If your device is still not showing, check that USB Debugging is enabled on your device. Therefore you first have to enable developer settings, which you can do by tapping the build number (Settings => About Phone) 7 times (no, that's not a joke ;) ). After that, you'll have the developer options in your settings menu. Open these and check "USB Debugging"
If still your device isn't recognized by the ADB, change the USB connection mode. You can either do this in the developer options as well or tap the notification shown when the phone is connected to your PC. Try MTP as well as PTP, on of those should do the job.
After these steps, it should be nearly impossible that the device is still not recognized by your PC. As soon as there is a phone available, Ionic will install the app on the phone automatically instead of launching an emulator.

ionic app works only on wifi but not on cellular connection

My ionic app works fine on the emulator and on my device (using wifi)
But as soon as I switch over to cellular connection I get an
Application Error
net::ERR_CONNECTION_TIMED_OUT (http://192.168.0.13:8100/)
Why can I not use the app with cellular connection?
ionic run android -l -c -s
-l : livereload, it compiles hybrid app itself, watching for any changes to its files and reloading the app when needed.as soon as u make any changes in code,it will reflect in app on device.
-c : an app’s console logs can be printed to the terminal/command prompt
-s : the development server’s request logs can be printed.
this will help u only in that network and until u stop your command.
read here
ionic run android
this command will make apk to run in any environment.