简体   繁体   English

如何在不重新安装新应用程序的情况下附加到Eclipse中的Java进程?

[英]how to attach to java process in eclipse without re-installing fresh app?

I want to debug my android widget. 我想调试我的Android小部件。

Of course it can run without the app itself to run. 当然,它可以在没有应用程序本身运行的情况下运行。

I want to debug something that happens in the android-service java code 我想调试android-service java代码中发生的事情

without fresh installing the app. 无需重新安装应用程序。

how can I do this? 我怎样才能做到这一点?

Assuming you app is deployed and runs on a device and device is connected to your PC or Mac. 假设您的应用已部署并在设备上运行,并且该设备已连接到PC或Mac。

Open "DDMS" perspective -> Choose a device in "Devices" view -> Select the process your app runs in -> Press "Debug" button (with a green bug) in "Devices" view. 打开“ DDMS”透视图->在“设备”视图中选择设备 ->选择应用程序在其中运行的进程->在“设备”视图中按“调试”按钮(带有绿色错误)。 Now you can switch back to "Java" perspective and put a breakpoint to the place you want to debug. 现在,您可以切换回“ Java”透视图,并在要调试的位置放置一个断点。 Breakpoint should become green, meaning Eclipse has attached to the process. 断点应变为绿色,这意味着Eclipse已连接到该过程。 Update your widget and debug the code. 更新您的小部件并调试代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM