您好,欢迎来到华佗小知识。
搜索
您的当前位置:首页Android API文档关联与真机调试

Android API文档关联与真机调试

来源:华佗小知识


Eclipse 代码自动提示功能

打开Eclipse 中的 windows->preferences->java->Editor-->Content Assist

将Auto activation delay 设置为50以下的数值

Auto activation triggers for java 设置为:”.abcdefghijklmnopqrstuvwxyz(“ 第三个选项默认不变,然后点击OK。

Eclipse关联Android API doc文档

一、右键任意一个项目,打开属性:

二、打开左边的Java Build Path ,右边这里点击Libraries ,在下面的android2.2 里依次打开定位到javadoc location ,双击它:

1

三、在 Javadoc location path 的右边,点击Brosse,选择你的android SDK的/docs/reference/文件夹,点击ok。

Ubuntu Linux中连接Android真机调试

Ubuntu下调试Android手机的方法,以我的 moto mb525 (Defy)为例,具体步骤如下: 一、通过以下操作将手机设置为USB调试模式 设置——>应用程序——>开发——>USB调试 二、查看手机的usb信息 输入:lsusb,可以看到类似输出 kingarthur@ubuntu:~$ lsusb

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 001 Device 003: ID 046d:c52f Logitech, Inc. Wireless Mouse M305 Bus 001 Device 004: ID 058f:b002 Alcor Micro Corp. Bus 002 Device 003: ID 15d9:0a4f Trust International B.V. Bus 001 Device 005: ID 22b8:428c Motorola PCS

2

lsusb命令是列出当前所有得usb设备,我的defy就是 Bus 001 Device 005: ID 22b8:428c Motorola PCS 三、添加udev规则

udev就是一个动态硬件管理服务 cd /etc/udev/rules.d/ sudo gedit 50-Android.rules

或者 sudo gedit /etc/udev/rules.d/50-Android.rules 根据实际的usb信息添加如下内容,然后保存

SUBSYSTEM==\"usb\

其中,sysfs括号内是自己Android手机的实际描述信息,==后面的是id号,mode是读取模式,0666是所有人可以访问,以上的信息都是lsusb查处来的。 四、设置规则文件权限并重启udev规则

sudo chmod a+rx /etc/udev/rules.d/50-Android.rules sudo /etc/init.d/udev restart 会看到udev相关的提示信息

Rather than invoking init scripts through /etc/init.d, use the service(8) utility, e.g. service udev restart

Since the script you are attempting to invoke has been converted to an Upstart job, you may also use the stop(8) and then start(8) utilities, e.g. stop udev ; start udev. The restart(8) utility is also available. udev stop/waiting

udev start/running, process 7665

3

五、设置adb

切换到android sdk的platform-tools目录下, kingarthur@ubuntu:~$

/home/kingarthur/Work/android-sdk-linux_x86/platform-tools 重启adb服务,再输入adb devices就应该能找到设备了。

kingarthur@ubuntu:~/Work/android-sdk-linux_x86/platform-tools$ sudo ./adb kill-server

kingarthur@ubuntu:~/Work/android-sdk-linux_x86/platform-tools$ start-server

kingarthur@ubuntu:~/Work/android-sdk-linux_x86/platform-tools$ sudo ./adb devices

* daemon not running. starting it now on port 5037 * * daemon started successfully * List of devices attached 016B23BC0901901F device

这样就可以在eclipse中的DDMS来调试android真机了,有些步骤是需要root权限的。

./adb cd

4

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- huatuo0.cn 版权所有 湘ICP备2023017654号-2

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务