android开发真机调试


1. 设置android手机为USB调试模式。方法: menu -> 设置 -> 应用程序 -> 开发 -> 选择"USB调试"
2. 连接手机和电脑,在windows下执行adb devices, 查看是否已经连接成功。
3. 设置应用程序为调试模式。方法:编辑AndroidManifest.xml ,增加调试参数android:debuggable="true", 如下:
<application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true">
4. 执行真机调试操作:eclipse调试对话框中,Target窗口中选择Manual,点击 debug 按钮,选择真机设备,开始调试。Android软件发生异常,可以在命令行窗口下查看具体信息。
执行:./adb logcat 可以查看到更多的系统异常消息,注意Caused by打头的行,这些行指明了哪行代码出现错误。


你可能感兴趣的:(eclipse,android,windows,application,手机,menu)