Ubuntu cannot identify OMS (ophone) mobile devices

Source: Internet
Author: User
(Insufficient permissions for device)

When you use commands such as ADB devices, a prompt is displayed.

Shily @ hh-desktop :~ $ ADB Shell
Error: insufficient permissions for Device
Shily @ hh-desktop :~ $ ADB Devices
List of devices attached
???????????? No Permissions

[Please read the updates below]
Somehow, the above error message is displayed when you connect to the development machine, and the permission is always incorrect.
Currently, the solution is to use the root permission to start the ADB server.
Shily @ hh-desktop :~ $Sudo-S
[Sudo] password for shily:
Root @ hh-desktop :~ #ADB kill-server; ADB start-Server
* Daemon not running. Starting it now *
* Daemon started successfully *
Root @ hh-desktop :~ #Exit
Exit
Shily @ hh-desktop :~ $
Execute ADB shell again.

However, this is not a solution, because this error is too frequent. during the development process, it is easy to execute ADB kill-server, and then switch to root to start ADB start-server.

This is the time when setuid takes effect.
Go to the directory where ADB is located
Shily @ hh-desktop :~ $Cd ~ /SDK/android-sdk_eng.sdk_linux-x86/tools
Shily @ hh-desktop :~ /SDK/android-sdk_eng.sdk_linux-x86/tools $Ls-l ADB
-Rwxr-XR-x 1 shily 341694 2010-05-11 05:46 ADB
Shily @ hh-desktop :~ /SDK/android-sdk_eng.sdk_linux-x86/tools $Sudo chown root: Root ADB
[Sudo] password for shily:
Shily @ hh-desktop :~ /SDK/android-sdk_eng.sdk_linux-x86/tools $Ls-l ADB
-Rwxr-XR-x 1 Root 341694 2010-05-11 05:46 ADB
Shily @ hh-desktop :~ /SDK/android-sdk_eng.sdk_linux-x86/tools $Sudo chmod U + S ADB
Shily @ hh-desktop :~ /SDK/android-sdk_eng.sdk_linux-x86/tools $Ls-l ADB
-Rwsr-XR-x 1 Root 341694 2010-05-11 05:46 ADB
Shily @ hh-desktop :~ /SDK/android-sdk_eng.sdk_linux-x86/tools $
In this way, no matter which user starts ADB with the root permission, no error is prompted.

======================================
During use, we found that the file owner permission of ADB pull is root: root, which is inconvenient to modify. However, I cannot download files and modify them frequently.

Important updates from 2010-06-21

When reading the SDK help documentation, I found that the SDK has provided instructions. In this way, you can avoid the File Permission of ADB pull being root.
For details, see Docs/GUIDE/developing/device.html.

If you're developing on Ubuntu Linux, you need to add a rules file that contains a USB configuration for each type of device you want to use for development. each device manufacturer uses a different vendor ID. the example rules files below show how to add
An entry for a single vendor ID (the HTC vendor ID). In order to support more devices, you will need additional lines of the same format that provide a different value for
SYSFS{idVendor}Property. For other IDs, see the Table
USB vendor IDs, below.

  1. Log in as root and create this file:/etc/udev/rules.d/51-android.rules.

    For gusty/hard, edit the file to read: [Note: Ubuntu 7.10 and later versions]
    SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"

    For dapper, edit the file to read: [Note: Ubuntu 6.06 and earlier versions]
    SUBSYSTEM=="usb_device", SYSFS{idVendor}=="0bb4", MODE="0666"

  2. Now execute:
    chmod a+r /etc/udev/rules.d/51-android.rules

