gpt4 book ai didi

android - 使用 NetBeans 在 Android 上等待调试器

转载 作者:行者123 更新时间:2023-11-29 14:56:54 25 4
gpt4 key购买 nike

当我尝试使用 NetBeans 和 nbandroid 插件调试 Android 应用程序时,它会启动模拟器,最终当模拟器启动时它会显示

Waiting For Debugger
Application [app name] ([package name]) is waiting for the debugger to attach.

我得到一个强制关闭按钮。

这是来自 DDMS 的日志。

01-14 11:44:46.131: INFO/ActivityManager(85): Force stopping package [packagename] uid=-1
01-14 11:44:46.131: INFO/ActivityManager(85): Starting activity: Intent { flg=0x10000000 cmp=[packagename]/.[activityclassname] }
01-14 11:44:46.311: DEBUG/AndroidRuntime(420): Shutting down VM
01-14 11:44:46.331: DEBUG/jdwp(420): adbd disconnected
01-14 11:44:46.371: INFO/AndroidRuntime(420): NOTE: attach of thread 'Binder Thread #3' failed
01-14 11:44:46.411: INFO/ActivityManager(85): Start proc [packagename] for activity [packagename]/.[activityclassname]: pid=427 uid=10032 gids={3003}
01-14 11:44:47.200: WARN/ActivityThread(427): Application [packagename] is waiting for the debugger on port 8100...
01-14 11:44:47.231: INFO/System.out(427): Sending WAIT chunk
01-14 11:44:50.280: DEBUG/SntpClient(85): request time failed: java.net.SocketException: Address family not supported by protocol
01-14 11:44:56.253: WARN/ActivityManager(85): Launch timeout has expired, giving up wake lock!
01-14 11:44:57.003: WARN/ActivityManager(85): Activity idle timeout for HistoryRecord{43f85578 [packagename]/.[activityclassname]}
01-14 11:45:05.350: DEBUG/dalvikvm(166): GC_EXPLICIT freed 595 objects / 29656 bytes in 120ms
01-14 11:45:10.320: DEBUG/dalvikvm(228): GC_EXPLICIT freed 190 objects / 13056 bytes in 92ms
01-14 11:45:15.331: DEBUG/dalvikvm(304): GC_EXPLICIT freed 277 objects / 13112 bytes in 92ms
01-14 11:45:20.401: DEBUG/dalvikvm(162): GC_EXPLICIT freed 586 objects / 32240 bytes in 109ms
01-14 11:47:05.161: DEBUG/dalvikvm(162): GC_EXPLICIT freed 49 objects / 2704 bytes in 93ms
01-14 11:49:05.201: DEBUG/dalvikvm(162): GC_EXPLICIT freed 15 objects / 600 bytes in 130ms
01-14 11:49:47.595: INFO/jdwp(85): Ignoring second debugger -- accepting and dropping
01-14 11:49:47.710: INFO/jdwp(155): Ignoring second debugger -- accepting and dropping
01-14 11:49:47.740: INFO/jdwp(160): Ignoring second debugger -- accepting and dropping
01-14 11:49:47.750: INFO/jdwp(162): Ignoring second debugger -- accepting and dropping
01-14 11:49:47.772: INFO/jdwp(166): Ignoring second debugger -- accepting and dropping
01-14 11:49:47.810: INFO/jdwp(194): Ignoring second debugger -- accepting and dropping
01-14 11:49:47.820: INFO/jdwp(224): Ignoring second debugger -- accepting and dropping
01-14 11:49:47.861: INFO/jdwp(228): Ignoring second debugger -- accepting and dropping
01-14 11:49:47.872: INFO/jdwp(242): Ignoring second debugger -- accepting and dropping
01-14 11:49:47.880: INFO/jdwp(271): Ignoring second debugger -- accepting and dropping
01-14 11:49:47.980: INFO/jdwp(427): Ignoring second debugger -- accepting and dropping
01-14 11:49:47.980: INFO/jdwp(304): Ignoring second debugger -- accepting and dropping
01-14 11:49:47.980: INFO/jdwp(337): Ignoring second debugger -- accepting and dropping
01-14 11:49:48.020: INFO/jdwp(293): Ignoring second debugger -- accepting and dropping
01-14 11:49:50.290: DEBUG/SntpClient(85): request time failed: java.net.SocketException: Address family not supported by protocol
01-14 11:50:10.970: DEBUG/Email(271): *** synchronizeMailboxGeneric ***
01-14 11:50:11.250: DEBUG/dalvikvm(271): GC_FOR_MALLOC freed 9369 objects / 455104 bytes in 126ms
01-14 11:51:05.171: DEBUG/dalvikvm(162): GC_EXPLICIT freed 15 objects / 600 bytes in 90ms
01-14 11:53:05.180: DEBUG/dalvikvm(162): GC_EXPLICIT freed 15 objects / 600 bytes in 95ms
01-14 11:54:50.293: DEBUG/SntpClient(85): request time failed: java.net.SocketException: Address family not supported by protocol

这是 NetBeans ant 日志

init:
deps-jar:
Compiling 1 source file to C:\[apppath]\build\classes
compile:
Updating zip: C:\[apppath]\dist\[appname].apk_

THIS TOOL IS DEPRECATED. See --help for more information.

Deleting: C:\[appdir]\dist\[appname].apk_
Deleting: C:\[apppath]\dist\[appname].apk__
Building zip: C:\[apppath].zip
jar:
pkg: /data/local/tmp/[appname].apk
Success
569 KB/s (275945 bytes in 0.473s)
About to start [packagename]/[packagename].[activityclassname]
Starting: Intent { cmp=[packagenamel]/.[activityclassname] }

NetBeans 告诉我该进程仍在运行,并为我提供一个停止按钮,以便我根据需要“终止”。

而且我的 CPU 和磁盘大部分都处于空闲状态。

最佳答案

我也遇到了这个问题。当模拟器显示“等待调试器连接”时,您必须手动连接调试器。在 Netbean 的菜单栏中,单击“调试”,然后单击“附加调试器...”。您必须从“进程”下拉列表中选择您的包,然后单击“附加”。应该可以了。

无论如何,这在 Netbeans 7 中有效。

关于android - 使用 NetBeans 在 Android 上等待调试器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4693694/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com