How to Use Ionic Capacitor Live Reload [Ionic-Angular] - ionic-framework

I am using VSCode to create/edit my Ionic app. To view my app in the Android emulator I run the following in a terminal window:
ionic capacitor run android --livereload-url=http://localhost:8100
This starts Android Studio with no problems. I then run my code, which starts the emulator - again, no problem. I am able to use the emulator to test my app.
But, after editing the code in VSCode, how do I get the emulator to reload with the new code? I've tried clicking the "Apply Changes and Restart Activity" icon in the menu bar. I've also tried the "Apply Code Changes" menu bar icon. Both will reload the app. But, I do not see any of my changes.
What am I missing?

Related

Flutter app is not showing as an icon on the android emulator homescreen

I am trying to build an app. I am using flutter as the framework and VS Code as my IDE. I also have an android emulator installed via android studio. I am trying to implement authentication. If i run my app it opens in the emulator and works just fine. Now i want to test if a user stays logged in when the app is closed (not running in the background) and reopened. However if i close the app in the android emulator, the whole process stops and there is no icon of my app on the home screen with which i could restart it. I have to "run and debug" again in VS Code to restart the process. Is there any way to start the app again via the emulator phone?
I updated the emulator and the flutter package, i changed emulator devices. Did not solve the problem.
Because when your app is disconnected from debug - you can use hot restart its consider as app is kill and open again - here having a problem with flutter if you disconnect from debug your all assets will be remove from entire app. Another option - if you want to test your app then make release app and installed in physical device
You can try to run your app from VS Code itself.
Use this bottom Menu button to launch emulator:
Select your Emulator from listed / Create a new one:
Hope it helps!

How to run emulator outside android studio?

I am using Android Studio bumbleBee version in Windows 10 . Appears in a window when I run the emulator. My monitor is small and it is better to have it separately as before.
There are three methods that I can think of.
Thanks to #vishal beep answer, You can simply go to file => setting=>search emulator in the search field=>select emulator=>uncheck launch in a tool window. Screenshot below.
Since it is a flutter project Instead of going to device manager you can simply
Click on the device list first and
Select Refresh if you don't see your emulator
Once refreshed you should be able to see the emulator like the screenshot below.
select the emulator, and run your application.
.
3. Or you can run the emulator as usual and then right-click on the emulator window and choose View mode=>Select Float option instead of Docked Pinned screenshot attached below
Thanks, Keep coding
Go to setting -> tools ->emulator and unselecte launch in a tool windows
Simply Go to Preferences.. >Tools > Emulator and then and then uncheck Launch into tool window
For windows user Go to Settings >Tools > Emulator and then and then uncheck Launch into tool window
Note : Before Doing this activity close all running Emulators and if needed restart the Android studio after changing the Emulator settings

AVD manager is not responding in Androd Studio BumbleBee 2021.1.1 for flutter

AVD manager icon is not responding. I opened a native app project and the icon is responding. But it doesn't respond if I click it from a flutter project. Tried restarting, reinstalling.
Double press the SHIFT key on your keyboard and search for "virtual device manager" and it will open for you as usual.
if you are opening a Flutter project, open any android native project in another window and it will work well, it will be fixed in future updates

VSCode flutter how to launch Android Emulator instead of Chrome

All my old projects were able to launch debugging with Android Emulator. When I press F5, it will shows a list of installed Android Emulator for me to select for debugging.
But today, I have created a new project, and it launches debugging in Chrome instead.
First you'll need to check if the android platform has been initialized for the project. If you project has an android folder then it has been initialized, if you will need to create it with the following command: flutter create --platforms android .
To run the emulator, check the bottom right corner of the screen you should see the currently selected platform, if you click on the selected platform a pop up should appear allowing you to select from all supported platforms.
You can also you use quick-open (ctrl+p) and type in >flutter launch emulator, if no emulator is found it will provide you the option to create one as well.

How to get stacktrace from Flutter?

I have a Android/iOS app developed using Flutter through Visual Studio Code. When I run it on Android >=5.0 or any version of iOS it works flawlessly, however it crashes immediately when I run it on Android 4.x (Unfortunately, app has stopped).
I want to fix it, but Flutterdoesn't show me what is happening.
I tried to run through VSCode pushing F5 button and also using command line flutter run, but neither shows me something that I could work with. I tried to run with trace command [Flutter trace run], but it says The --debug-port argument must be specified and I don't know what it means.
I just need a stacktrace or a line error showing me what is the problem. Do I have to configure something on VSCode?
There's a Debug Console available in Visual Studio Code as per checking version 1.51.1. This can be enabled/disabled by navigating through the menu View > Debug Console. Both logs from Android emulator and iOS simulator can be displayed on the Debug Console.
However, if you're looking into checking Flutter debug logs outside of Visual Studio Code, the adb logcat command using the terminal works well for Android as previously mentioned in the comments.
On iOS, one way of checking the logs is through the Console. Press ⌘ + space and type "Console", and press Enter to launch the app. The iOS device should be displayed on the left-side pane of the Console app under Devices. Clicking on the iOS device should display its logs.