1

I am new to android development and was trying to use bluestacks to test my apps (as my pc won't run the emulator fast) but the bluestacks emulator is not being detected by android studio.

  1. I started bluestacks and then ran my app. On the choose device dialog it doesn't show bluestacks.

  2. I looked up in device monitor, but bluestacks wasn't detected there.

  3. I also tried using adb kill-server, adb start-server, adb connect 127.0.0.1 but that didn't work as well. It says "connection could not be made as the target machine actively refused it".

All the solutions given in the other related stackoverflow post don't work. Android studio won't recognize bluestacks.

Please Help !!

Ayusch
  • 417
  • 7
  • 17
  • Possible duplicate of [Connect Bluestacks to Android Studio](http://stackoverflow.com/questions/24598577/connect-bluestacks-to-android-studio) – Viral Patel Jan 14 '16 at 07:57
  • I don't think so. I had checked out this post earlier but thr answer didn't solve the problem. – Ayusch Jan 14 '16 at 10:06

5 Answers5

2

Try in command prompt "netstat -anb" with administration privileges. Check if there is 127.0.0.1 5555 Estebalished. If everything is OK then temporary disable firewall and type"adb connect 127.0.0.1:5555" should work.

2

i too have also gotten the error "connection could not be made as the target machine actively refused it" recently (when i tried to connect to adb using command prompt) Trying with -> adb connect localhost:5555 or adb connect 127.0.0.1:5555 would not work. You need to identify your bluestack device ip address. You can identify the ip address using the preferences in your bluestack emulator setting. (where you enabled ADB in bluestack).

I did the following to resolve the error you had encountered and successfully connect Android studio to Bluestack. please try the following steps. (I am using windows 10, Android Studio 4.0.1, Bluestacks 4.200.)

  1. find your android studio sdk platform tool folder. For me its is custom installed in my D drive. for example-> D:\AppData\Local\Android\Sdk\platform-tools
  2. right click on adb.exe and run as administrator. (click on yes if a pop up ask if you would like to make changes to your devices. After that you would only see another pop up that suddenly disappear.)
  3. open Bluestacks. Run your selected emulator (samsung/pixel etc). Ensure that you have enable "Enable Android Debug Bridge (ADB) in the emulator preferences.
  4. open command prompt. cd to your platform tools folder path.
  5. enter the following command->adb connect xxxxxxxxxxx where xxxxxx is your device localhost ip. (see attach pic. My device ip is 127.0.0.1:xxxxx hence my command is ->adb connect 127.0.0.1:xxxxx
  6. continue with the following command->adb devices you would see your bluestack emulator device. same ip listed.
  7. open your android studio. You would be able to see your bluestack emulator

[enter bluestack adb preferences1

android studio with bluestack emulator

4nn4bel
  • 135
  • 2
  • 8
0

i don't know if you fixed the issue or not but it's pretty simple to use bluestacks, if you see this screen when you open it like this all you have to do is run the app in android. it happens where android doesn't detect it because it wont see it as a device you either wait or try to get that screen (that sort of refreshs)

0

Just Need to do this! Go to the SDK folder that you have got in your computer,then open the "platform-tools" folder,then open the "adb.exe" as administrator. then try the BlueStack emulator.

-1

if u got problem to connect with blue stack through android studio then follow following steps

  1. in run(windows+R) put '%localappdata%\Android\Sdk\platform-tools' and check adb.exe is working correctly or not If not then download file from https://www.microsoft.com/en-us/download/confirmation.aspx?id=49093 which is Update for Windows 7 for x64-based Systems (KB2999226) (related OS) and install it.
  2. allow adb.exe as exception in your virus scan software don't treat this exe as malware.
  3. start your blue stack emulator.
  4. go in setting of blue stack emulator go in preferences click checkbox 'Enable Android Debug Bridge'.
  5. go to this location %localappdata%\Android\Sdk\platform-tools and run cmd through this location.
  6. put command 'adb connect localhost:5555' press enter in command prompt.
  7. start android studio then run project through play button popup will come with virtual device list, it will show your emulator's device.

  8. ...happy coding