ubuntu无法识别android手机
2014-05-31 14:33
246 查看
Ubuntu
下Android adb devices显示no permission
With an Android-powered device, you can develop and debug your Android applications just as you would on the emulator. Before you can start, there are just a few things to do:
Declare your application as "debuggable" in your Android Manifest.
In Eclipse, you can do this from the Application tab when viewing the Manifest (on the right side, set Debuggable to true). Otherwise,
in the
Turn on "USB Debugging" on your device.
On the device, go to the home screen, press MENU, select Applications > Development, then enable USB
debugging.
Setup your system to detect your device.
If you're developing on Windows, you need to install a USB driver for adb. See the Windows USB Driver documentation.
If you're developing on Mac OS X, it just works. Skip this step.
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 the
For other IDs, see the table of USB Vendor IDs, below.
Log in as root and create this file:
For Gusty/Hardy, edit the file to read:
For Dapper, edit the file to read:
Now execute:
You can verify that your device is connected by executing
If connected, you'll see the device name listed as a "device."
If using Eclipse, run or debug as usual. You will be presented with a Device Chooser dialog that lists the available emulator(s) and connected device(s). Select the device upon which you want to install and run the
application.
If using the Android Debug Bridge (adb), you can issue commands with the
to target your connected device.
This table provides a reference to the vendor IDs needed in order to add USB device support on Linux. The USB Vendor ID is the value given to the
file, as described in step 3, above.
-------------------------------------------------------------------------------------------------------------
My shiny new Google Nexus One wasn’t connecting properly over USB to my Ubuntu 9.10 (Karmic) notebook using the Android SDK. Here’s how I fixed it.
After a few days of debating whether or not to buy a Nexus One, I finally gave in a bought one. Rachael ended up getting a Droid Eris (Verizon) for Christmas, so in the course of a few weeks I gained access to two fantastic Android-powered phones. I had been
compiling a list of mobile application ideas and the fact that I now have the hardware to test on motivated me to start looking into Android development.
After getting the Android SDK setup I needed to connect my N1 and push an application to it for testing on real hardware. I found some Android
documentation that discussed connecting up an Android device over USB. However, after following the steps on this page, I was still seeing strange output when running
This led to some searching which turned up a blog post. Basically, the Google
Android team hasn’t added the Vendor ID for the Nexus One. Apparently HTC’s USB Vendor ID isn’t correct. So, I followed these steps to fix it:
Create/edit a udev rules file:
Add the following line to this file:
(Note the vendor ID of 18D1. This was changed from the HTC vendor code of 0BB4.)
Restart udev using either
or
Connect your Nexus One.
Run
and you should see something like
Hopefully Google updates the documentation to include the Vendor ID 18D1 rather than making us hunt for this number ourselves. Enjoy!
--------------------------------------------------------------------------------------------------------------------
下Android adb devices显示no permission
Setting up a Device for Development
With an Android-powered device, you can develop and debug your Android applications just as you would on the emulator. Before you can start, there are just a few things to do:Declare your application as "debuggable" in your Android Manifest.
In Eclipse, you can do this from the Application tab when viewing the Manifest (on the right side, set Debuggable to true). Otherwise,
in the
AndroidManifest.xmlfile, add
android:debuggable="true"to the
<application>element.
Turn on "USB Debugging" on your device.
On the device, go to the home screen, press MENU, select Applications > Development, then enable USB
debugging.
Setup your system to detect your device.
If you're developing on Windows, you need to install a USB driver for adb. See the Windows USB Driver documentation.
If you're developing on Mac OS X, it just works. Skip this step.
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 the
SYSFS{idVendor}property.
For other IDs, see the table of USB Vendor IDs, below.
Log in as root and create this file:
/etc/udev/rules.d/51-android.rules.
For Gusty/Hardy, edit the file to read:
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
For Dapper, edit the file to read:
SUBSYSTEM=="usb_device", SYSFS{idVendor}=="0bb4", MODE="0666"
Now execute:
chmod a+r /etc/udev/rules.d/51-android.rules
You can verify that your device is connected by executing
adb devicesfrom your SDK
tools/directory.
If connected, you'll see the device name listed as a "device."
If using Eclipse, run or debug as usual. You will be presented with a Device Chooser dialog that lists the available emulator(s) and connected device(s). Select the device upon which you want to install and run the
application.
If using the Android Debug Bridge (adb), you can issue commands with the
-dflag
to target your connected device.
USB Vendor IDs
This table provides a reference to the vendor IDs needed in order to add USB device support on Linux. The USB Vendor ID is the value given to the SYSFS{idVendor}property in the rules
file, as described in step 3, above.
Manufacturer | USB Vendor ID |
---|---|
Acer | 0502 |
Dell | 413c |
Foxconn | 0489 |
Garmin-Asus | 091E |
HTC | 0bb4 |
Huawei | 12d1 |
Kyocera | 0482 |
LG | 1004 |
Motorola | 22b8 |
Nvidia | 0955 |
Pantech | 10A9 |
Samsung | 04e8 |
Sharp | 04dd |
Sony Ericsson | 0fce |
ZTE | 19D2 |
My shiny new Google Nexus One wasn’t connecting properly over USB to my Ubuntu 9.10 (Karmic) notebook using the Android SDK. Here’s how I fixed it.
After a few days of debating whether or not to buy a Nexus One, I finally gave in a bought one. Rachael ended up getting a Droid Eris (Verizon) for Christmas, so in the course of a few weeks I gained access to two fantastic Android-powered phones. I had been
compiling a list of mobile application ideas and the fact that I now have the hardware to test on motivated me to start looking into Android development.
After getting the Android SDK setup I needed to connect my N1 and push an application to it for testing on real hardware. I found some Android
documentation that discussed connecting up an Android device over USB. However, after following the steps on this page, I was still seeing strange output when running
adb devices:
List of devices attached ???????????? no permissions
This led to some searching which turned up a blog post. Basically, the Google
Android team hasn’t added the Vendor ID for the Nexus One. Apparently HTC’s USB Vendor ID isn’t correct. So, I followed these steps to fix it:
Create/edit a udev rules file:
sudo vim /etc/udev/rules.d/51-android.rules
Add the following line to this file:
SUBSYSTEM=="usb", SYSFS{idVendor}=="18D1", MODE="0666"
(Note the vendor ID of 18D1. This was changed from the HTC vendor code of 0BB4.)
Restart udev using either
sudo reload udev
or
sudo service udev reload
Connect your Nexus One.
Run
adb devices
and you should see something like
List of devices attached ############ device
Hopefully Google updates the documentation to include the Vendor ID 18D1 rather than making us hunt for this number ourselves. Enjoy!
--------------------------------------------------------------------------------------------------------------------
相关文章推荐
- ubuntu 14.04 adt-bundle 无法识别android手机的解决方法
- ubuntu中eclipse无法识别android手机问题
- ubuntu下链接手机调试android程序,ADB无法识别手机
- ubuntu中eclipse无法识别android手机问题
- Ubuntu下Android手机无法识别进入调试问题解决方法
- Ubuntu日记——ubuntu中无法识别android手机问题
- Ubuntu系统无法识别android手机
- ubuntu下链接手机调试android程序,ADB无法识别手机
- ubuntu android开发无法识别手机设备的解决方案
- ubuntu无法识别android手机,出现????????
- 【Linux】Android手机在Ubuntu上无法被adb识别解决办法(权限相关)
- ubuntu下无法识别android手机
- ubuntu中eclipse无法识别android手机问题
- ubuntu中eclipse无法识别android手机问题
- ubuntu中eclipse无法识别android手机问题
- ubuntu中eclipse无法识别android手机问题
- ubuntu中eclipse无法识别android手机问题
- ubuntu中eclipse无法识别android手机问题
- Ubuntu配置Android开发环境无法连接手机
- 在ubuntu下进行adnroid应用开发时,手机无法识别,显示为??????????的解决方法