Connect Bluestacks to Android Studio

AndroidAndroid StudioAdbBluestacks

Android Problem Overview


I have recently shifted to android studio. I would like to know how I can test my apps in Bluestacks app player. I had already had the bluestacks connected and working with eclipse using adb connect localhost:5555 but it doesn't seem to work with android studio. Didn't find any help anywhere. If anyone has done this, please help.

Android Solutions


Solution 1 - Android

Steps to connect Blue Stack with Android Studio

  1. Close Android Studio.
  2. Go to adb.exe location (default location: %LocalAppData%\Android\sdk\platform-tools)
  3. Run adb connect localhost:5555 from this location.
  4. Start Android Studio and you will get Blue Stack as emulator when you run your app.

Solution 2 - Android

In my case I don't need to start adb.exe. I only started the BlueStacks before android studio.

After that when I press "Run" in android studio, bluestacks was detected as a new emulator.

enter image description here

enter image description here

Solution 3 - Android

I Solved it. I just had to add the path of android studio's platform-tools after removing my earlier eclipse's path. I don't know, maybe some conflict in the command.

Solution 4 - Android

world !

No need to do execute batch command. With the current version, just run BLUESTACKS before ANDROID STUDIO

Solution 5 - Android

> In my case, none of the above approaches worked for me till I had to enable > an Android DEBUG Bridge Option under the BlueStack emulator. Check the picture below.

An approach inspired from : Vlad Voytenko

enter image description here

I Hope It's Helps Someone!

Solution 6 - Android

For those people with (cannot connect to localhost:5555: No connection could be made because the target machine actively refused it. (10061) :

Blustacks is listening at IPv4-Localhost-TCP-5555 (not IPv6). Most of the time Windows has IPv6 enabled by default and Localhost is solving ::1:

If the client (ADB) tries to connect a server using localhost and IPv6 is enabled on the main network adapter, ADB will not connect to the server.

So, you have two options :

1- Change your ADB client TCP connection string to localhost IPV4 : adb connect 127.0.0.1

OR :

2-Disable IPV6 protocol from the main network adapter.

Solution 7 - Android

> first open bluestacks and go to settings > preferences > check the > Enable Android Debug Bridge (ADB) and press Change path button, then > select adb path. (default location: > %LocalAppData%\Android\sdk\platform-tools) > > then install one apk in emulator (by click the installed apps > > install apk in bluestacks home screen)

after doing this works run cmd by administrator and got to adb path then run this command:

adb connect localhost:5555

now you can open VSCodde or AndroidStudio and select BlueStacks emulator.

Solution 8 - Android

You can easily use it in Bluestacks 5 by going to:

  1. Settings
  2. Advanced
  3. Enable Android Debug Bridge

Bluestacks

Solution 9 - Android

  1. Goto Blustacks settings > Preferences > Check Enable Android Debug Bridge (ADB)
  2. Restart Bluestacks and Start Android Studio
  3. Done

Solution 10 - Android

These are all old answers, nothing works for me till I finally come out with a solution of my own. for a much later version (I'm using the 5.6x version, latest at the time of posting), just go to Settings in bluestack, click advanced, toggle on DB and run adb connect localhost:[port] with port being the number shown in the ADB information page (the one I underlined). Voila, you should automatically see another mobile device available on the Android Studioenter image description here

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionHarikrishnanView Question on Stackoverflow
Solution 1 - AndroidK TarunView Answer on Stackoverflow
Solution 2 - AndroidJRichardszView Answer on Stackoverflow
Solution 3 - AndroidHarikrishnanView Answer on Stackoverflow
Solution 4 - AndroidSaid AKHROUFView Answer on Stackoverflow
Solution 5 - AndroidPatsonLeanerView Answer on Stackoverflow
Solution 6 - AndroidTurricanView Answer on Stackoverflow
Solution 7 - AndroidMohammadSooriView Answer on Stackoverflow
Solution 8 - AndroidJohan JomyView Answer on Stackoverflow
Solution 9 - Androiduser13327428View Answer on Stackoverflow
Solution 10 - AndroidTamtomo Abdi NegoroView Answer on Stackoverflow