在 bluestacks 应用程序播放器上通过 Eclipse 调试 android 应用程序

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11899794/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 09:07:21  来源:igfitidea点击:

debugging android app via eclipse on bluestacks app player

androiddebuggingemulationbluestacks

提问by Sagi Mann

I have read a few articles that BlueStacks App Player can be used to debug android apps via Eclipse, instead of the default android emulator. Example article

我读过几篇文章,BlueStacks App Player 可用于通过 Eclipse 调试 android 应用程序,而不是默认的 android 模拟器。 示例文章

But I think this refers to the Windows version, I was unable to get to it work on MacOS. Does anyone know how to debug using BlueStacks/eclipse on MAC?

但我认为这是指 Windows 版本,我无法在 MacOS 上使用它。有谁知道如何在 MAC 上使用 BlueStacks/eclipse 进行调试?

回答by Ambreesh Bangur

adb connect localhost:10001 

should do the trick.

应该做的伎俩。

回答by Herks

Well, you can try another way:

好吧,你可以尝试另一种方式:

1) First, open the DDMS via Window->Open Perspective->DDMSunder Eclipse.

1) 首先,Window->Open Perspective->DDMS在 Eclipse 下打开 DDMS 。

2) Then open BlueStacks App Player.(leave it opens)

2)然后打开BlueStacks App Player。(保持打开状态)

3) After that switch back to Eclipse and you should notice there're two emulator under the Devicetab. enter image description here

3) 之后切换回 Eclipse,您应该注意到Device选项卡下有两个模拟器。 在此处输入图片说明

Then click Reset adbunder the small triangle at the Devicetab. enter image description here

然后Reset adbDevice选项卡上的小三角形下方单击。 在此处输入图片说明

After a few seconds, the another one emulator will disappear and you can proceed to the next step. enter image description here

几秒钟后,另一个模拟器将消失,您可以继续下一步。 在此处输入图片说明

4) Then return back through Window->Open Perspective->Javaunder Eclipse.

4)然后Window->Open Perspective->Java在Eclipse下返回。

5) Select your project and right click on it, choose Debug As->Debug Configurationsenter image description here

5)选择您的项目并右键单击它,选择 Debug As->Debug Configurations在此处输入图片说明

6) Under Android Applicationselect your configuration or create a new one. On the Targettab choose Always prompt to pick deviceAfter this, select Applythen Debug. enter image description here

6) 在Android Application选择您的配置或创建一个新配置下。在Target选项卡上选择Always prompt to pick deviceAfter this,Apply然后选择Debug在此处输入图片说明

7) Then select BlueStacks emulator in the prompt window, and finally select OK.

7)然后在提示窗口中选择BlueStacks emulator,最后选择OK

Alternatively, you can also open the BlueStacks App Player before Eclipse using the above steps(with minor changes).

或者,您也可以使用上述步骤(稍作更改)在 Eclipse 之前打开 BlueStacks App Player。

For more info, visit the below links.(However, in Chinese...)

欲了解更多信息,请访问以下链接。(但是,在中文...)

http://www.cnblogs.com/hbbbs/archive/2012/10/30/2746950.htmlhttp://www.cnblogs.com/hbbbs/archive/2012/10/30/2746979.html

http://www.cnblogs.com/hbbbs/archive/2012/10/30/2746950.html http://www.cnblogs.com/hbbbs/archive/2012/10/30/2746979.html

Hopefully this will help you.

希望这会帮助你。

回答by Ait Friha Zaid

C:\>cd Program Files (x86)\Android\android-sdk\platform-tools

C:\Program Files (x86)\Android\android-sdk\platform-tools>adb connect 127.0.0.1:5555
connected to 127.0.0.1:5555

C:\Program Files (x86)\Android\android-sdk\platform-tools>

回答by Omar Othman

Run Bluestacks.

运行 Bluestacks。

open Command Promptin Windows.

在 Windows 中打开命令提示符

Go to Platform-toolsusing following command.

使用以下命令转到平台工具

cd C:\Users\<username>\AppData\Local\Android\sdk\platform-tools

then write:

然后写:

adb devices

With SDK tools 27 and later! You get a list of devices detectedby adb .. if BlueStacks-4 is installed you should see the device listed (emulator-555x).

使用 SDK 工具 27 及更高版本!您将获得adb检测到的设备列表。如果安装了 BlueStacks-4,您应该会看到列出的设备 (emulator-555x)。

回答by ivan_pozdeev

BlueStacks bundles its own copy of adb, %PROGRAMFILES(x86)%\BlueStacks\HD-adb.exe. You can connect localhostwith it, or any other command. BlueStacks 3 uses the default port 5555.

BlueStacks 捆绑了自己的adb,副本%PROGRAMFILES(x86)%\BlueStacks\HD-adb.exe。你可以connect localhost用它,或任何其他命令。BlueStacks 3 使用默认端口5555

回答by Khaled Hayek

For Mac users: localhost:5037 worked for me

对于 Mac 用户: localhost:5037 为我工作