Connect Bluestacks to Android Studio
Asked Answered
K

12

59

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.

Kirman answered 6/7, 2014 at 17:44 Comment(0)
K
18

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.

Kirman answered 6/7, 2014 at 17:54 Comment(2)
For those of you who are new to android development and need more detailed instructions: 1. Run BlueStacks 2. Close Android Studio 3. Find adb.exe (windows). The default install location for android studio is: c:\Users\<YOUR USER NAME>\AppData\Local\Android\android-studio\sdk\platform-tools 4. Run adb localhost:5555 5. Start up android studio again 6. Run your android app. You should see the bluestacks emulator (may be named "unknown" etc) in your device list. Select it and run the app on it.Hulbig
it is adb connect localhost:5555Cephalonia
B
80

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.
Bankston answered 7/1, 2015 at 9:21 Comment(6)
Didn't work for me unfortunately :(cannot connect to localhost:5555: No connection could be made because the target machine actively refused it. (10061)Berni
@Berni you have to start the bluestack emulator first and then run adb connect localhost:5555Pickwickian
This worked for me, but didn't require step 3. The requirement is to run Blue Stack before starting Android Studio, as mentioned in @Said AKHROUF's answer.Foster
In order for me to work, I also had to follow the steps from the following guide and after that to run the adb from that location. geekinsta.com/…Heteroplasty
this worked for mePreece
in bluestack 5 go to settings then advance and check "android debug bridge" then start android studio and you will get emulator-5554 option in running devices on android studio. (NOTE: you have to open bluestack yourself otherwise its option will not show in android studio)Circumpolar
K
38

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

Kit answered 26/1, 2015 at 4:29 Comment(2)
01/08 13:35:20: Launching 'app' on OnePlus ONEPLUS A5000. Installation did not succeed. The application could not be installed. Installation failed due to: 'closed' RetryIslaen
Hi. Where is this log from?Kit
E
20

world !

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

Evalyn answered 24/9, 2017 at 9:45 Comment(2)
No need to restart android studio. You can use "adb kill-server", then "adb devices" and you'll see your device in both adb and android studioStan
This did job for meImpudicity
W
19

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!

Wynd answered 17/1, 2020 at 11:25 Comment(2)
Thank you dear stranger. I couldn't understand why adb devices was showing the emulator offline. Then I saw this and check the box and now it is a device as it should.Isidroisinglass
@Isidroisinglass you are welcome, I'm excited that you are sorted. by the way, My name is Patson, but you can call me Pat.Wynd
K
18

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.

Kirman answered 6/7, 2014 at 17:54 Comment(2)
For those of you who are new to android development and need more detailed instructions: 1. Run BlueStacks 2. Close Android Studio 3. Find adb.exe (windows). The default install location for android studio is: c:\Users\<YOUR USER NAME>\AppData\Local\Android\android-studio\sdk\platform-tools 4. Run adb localhost:5555 5. Start up android studio again 6. Run your android app. You should see the bluestacks emulator (may be named "unknown" etc) in your device list. Select it and run the app on it.Hulbig
it is adb connect localhost:5555Cephalonia
S
6

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.

Single answered 6/10, 2019 at 20:27 Comment(0)
L
4

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.

Lovash answered 15/10, 2018 at 11:39 Comment(0)
D
3

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

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

Bluestacks

Deictic answered 7/9, 2021 at 9:10 Comment(2)
i had to run the command to connect the adb to the above mentioned url (localhost... different port)Allerus
in bluestack 5 go to settings then advance and check "android debug bridge" then start android studio and you will get emulator-5554 option in running devices on android studio. (NOTE: you have to open bluestack yourself otherwise its option will not show in android studio)Circumpolar
A
2

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

Alcibiades answered 6/4, 2022 at 6:43 Comment(0)
I
1
  1. Goto Blustacks settings > Preferences > Check Enable Android Debug Bridge (ADB)
  2. Restart Bluestacks and Start Android Studio
  3. Done
Islaen answered 8/1, 2021 at 8:13 Comment(0)
C
0

note number port in bluestack settings device

ex here: adb connect localhost:55094

enter image description here

Calton answered 21/9, 2022 at 13:39 Comment(0)
A
0

2024 update:

Bluestacks 10.10 (latest) seems to register itself with adb automatically.

What I did:

  • Download the latest BlueStacks 10 from its offical website
  • Launch BlueStacks, in settings -> Advanced, enable ADB

enter image description here

  • Then launched my react-native app through command line. No other configuration was necessary. It was automatically located. I didn't even launch Android studio.

enter image description here

Allen answered 22/1 at 4:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.