Connect Bluestacks to Android Studio

风流意气都作罢 提交于 2019-11-26 18:59:32

问题


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.


回答1:


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.



回答2:


In my case I didn't needed start adb.exe. I only started the BlueStacks before android studio.

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

Regards.




回答3:


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.




回答4:


world !

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




回答5:


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.




回答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.



来源:https://stackoverflow.com/questions/24598577/connect-bluestacks-to-android-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!