How to prevent launch Ionic app on emulator - ionic-framework

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.

Related

Android Studio device list stuck on loading

Picture of the issue
I'm trying to add my physical phone to the device list, however, the device list is stuck on loading.
I try to Kill adb process (on Task Manager on Windows) and Open Android Studio
And also I Try to reinstall Flutter and resetting the Flutter SDK, but still the same problem.
For me this fixed the issue:
First close the android studio and kill the all the related bg
processes.
Restart pc and check there are no bg processes running.
Now connect your Android Device (make sure USB debug is enabled).
Revoke the debug permissions and then allow debugging.
Now on pc run adb devices command from terminal.
If your device is displayed then proceed to open Android Studio and
wait for some time.
Also make sure that there is only one version of adb is installed.

React native Android Project Not starting in emulator

i just created a react native project on windows, using expo. After Creating the project i ran npm start and then expo start the next logical thing to do is to press the a button which will launch, the project on the android virtual device, but instead it gave me this error Couldn't start project on Android: Error running adb: Error running app. Error: Activity not started, unable to resolve Intent { act=android.intent.action.VIEW dat=exp://192.168.43.148:19000 flg=0x10000000 }
when i tried running it on my android phone with the expo android app it ran smoothly, i don't know what to do please help thanks
I had the same problem and I got it fixed as follows:
Go to SDK Manager in Android studio > SDK Tools and check whether there is any update for Android SDK Build-Tools. If there is any, please make sure you update it.
Close any Android virtual device currently running and then go to Android Studio Virtual Device Manager and wipe the data of your Android virtual device.
Make sure you have enough internal storage allocated for your Android virtual device to install apps.
Check whether Android Debug Bridge utility is installed in your device. If not please install it. To install in mac, I used the below command (Assuming that you have HomeBrew installed in your mac device):
brew install android-platform-tools
Start your Android virtual device ( This step should be done before running the expo development server)
In the Developer options menu of your Android virtual device, make sure USB debugging option is enabled.
Finally, try running the development server by expo start and press on the button to run on your Android emulator.

how to run flutter app in VSCode without android studio emulator

I want to run flutter app in VS.Code without android studio emulator.
I want run my app without install android studio.
How can I do this?
If you have Gradle properly installed globally (https://gradle.org/install/) and the Android SDK setup on your machine, then you should not need the IDE.
Try first checking for available devices:
flutter devices
Then using the device that you find (if there are any spaces in the name that represents the device then use "" to format the command), execute the following command:
flutter run -d "Device Name With Spaces" --release
Or:
flutter run -d DeviceNameWithoutSpaces --release
The first option is You can run your application on chrome or edge if you don't want to download an emulator. Follow the following steps:
Click on the no-device option to select the device.
Now select chrome or edge
And the second option is you can connect your mobile with your PC and use your phone to run the flutter apps. Follow the following steps:
For Android:
Enable developer options and USB Debugging on your device. This varies slightly
by android version. But the short version is you tap on the device build number
7 times.
Then a “Developer Options” option comes up. After that, you can click “enable
USB Debugging.”
Then plug your phone into your computer with a USB cable. You’ll see some popup
on your phone asking if you want to allow USB debugging with that computer.
Click on “yes”.
Run Flutter just like you would if you had a simulator running.

Flutter : No Devices available [duplicate]

This question already has answers here:
Android Studio, Suddenly got GPU Driver Issue when running emulator
(11 answers)
Closed 10 months ago.
Good night people !!!!
I am making settings in the Flutter Framework to use Android Studio, I already did a lot of the settings but when interpreting the flutter in the command line, do not find the device, so I went to look for the settings in Android Studio and gave a stop in the AVD Manager to Virtual Devices ... the error
GPU#1
Make: 8068.
Model: Mobile Intel (R) 4 Series Express Chipset Family (Microsoft Corporation-WDD 1.1)
Device ID: 2a42
I ask for help solving the problem. Here is the error screenshot.
Try to run the emulator via command line/terminal/cmd.
first, find the emulator list:
emulator -list-avds
then run one of it:
emulator -avd avd_name -gpu mode
If you cant find the emulator command, try to look at the executable in
c:\Users\username\AppData\Local\Android\Sdk then add the path to your environment.
try running emulator from terminal, forcing it to run using hardware graphics (instead of letting emulator decide on which) using command
emulator -avd avd_name -gpu mode
where mode is host so that it will run with hardware.
example:
Using Android Studio terminal move to folder where the emulator is located. Default on Win10 is: C:\Users\userName\AppData\Local\Android\sdk\emulator
Find emulator to run by listing available ones: emulator -list-avds
Run emulator with -gpu host option: emulator -avd avd_name -gpu host
Checkout the following path.
File > Project Structure > Project SDK
If there is NO SDK selected. Then Select Appropriate Android SDK by configuring it.
Otherwise,
In your terminal, add following command
adb kill-server
adb start-server
I hope this will definitely work for you.

No USB devices android studio 3.1.3

I used to run my application in VIVO Y51L device. It's showing as No USB devices detected.
Developer options and USB debugging is ON, but it is still not detecting. What should I do??
This is probably due to improper driver installation or adb. Although this should not have happened if you had it working earlier re-installing the drivers should fix this. I'd recommend you to download and run the 15 second adb installer. It would install adb system-wide and also give you an option to re-install the required google drivers.
Installing them should fix this. You can verify that your device is connected by opening the command prompt and typing adb devices. It should kill the daemon and restart it. Once you switch back to Android Studio and run it. Your device should show up there.
Good Luck.