Android 开发Ubuntu下 adt 手机连接开发
2016-03-31 21:03
471 查看
环境:Ubuntu 13.04 64bit 第一步 安装配置ADB 首先需安装jdk并配置环境变量 1、下载sdk for linux http://developer.android.com/sdk/index.html 2、解压缩,并更新 cd ~/android-sdk-linux/tools ./andirod 3、配置环境变量 sudo gedit ~/.bashrc #set path for android sdk tools export PATH=$PATH:~/android-sdk-linux/tools/ export PATH=$PATH:~/android-sdk-linux/platform-tools/ 4、保存后,同步更新 source ~/.bashrc 5、直接运行adb的话会显示 adb devices * daemon not running. starting it now on port 5037 * * daemon started successfully * List of devices attached ???????????? no permissions 没有权限 5、关闭adb服务,切换到root,重启adb服务,离开root adb kill-server sudo su /home/m/android-sdk-linux/platform-tools/adb start-server exit 现在即可使用adb了 第二步 配置手机 Android Developer Tools Build: v22.2.1-833290 This product includes Eclipse Platform, JDT, CDT, EMF, GEF and WTP, all of which are Copyright (c) Eclipse contributors and others. Android Developer Tools are Copyright (c) The Android Open Source Project.( o; n7 y" Q. k$ I 问题描述:在terminal下输入adb devices显示不出设备,在eclipse中选择运行程序显示找不到设备,后来查些资料发现ubuntu下面连接设备需要一些特殊配置。 adb devices后只显示“List of devices attached”,不罗列设备,确定usb已经连上。如下图: |
解决方法:
1)在PC下找到文件 ~/.android/adb_usb.ini,若没有新建:vi ~/.android/adb_usb.ini。
2)添加idVender:echo "idVender" > ~/.android/adb_usb.ini,其中的idVebder是lsusb显示内容的ID后的前一个数值。注意:前面要加0x 。 如:echo "0x1d6b"
> ~/.android/adb_usb.ini 。
其中idVebder即经销商ID(Vendor ID)。
Google官方的VendorId 列表如下:
厂商名 厂商ID
Acer
0502
ASUS
0b05
Dell
413c
Foxconn
0489
等等……
如果不是的话需要得到设备的VendorId添加进去
在终端执行: lsusb 将会列出系统所有在用的usb端口信息,如果有很多的话需要自己根据后面的描述分辨。
bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
bus 002 Device 002: ID 80ee:0021 VirtualBox USB Tablet
bux 003 Device 003: ID 18d1:9025 Google Inc
因为我是用的虚拟机,所以有80ee:0021
VirtualBox USB Tablet
我的小米1手机的ID是ID
18d1:9025 Google Inc
3)确定echo添加的idVender已经生效:cat /root/.android/adb_usb.ini
4)连接usb后重启adb-server:
adb kill-server
adb start-server
5)(很重要)拔掉usb重新连上)
6)验证:adb devices
相关文章推荐
- Ubuntu 默认壁纸历代记
- Ubuntu Remix Cinnamon 20.04 评测:Ubuntu 与 Cinnamon 的完美融合
- 使用C++实现JNI接口需要注意的事项
- Android IPC进程间通讯机制
- Android Manifest 用法
- [转载]Activity中ConfigChanges属性的用法
- Android之获取手机上的图片和视频缩略图thumbnails
- Android之使用Http协议实现文件上传功能
- Android学习笔记(二九):嵌入浏览器
- android string.xml文件中的整型和string型代替
- i-jetty环境搭配与编译
- android之定时器AlarmManager
- android wifi 无线调试
- Android Native 绘图方法
- Android java 与 javascript互访(相互调用)的方法例子
- 关于Ubuntu 11.10启动提示waiting for the network configuration的问题
- 在 Ubuntu 桌面中使用文件和文件夹