2011-01-14 34 views
1

當我嘗試調試與NetBeans和nbandroid插件的Android應用程序,它會啓動模擬器,並最終當模擬器出現它說等待對於調試Android上使用NetBeans

等待對於調試
應用程序[app name]([package name])正在等待調試器附加。

我得到一個強制關閉按鈕。

以下是來自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的螞蟻日誌

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和磁盤大部分空閒。

回答

4

我也遇到了這個問題。當仿真器顯示「等待調試器附加」時,您必須手動附加調試器。在Netbean的菜單欄中,點擊「Debug」,然後點擊「Attach Debugger ...」。您必須從「Process」下拉列表中選擇您的軟件包,然後單擊「Attach」。這應該做到這一點。

無論如何,這在Netbeans 7中都能正常工作。

2

您有兩種選擇:連接調試器或終止進程。

看看您的logcat,您至少有兩個不同的桌面應用程序試圖連接到每個應用程序進程,這是「忽略第二個調試器」消息的來源。

如果您是用ADT插件運行Eclipse以及同時運行獨立DDMS,則會發生這種情況。我不知道你正在運行什麼或者netbeans插件是幹什麼的,但我會首先弄清楚你是否有兩種不同的東西爲控制而戰。

+0

謝謝,Eclipse同時運行的事實搞砸了調試器的連接。關閉Eclipse,這一切都按預期進行=) – Ted 2011-08-31 08:52:51

0

確保您已啓用在模擬器上爲您的應用程序進行調試。

+0

我該怎麼做?我認爲它已經開始,但我們可能不會談論同樣的事情。 – 2011-01-18 13:43:08