I am trying to debug a SipDemo SDK sample. However, the DDMS is not able to hook into Application run on the emulator (Android 4.0 API Level 14). The emulator waits for debugging, and eclipse debugger is not able to open the port. Also, ddms reports VM Debug port could not be opened.
Confirmed the following,
- The Port is not being used
- ADB Server/Eclipse/Machine was restarted
- Host file checked for 127.0.0.1
- Preferences checked to select 127.0.0.1 as ADBHOST
- Selected the appropriate VM for Android 4.0
- Using Comodo Firewall, so tried debugging after disabling the firewall.
There is a discrepancy in the port that the application expects and the port that is being used by debugger. Is one for the Android OS and one for the actual host running the IDE?
Images & Logs
Device Process Window
http://imageshack.us/photo/my-images/94/androiddebugging.png
VM Debug Port Error (on start of Eclipse)
http://imageshack.us/photo/my-images/820/vmdebugport8700.png
LogCat View
05-16 14:46:20.547: W/ActivityThread(1094): Application com.example.android.sip is waiting for the debugger on port 8100...
Console
[2012-05-16 10:46:17 - SipDemo] Android Launch!
[2012-05-16 10:46:17 - SipDemo] adb is running normally.
[2012-05-16 10:46:17 - SipDemo] Performing com.example.android.sip.WalkieTalkieActivity activity launch
[2012-05-16 10:46:17 - SipDemo] Automatic Target Mode: Preferred AVD 'Android40' is available on emulator 'emulator-5554'
[2012-05-16 10:46:18 - SipDemo] Application already deployed. No need to reinstall.
[2012-05-16 10:46:18 - SipDemo] Starting activity com.example.android.sip.WalkieTalkieActivity on device emulator-5554
[2012-05-16 10:46:20 - SipDemo] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.android.sip/.WalkieTalkieActivity }
[2012-05-16 10:46:20 - SipDemo] Attempting to connect debugger to 'com.example.android.sip' on port 8630
[2012-05-16 10:46:40 - SipDemo] Launch error: Failed to connect to remote VM. Connection timed out.
Testing SIP Applications
To test SIP applications, you need the following:
A mobile device that is running Android 2.3 or higher. SIP runs over wireless, so you must test on an actual device. Testing on AVD won’t work.
A SIP account. There are many different SIP providers that offer SIP accounts.
If you are placing a call, it must also be to a valid SIP account.
To test a SIP application:
On your device, connect to wireless (Settings > Wireless & networks > Wi-Fi > Wi-Fi settings)
Set up your mobile device for testing, as described in Developing on a Device.
Run your application on your mobile device, as described in Developing on a Device.
If you are using Eclipse, you can view the application log output in Eclipse using LogCat (Window > Show View > Other > Android > LogCat).
http://developer.android.com/guide/topics/connectivity/sip.html