How does Ionic decide which Android emulator to launch? - android

I am following this for Android platform: http://ionicframework.com/getting-started/ (cmd> ionic emulate android) . It builds ok, and I know the apk works on a phone, but I want to figure out how does it decided which Android Virtual Device to launch. At the moment, it start up a v2.2 emulator by default and then complains it's too old while trying to install the apk. I want to use v4.1 or higher (I have the relevant SDKs installed through previous native Android development using Eclipse.)

From the command line, just specify the emulator target.
e.g. ionic emulate android --target="Nexus_6P_API_25"
Check the AVD manager for a list of available and installed virtual devices.

Kind of found an answer myself. Instead of using Google Android emulator, one can use
Genymotion. And use can set the device screen size and Android version.

Related

Showing "waiting for emulator to start..." while running cordova-android App

I built simple cordova android app, for that I'm trying to run in my physical android mobile.. but it showing
No target specified and no devices found, deploying to emulator
No emulator specified, defaulting to VisualStudio_android-23_arm_phone
Waiting for emulator to start...
Any suggestions or help would be appreciated.
I recommend not to use the built in Android emulators from Visual Studio. Instead, download the Android SDK Manager and then change your Visual Studio's ANDROID_HOME path to use it:
To download and update the Android SDK standalone refer to Download System Images and create Android emulator in that page.
Notice that if using VS2017, your Deploy to Emulator option will be gone, but there are workarounds to keep deploying to emulator manually.

Is it possible to create and maintain Android Virtual Devices WITHOUT installing Android Studio?

The development I'm taking on is written in TypeScript/JavaScript, and all the instructions left behind use TNS (Telerik NativeScript) command lines to build, debug and publish the apps, for both Android and iOS.
Setting up my Windows PC with Visual Studio Code, Node.js, NativeScript, and the Android SDK, I have got to the point where I can build the application using > tns build android but I cannot run it as I have no devices.
Going back to the NativeScript instructions, it does clearly say that an Android Virtual Device is needed, but the link takes me to how to setup an AVD using Android Studio.
Well, I do not want to install another IDE just to be able to manage AVD's. I'm familiar with VS Code, all the original development was done in VS Code on iOS, and all the documentation, including screenshots, are from VS Code.
Supposedly, there is an AVDManager.exe in C:\Android\android-sdk\tools\bin\, but there certainly isn't in my installation of the SDK.
> emulator -list-avds shows nothing.
> tns device android --available-devices also lists no available emulators.
Embarcaderos' RAD Studio includes an Android emulator, but I'm using Delphi 10.2 Tokyo for desktop development, so don't have access to that emulator on this machine.
Is there any other way to create an AVD, so that when I type > tns run android from the working folder of the mobile app, it starts the emulator and runs the app within it?
You can download just the SDK command line tools via the android studio download page -> "Get just the command line tools".
The emulator program and the avdmanager should be everything you need to get an emulator up and running.

How to use a different emulator in Android Studio

I have issues with the build in qemu emulator in Android Studio. There are some other Android emulators out there. How to configure Android Studio to use a different emulator? I use leapdroid emulator http://www.leapdroid.com to run apps and games.
Leapdroid is compatible with Android adb, i.e., using the same port numbers starting with 5555, so there is really nothing special to do, pretty much same as what you do with the built-in Android emulator. If you run "adb devices", you will see a device named as "emulator-5554".
Here are the steps:
Launch Leapdroid vm, which contains android 4.4.4 image
Launch Android Studio, and click Android emulator tab, a device named as "Emulator unknown 4.4.4" will show up inside the device list, and you can select it.
You should be able to see the logcat, and debug your Android app, etc.
Make sure that you close all other emulators first, in case there are conflicts.
I've also attached two screenshots for clarifications:
There are options like:
Genymotion: https://www.genymotion.com/
config with Androi Studio here
Visual Studio Emulator for Android
https://www.visualstudio.com/en-us/features/msft-android-emulator-vs.aspx
config with Android Studio here
I hope this help you
Did you try using Genymotion? It is the fastest emulator I've come across.
-Download it from their website for your required system specifications.
-You will also need an account to download the device images.
-Once all that is done, when you simply run the emulator, the device should show up in your ADB choose device window.
-You may also want to use Genymotion plugin for android studio for easy launch of virtual devices.

How do I configure Trigger.IO to use the Intel Atom x86 target for my Android virtual device?

When I run my Trigger.IO app in the Android emulator, Trigger.IO automatically creates an Android virtual device using the Android 2.2 target. I have learned that I can improve the speed of the Android emulator by choosing the Intel Atom x86 target (see http://software.intel.com/en-us/android). How do I configure Trigger.IO to use the Intel Atom x86 target? I have tried modifying the AVD created by Trigger.IO after it has been created, but Trigger.IO simply deletes and recreates the AVD using the Android 2.2 target the next time I run it.
As far as I know there are two ways to achieve this when working with Trigger.io:
1) As long as you don't have any devices connected and only the emulator of your choice running, you can just use forge run android to install and launch the app on this particular emulator.
In case you have multiple emulators running and/or android devices connected, you need to specify the emulator id. It can be found in the title bar of an android emulator application and is followed by the name of the AVD (see the screenshot below). Example: You got an emulator named android403 which is started and its title bar says 5554:android403. Just use forge run android --android.device emulator-5554 to run your app in this specific emulator.
2) You can package your app using forge package android and download the resulting .apk file to your emulator. Just install it the same way you'd do on a real device. Make sure to enable SD Card support on your emulator when using this method.
If you are going to mix up both methods there is one more thing: An app installed via method 2 cannot be automatically overwritten by an install process described in 1. You'd have to manually uninstall the app beforehand. However, as long as you stick to one of the two you should be fine without manually uninstalling anything.
Another thing that you should know in this context is that apps built with Trigger.io are incompatible with the Android 2.3.3 (API 10) emulator. They will work on real devices running this Android version though.

How to I emulate a specific Android device via AVD?

(This question may belong on a different site such as SuperUser. If so, please migrate!)
I'm trying to do a lot of debugging of our web app for Android. The Android emulator seems a tad more difficult for me to get running than the iOS ones. ;)
I have installed the proper Java JDK and Android SDK.
I can now launch AVD manager. This is where I'm stuck. I understand this is where we can customize the specifications of our particular device, but to create a new virtual device, I need to choose a target. However, my target menu is grayed out. I'm guessing there's one more thing I need to install, but I'm lost as to what that is. (BTW, for starters, I'm trying to emulate the Thunderbolt).
Check this out. You probably missed step 4
Installing the SDK
Installing the Android SDK does not install one of the Android platforms to build a AVD from.
To install a platform do the following:
Open the Android SDK Manager (located in the Android SDK directory as tools\android).
Select at least one Android platform to install, and click Install Selected. Depending on the version of Android running on the Thunderbolt, you would most likely choose to install Android 2.2 or Android 2.3).
Once this installed the target menu will display the version you installed.

Categories

Resources