Create a file in the/etc/udev/rules. d/directory as instructed.51-android.rules, change 0bb4 to the corresponding USB, and the supplier ID is enough.
For example, if my mobile phone is Motorola and idvender is
22b8
So this line is
SUBSYSTEM=="usb", SYSFS{idVendor}=="22b8", MODE="0666"
However, you can write multiple lines to use various devices. For example, if I write all the files, my files are as follows:
# ACS 0502
Subsystem = "USB", sysfs {idvendor} = "0502", mode = "0666"
# Dell 413c
Subsystem = "USB", sysfs {idvendor} = "413c", mode = "0666"
# Foxconn 0489
Subsystem = "USB", sysfs {idvendor} = "0489", mode = "0666"
# Garmin-Asus 091e
Subsystem = "USB", sysfs {idvendor} = "091e", mode = "0666"
# HTC 0bb4
Subsystem = "USB", sysfs {idvendor} = "0bb4", mode = "0666"
# Huawei 12d1
Subsystem = "USB", sysfs {idvendor} = "12d1", mode = "0666"
# Kyocera 0482
Subsystem = "USB", sysfs {idvendor} = "0482", mode = "0666"
# LG 1004
Subsystem = "USB", sysfs {idvendor} = "1004", mode = "0666"
# Motorola 22b8
Subsystem = "USB", sysfs {idvendor} = "22b8", mode = "0666"
# NVIDIA 0955
Subsystem = "USB", sysfs {idvendor} = "0955", mode = "0666"
# Pantech 10a9
Subsystem = "USB", sysfs {idvendor} = "10a9", mode = "0666"
# Samsung 04e8
Subsystem = "USB", sysfs {idvendor} = "04e8", mode = "0666"
# Sharp 04dd
Subsystem = "USB", sysfs {idvendor} = "04dd", mode = "0666"
# Sony Ericsson 0fce
Subsystem = "USB", sysfs {idvendor} = "0fce", mode = "0666"
# ZTE 19d2
Subsystem = "USB", sysfs {idvendor} = "19d2", mode = "0666"

However, according to the above IDs, none of them can be included. the usb id of one of my devices is not listed above.
You can easily use the lsusb command to view your USB ID
Shily @ hh-desktop :~ $ Lsusb
Bus 002 device 003: Id 413c: 2003 Dell Computer Corp. keyboard
Bus 002 device 002: Id 0461: 4d22 primax electronics, Ltd
Bus 002 device 001: Id 1d6b: 0001 Linux Foundation 1.1 root Hub
Bus 001 device 010: ID18a10002
Bus 001 device 001: Id 1d6b: 0002 Linux Foundation 2.0 root Hub
Find the ID above is18a1Add my device to the file.
Subsystem = "USB", sysfs {idvendor} = "18a1", mode = "0666"

Modify/etc/udev/rules.d/51-android.rulesYou do not need to restart the Linux machine. Just re-plug the device. Run ADB devices again to see that your device is connected.
Shily @ hh-desktop :~ $ ADB Devices
List of devices attached
0403502001011000 Device
Before that, what you see is
Shily @ hh-desktop :~ $ ADB Devices
List of devices attached
???????????? No Permissions

Important updates from 2010-07-28
If you see the log at system startup, you may pay attention to the following warning:
Udevd: sysfs {}= will be removed in a future udev version, please use ATTR instead.

Replace the above sysfs with ATTR:
For example:
# ZTE 19d2
Subsystem = "USB", sysfs {idvendor} = "19d2", mode = "0666"

Change

# ZTE 19d2
Subsystem = "USB", ATTR {idvendor} = "19d2", mode = "0666"

2010-09-06 update
If you are a developer and have many USB devices, you can use the following methods:
Clear51-android.rules: Add the following line once and for all (because I need to test several devices, it will be very troublesome to add one at a time ).
Subsystem = "USB", ENV {devtype} = "usb_device", mode = "0666"
I am not very clear about the specific meaning. I just wrote it by imitating 10-vboxdrv.rules. This is the udev rule file of virtualbox, because
Number starting with nameThe rules recorded in large files will overwrite the rules in files whose names start with numbers are small, so you need to set as many file names as possible, 51 is enough (I originally wanted to write10-vboxdrv.rules, which allows them to use a file but fails)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.