How to use a different emulator in Android Studio - android

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.

Related

Time out waiting for emulator to come online in android studio

I am new in android and trying to run a simple Hello world! program using android studio. I defined an AVD which is a Pixel device with API version 28 (Pie). When I run the program, the emulator gets up, but it doesn't load the application. I have tried following, but none of them worked:
Restarting avd server from command-line.
Changing skin to QVGA.
Creating a new emulator.
Setting graphics to software.
Any idea on the issue?
I think you do not enabled USB Debugging in your AVD.
Try this steps:
1- go to your AVD setting
2- System
3- About Device
4- Multiple Clicks on Build Number
5- Go back to setting
now you see Developer Options
6- goto developer options
7- check USB Debugging
Hope to be useful
Have you enabled USB debugging inside the emulator?
Before you create an Android emulator, you need to install an Android system image that your emulators can use.
Note: If you installed the Android SDK and NDK during RAD Studio installation, a valid Android system image (such as Android 4.2.2 API 17) should already be shown as Installed in the Android SDK Manager. In this case, you do not need to install another Android system image.
Still, if you are not able to run the emulator then try this Memu Emulator
This is a very small and simple emulator to use and install. It works perfectly on every pc.

How to develop android apps with xamarin without hyper v and emulator

I am using windows 10 home and visual studio 2017. I want to develop android apps with xamarin. Hyper-V feature is not available on windows 10 home and I can not afford pro version, So emulator is not installing without hyper-v.
What should I do to develop android app?
Have anybody idea to deploy android app without using emulator and hyper-v?
Thank you in advance!
It's possible to develop Xamarin app without using the emulators. But in that case you'll need to have an Android device to deploy your app on.
Setup Android SDK Manager on your system. Although Xamarin includes a
SDK Manager, you can download it from the following link. Android SDK Manager download
Setup the ADB (Android Debug Bridge) on your system (install Google USB Drivers)
Connect your Android device to the system after you enable USB Debugging(Developer options) on it. Once the device is connected it will give you a prompt to enable debugging. Tap yes and you'll see the option to build to your device as shown in image.
You can try to use any avaliable on windows android emulator. I like to use Bluestack (https://www.bluestacks.com), the steps for use it below:
Install Bluestacks emulator
Launch emulator and wait for load finished
It's your wellcome screen, your application and apps from store will be here
Go to settings > Preferences and check "Enable android debug bridge (ADB)" + "Enable Android input debugging"
One time Setup finished
"Open android adb command promt" and type
adb connect 127.0.0.1:5555
If you have done everything good you will be connected to emulator and ready to debug your application
Good luck!
UPDATE:
As of visual studio 2019, non-hyper v emulation has been stopped.
Old Answer
I am very positive that at the time of VS installation the Visual studio emulators for Android are readily available for download and use, there you can find a good amount of android emulators also it provides you with Android SDK which again can be used to create Android emulators without using Hyper-V
The below link contains all you need to know about Visual studio emulators including on how to install :
https://msdn.microsoft.com/en-us/library/mt228279.aspx
Hope this Answers your question.
Goodluck!

Unable to deploy to Genymotion device through Android Studio

I'm currently using Genymotion with Android Studio via the Genymotion plugin to try to test and debug my Android applications. I set up the Android Studio Genymotion plugin a while ago, and it worked. However, just now I tried to deploy my application to Genymotion, but after starting my Genymotion device, it did not appear in the ADB deployment list. I have no idea what happened or why. Does anyone have any idea?
By the way, this means I cannot test my application, as I cannot use the regular ADB virtual device set as per this other continuing issue: How to create an Android AVD without HAXM?
Thanks!
It is potentially an incompatibility problem between the adb shipped with Genymotion and the one from your Android SDK.
Turn all your Genymotion devices off.
Then open Genymotion application (not the IDE plugin), go to settings > adb tab > check "use custom adb" and set the path to yout Android SDK.
Then reopen a device and you should see it on your IDE.

App not run in visual studio emulator for android in visual studio 2015

I create blank xamarin android project without add any code when i debug this project debugging without problem but when i run app with visual studio emulator for android emulator is running but not starting my app and deploy failed and don't show me error
why ?
please help me
I had the same issue. VS 2015 can launch the VS emulator but can't deploy the app.
I was able to solve the issue like this:
Launch the emulator (F5 in VS, then cancel the deployment using the Build/Cancel menu)
Click on the chevron icon (») in the toolbar to the right of the emulator
Select the Network tab
Locate the preferred network ip address
Back in VS, click on the Open Adb Command Prompt toolbar button
Type adb connect [the emulator ip address]
Press F5 again in VS
Looks like a VS bug to me.
I had the same issue. It turned out the root cause was that the VS Emulator couldn't find adb.exe.
When that happens it won't connect to the emulator unless you do the manual connection following the steps CSharpRocks gives. The emulator also won't be listed under "adb devices".
The fix for me was to reinstall the Android SDK, using the Windows EXE based installer (not the zip installer). The EXE installer sets the HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Android SDK Tools key, Path value, in the registry, pointing to the Android SDK root directory.
The VS Emulator uses that registry setting (or the Android Studio install registry setting) to find the SDK, assuming you didn't install the Android SDK with Visual Studio itself. With that, it should be able to find adb.exe and work.
Have a look here:
Xamarin Forms Android App Crashes Running Debug with VS Android Emulator
Start the Hyper-V manager
Select the emulator you are trying to use
Right-click, hit settings
Click processor
Click Compatibility
Set checkbox “Migrate to a physical computer with a different processor version”
I'm having a very similar issue. I have found two different kind-of-work-arounds, but have not yet figured out a full solution.
Start the emulator before trying to deploy to it
Launch the Visual Studio Emulator for Android application from the start menu.
Launch one of the available emulators via the green arrow
Attempt to again launch your application from visual studio, selecting the VS Emulator N-inch... emulator from the drop down menu
For me for some reason the app still doesn't "launch" on the emulator, although it is installed. So I have to open the application menu and select my app. Additionally it will usually crash the first several times I try to open it, but eventually displays my single default label, Welcome to Xamarin Forms!.
Run the application in Ad-Hoc mode
Before running the application, change the solution configuration (from the top toolbar next to the green "run" button) to Ad-Hoc.
The problem with both of these methods though is that I'm still not able to actually debug an application. I can run it, but my breakpoints are ignored and I think that will make finding bugs difficult once I actually start to write a real application.
I hope to update this answer once I figure out an actual solution.
I had the same problem yesterday. The problem appeared (probably) because I tried to start development after a long break. I updated VS and everything, but faced many issues.
Eventually you need to start fresh
Make sure SDK for emulator points to the right place (HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Android SDK Tools)
Run Visual Studio with Administrator privileges
Go to Hyper-V Manager and delete ALL Virtual Switches - let the system recreate them when needed. It will do it properly
Delete all existing emulators and recreate them in Visual Studio. I even found a comment to name them without spaces - not sure if it is needed, but wouldn't hurt.
Doing all this helped me. But I was on the verge of reinstalling Windows 10 clean. I think lots of things and configuration changed and are no longer compatible.
Try it enabling Hyper-V and using a Visual Studio Emulator from android; that worked for me after a lot of attempts and research
I had the same issue but in my case it was not the registry. After doing a release build, I deployed the app to the emulator device in release mode which pushes the app to the device and then effectively "disconnects". This leaves a version of the app on the device which seems to block further attempts at debugging or deploying.
I solved it by starting the emulator, going to "settings -> apps" and manually uninstalling my app. Then the next debug build & deploy worked again.
You could probably also manually start the emulator and say "wipe device" option so it starts fresh.
In VS2017, on a Windows10 machine, all I had to do to get the app to show up was turn off Mobile Data.
(swipe down or use settings, then click Mobile Data and confirm to turn it off).
After I turned it back on, I could access the app. Before doing this, it always seemed that the emulator ran, but wouldn't run the app.
... no idea why this worked, but I'm posting it here in case it helps someone.
During my troubleshooting process, I also looked at these articles:
VS Android Emulator wont run application
Troubleshooting the Visual Studio Emulator for Android
Update Your Path For The New Android Emulator Location
Install apache in VS 2015 here.
Visual studio requires apache to develop android apps.
You also may want to look at some other suggestions:
notshowing, troubleshooting
I had such issues before with the android SDK emulator, now I'm using Genymotion emulator instead of it, it is more light and faster and will be detected automatically by you VS once launched.
you can download the free version from here : https://www.genymotion.com/
and also you can download any device emulator.

Start my application on genymotion

I have just installed genymotions, but when I try to start my app on it, as described at the end of this paragraph, eclipse starts the old emulator even if the new one(genymotion) is running. I tried to change the debug configuration but the only virtual devices that I can see in target are the old emulators(see the photo below).
If in target i follow this answer, I get the following error :
[2014-01-30 19:50:00 - HelloWorld] No active compatible AVD's or devices found. Relaunch this configuration after connecting a device or starting an AVD.
Moreover I followed the FAQs that suggests how to bing the SDK. I show my configuration in the second photo.
The devices shown in the photo are all made with AVD, there aren't the one of genymotion and neither the one that is running:
Here I put the configurations of genymotion:
How can I say to eclipse to start the genymotion emulator and not the AVD one?
Looking at your screenshot I think you should unselect all the AVDs displayed on the list. The option you chose launches the best selected AVD by default, and optionally a device.
Also, the Genymotion instances are considered as real devices by ADB and ADT. So, as GhostDerfel mentioned, you need to run one of them before running your app on Genymotion instance.
To know all the detected devices by ADB you can look at the "Devices" section of DDMS. If a Genymotion device is detected, it should show a name like this : genymotion-galaxy_s3....
You can also run this command adb devices. The result should show something like this:
List of devices attached
192.168.56.102:5555 device
Each Genymotion machine is listed by its local IP address here.
If you can't find your Genymotion instance(s), check that you have the lastest version of Genymotion. A ADB detection bug has been fixed on the release 2.0.2
I had the same problem, i solved it by closing Genymotion and starting it from Genymotion Virtual Device Manager in Eclipse
i also had this problem and all tried all the above solutions and still was not working.but finally i read in the genymotion manual that u can simply drag and drop ur apk to the device and it will load and run.so i tried that and not only it worked it also seemed to solve the path problem also so that when ever i run the project it will automatically detect my device created by genymotion.
I can resolve by connecting a real device one time.
You need to install the genymotion plugin. In android studio File>Settings>Plugins>Browse Repositories > install genymotion plugin. once installed a genymotion button should appear in android studio.I hope that helpfull for you.

Categories

Resources