ubuntu下设置Android手机驱动
2023-09-14 08:56:59 时间
如果下面的文章不好使,建议读一这个文章:http://forum.xda-developers.com/xperia-u/general/howto-usb-connection-to-ubuntu-t1574551
以下内容有时候会导致,有的时候手机无法识别,请读上面的文章。
默认情况下 Ubuntu系统无法识别android手机。
运行 adb devices 将会出现一堆 ???号
在这种情况下你可以按照如下方法解决
1.首先查看你手机的ID号
在terminal下运行lsusb命令
再将手机连接上电脑
再次运行lsusb就会多出一个usb信息。该信息即为你手机的usb信息
Bus 002 Device 007: ID 18d1:4e21
PS:红色字体为手机的ID号,同一款手机的ID号是一样的。本人手机为(NS)
2 .创建配置文件
sudo vim /etc/udev/rules.d/XXX.rules
XXX为你自定义的文件名
输入以下 内容
SUBSYSTEM=="usb", SYSFS{"idVendor"}=="18d1", MODE="0666"
在红色字体的部分 添加上 你 自己手机的id
sudo chmod a+rx /etc/udev/rules.d/XXX.rules
sudo /etc/init.d/udev restart
3.重启adb服务(必须为sudo 已配置android环境变量)
sudo ./adb kill-server
sudo ./adb devices
给梦想一点时间
---------------------------------------------------------------------
you want MTP support on Ubuntu, try this:
- Connect Xperia S to an USB2 port.
- Use the "lsusb" command to list your devices in a terminal
One of the lines should look like this:
Code:Bus 002 Device 012: ID 0fce:5169 Sony Ericsson Mobile Communications AB
- Note your vendor- and product id. Usually this is "0fce" for the vendor and "5169" for the product id. If you have USB debugging disabled, product id will be "0169".
- unplug your phone
- read this thread: humans-enabled.com
Install the newest Version of "libmtp" and copy the 69-libmtp.rules file to /etc/udev/rules.d as described
- Edit: This step may not be necessary for you!
Xperia S support is implementet in the libmtp-1.1.3. release. If you use the newest version from sourceforge.net skip this and go to step 7.
type following to edit the copied file as root:Code:sudo gedit /etc/udev/rules.d/69-libmtp.rules
Code:# Sony Xperia S ATTR{idVendor}=="0fce", ATTR{idProduct}=="5169", SYMLINK+="libmtp-%k", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1" ATTR{idVendor}=="0fce", ATTR{idProduct}=="0169", SYMLINK+="libmtp-%k", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"
- reboot, or use
Code:sudo udevadm control --reload-rules
- Plug in your device to a USB2 port, it will mount automatically. Use nautlius to copy files around.
相关文章
- [Android]android自动化测试十六之calabash-android
- [Android Pro] android控件ListView顶部或者底部也显示分割线
- [Android Pro] Android权限设置android.permission完整列表
- 【黑马Android】(01)android简介/工程目录结构/拨号器/四种点击事件/后台偷偷发短信
- android sdutio常用快捷键
- 实用正则表达式扫描android SDcard的文件
- Android开发之旅: Intents和Intent Filters(实例部分)
- android电池信息简介
- Android自动测试之Monkey工具
- 我的android学习脚步----------- Button 和监听器setonclicklistener
- Android修行手册 - Toolbar实践
- Android应用程序窗口设计实现
- Android【报错】java.lang.ClassCastException: android.widget.TextView cannot be cast to android.widget.Bu
- 【Android笔记25】Android中的动画效果之逐帧动画
- android 常用JVM配置参数
- 管理Android通信录
- android camera(四):camera 驱动 GT2005
- Android设计模式之单例模式的七种写法
- Android audio切换设备通道流程(二十八)
- android 10设置hdmi分辨率输出驱动日志流程
- Android的报错提示:Failed to resolve: com.android.support:appcompat-v7:28.0.0
- Android Studio的xml布局界面预览怎么把大字母变小字母
- Android App层通过JNI从驱动获取Input Event