在 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
debugging android app via eclipse on bluestacks app player
提问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->DDMS
under 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 Device
tab.
3) 之后切换回 Eclipse,您应该注意到Device
选项卡下有两个模拟器。
Then click Reset adb
under the small triangle at the Device
tab.
然后Reset adb
在Device
选项卡上的小三角形下方单击。
After a few seconds, the another one emulator will disappear and you can proceed to the next step.
几秒钟后,另一个模拟器将消失,您可以继续下一步。
4) Then return back through Window->Open Perspective->Java
under Eclipse.
4)然后Window->Open Perspective->Java
在Eclipse下返回。
5) Select your project and right click on it, choose Debug As->Debug Configurations
5)选择您的项目并右键单击它,选择 Debug As->Debug Configurations
6) Under Android Application
select your configuration or create a new one. On the Target
tab choose Always prompt to pick device
After this, select Apply
then Debug
.
6) 在Android Application
选择您的配置或创建一个新配置下。在Target
选项卡上选择Always prompt to pick device
After 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 localhost
with 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 为我工作