、eclipse上调试android里的程序。
先执行:
cd android源码目录
. build/envsetup.sh
lunch 1 # to build the emulator
emulator & # you should see a GUI picture of a phone
ddms & # you should get a splufty debugging console
然后在eclipse中配置调试类型和端口:
在Run->Debug Configurations->Remote java application上双击,然后,”Host:”设为localhost,”Port:”设为8700,”Connection Type”为Standard(Socket Attach)
然后“Apply”
注意,在点击”Debug”时苦出错,说8700端口被占用,那么把DDMS程序关掉,重新打开DDMS就OK了。如果提供连不到VM错误时,请注意,要先在DDMS中选中某一进程(对应某一应用程序),才能在eclipse执行 Debug。
在eclipse调试时,可以设断点、单步调试。估计google团队也是这样开发、调试android应用程序的
先执行:
cd android源码目录
. build/envsetup.sh
lunch 1 # to build the emulator
emulator & # you should see a GUI picture of a phone
ddms & # you should get a splufty debugging console
然后在eclipse中配置调试类型和端口:
在Run->Debug Configurations->Remote java application上双击,然后,”Host:”设为localhost,”Port:”设为8700,”Connection Type”为Standard(Socket Attach)
然后“Apply”
注意,在点击”Debug”时苦出错,说8700端口被占用,那么把DDMS程序关掉,重新打开DDMS就OK了。如果提供连不到VM错误时,请注意,要先在DDMS中选中某一进程(对应某一应用程序),才能在eclipse执行 Debug。
在eclipse调试时,可以设断点、单步调试。估计google团队也是这样开发、调试android应用程序的