Debugging in Eclipse with real Android phone on Ubuntu 10.10 - android

I can't get adb to recognising my HTC Desire on my new upgrade of Ubuntu 10.10 Maverick Meerkat.
adb devices shows
List of devices attached
???????????? no permissions
Now, there are plenty of tutorials for changing rule files under /etc/udev/rules.d/.
However, I cannot find one specific for 10.10.
Can anyone tell me whether the rule file name and content is the same as described at link text, or are we looking at some new settings for this new release?
Many thanks

On Linux Mint/Ubuntu 11.04 with a Samsung Galaxy S2, I didn't use any rules, but when "reset adb" or when "Devices view" it shows:
???????????? no permissions
I had to :
sudo killall adb # if I don't, I get "error: insufficient permissions for device"
sudo ./adb usb
Then I was able to take screenshots following this tutorials: http://www.addictivetips.com/mobile/how-to-take-screenshots-of-android-device/
Cheers

My magic spell for Ubuntu 11.04:
$killall adb
$sudo adb usb
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
restarting in USB mode
Then go to eclipse and start debugging on real device

Ok I am a little late to the party but here is another approach...
Create a file called 51-android.rules in /etc/udev/rules.d with the following contents
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666", GROUP="plugdev"
Then run the following command to reload the udev rules ...
udevadm control --reload-rules
Now plug in your galaxy S2 mobile phone into the computer's USB port and run adb devices.
NOTE: You will need to change the vendor id (highlighted in bold) to match your phone's vendor id (in the OP's case it should be 0bb4 for HTC)

Okay, I guess the tutorials work, I created both 70-android.rules and 51-android.rules, re-typed them again (get rid of the funny quotes when you copy from the web).
Restart
And now it is recognised!

On windows, I had to download a Special App from HTC in order to get the proper USB drivers to connect to my Evo. The app in question allows you to synch your outlook contacts/calendar (weee...) with those on your phone. I rather doubt there's something similar available for ubuntu/Linux.
I strongly suspect you're up against a similar situation. The standard USB drivers don't work with HTC phones, so you need Something Else.
If this is something that stopped working with the upgrade, you'll need to take a close look at any USB-related changes.
Good luck.

Hi all i am very frustrated by checking all sides
But one day i got the solution of this problem pls follow the following steps
First open your device terminal
1)on the top left hand corner in Application ->Accessories->terminal
2) on terminal window type following commands
$ sudo su then press enter after that terminal want password which is set by you
in installation or giving at the time of logging.
$<Enter password> password is not shown but it is type internally you can just type
whole password
$ mkdir ~/.android
$vi ~/.android/adb_usb.ini
press ctri+z here
$ echo "0x0451" > ~/.android/adb_usb.ini
$cat /root/.android/adb_usb.ini
$sudo mount -t usbfs none /proc/bus/usb
$cd path of android sdk tools from home
like /home/tv-014/Desktop/newandroid/android-sdk-linux/platform-tools
in my system i have put android-sdk-linux at desktop and in it one platform-tools
folder contain the adb.exe file
so after cd command we have the path from home to platform-tools folder.
$ ./adb kill-server
$ ./adb start-server
$ ./adb devices
Now you got the list of devices attach to your systems.

Related

Android ADB devices unauthorized

Configuration:
Windows 8.1
ADB version: 1.0.32
Smartphone: Oneplus One
Problem
I installed the Samsung drivers as it is said to do. When I run the ADB devices command, it said unauthorized.
Already tried:
I've done everything that'd been said on this post: https://stackoverflow.com/a/25546300/1848376
But the problem is that I don't get a prompt on the phone to tell me I must accept the connection.
When I run the command adb shell, here is the answer:
error: device unauthorized.
This adbd's $ADB_VENDOR_KEYS is not set; try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.
I did "adb kill-server", but it didn't change anything. Why?
Try Revoke USB DEBUGGING Authorization.
Enable USB debugging again.
It worked.
Thankgod xda developers exist : http://forum.xda-developers.com/verizon-lg-g3/help/unable-to-access-adb-t2830087
Just had to delete adbkey file in C:Users/$Name/.android adbkey.pub was missing.
Restart after this and both files are there.
If this does not work :
- Try Revoke USB DEBUGGING Authorization.
- Enable USB debugging again.
In sequence:
adb kill-server
in your DEVICE SETUP, go to developer-options end disable usb-debugging
press REVOKE USB debugging authorizations, click OK
enable usb-debugging
adb start-server
I removed the following files from the ~/.android folder:
adbkey
adbkey.pub
I disabled and enabled ADB within device and now it works...
in Developer options,
Enable USB debugging.
Give a authorization.
(if there is no a Developer option menu, you have to click 3 times build number of Phone State menu to be developer. you can sse a developer option menu.)
Delete existing adbkeys
OR
Rename adbkeys
Best practise is to rename the keys because it provides backup.
cd ~/.Android
mv adbkey adbkey2
mv adbkey.pub adbkey.pub2
Next stop & start the server
cd ~/Android/Sdk/platform-tools
Locate the device
/Android/Sdk/platform-tools$ ./adb devices
/Android/Sdk/platform-tools$ ./adb kill-server
/Android/Sdk/platform-tools$ ./adb start-server
Then, stop the emulator Open AVD manager, click on the down arrow, then click on wipe data
Restart the emulator. Then everything works fine :)
This worked for me
1- Go to ~/.android/ and remove “adbkey”
2- Disconnect USB connection
3- adb kill-server
4- Revoke USB debugging authorizations (in developer option)
5- Reconnect the device to the Ma
6- adb devices
Try this uncheck the "verify apps via USB" in developer options and then turn on and off the "USB Debugging". It works with me.
Ensure that you have accepted the pressed the "ok" button when it is asking it is showing the fingerprint of the device after connecting through usb to your PC.
In Android studio, Run menu > Run shows OFFLINE ... for the connected device.
Below is the procedure followed to solve it:
(Read the below note first) Delete the ~/.android/adbkey (or, rename to ~/.android/adbkey2, this is even better incase you want it back for some reason)
Note: I happened to do this step, but it didn't solve the problem, after doing all the below steps it worked, so unsure if this step is required.
Run locate platform-tools/adb
Note: use the path that comes from here in below commands
Kill adb server:
sudo ~/Android/Sdk/platform-tools/adb kill-server
You will get a Allow accept.. message popup on your device. Accept it. This is important, which solves the problem.
Start adb server:
sudo ~/Android/Sdk/platform-tools/adb start-server
In Android studio, do Run menu > Run again
It will show something like Samsung ... (your phone manufacture name).
Also installs the apk on device correctly this time without error.
Hope that helps.
None of the methods listed on this page worked for me; specifically:
I had an issue where the Settings app would crash when selecting Revoke USB debugging authorizations
I was running LineageOS 14 x86_64
I was using ADB over network
The /data/misc/adb contained no adb_keys file
Removing my local ~/.android/adbkey did not help either
I had root access from the local terminal
I was not getting any confirmation dialog
adb: error: failed to get feature set: device unauthorized.
This adb server's $ADB_VENDOR_KEYS is not set
Try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.
- waiting for device -
In the end, I found a very useful post here that suggested to manually put the contents of ~/.android/adbkey.pub inside the /data/misc/adb/adb_keys file.
They suggested one of these two methods:
From another working device, copy the adb_keys file into your computer:
# On the other Android device
cp /data/misc/adb/adb_keys /sdcard
# From your computer
adb pull /sdcard/adb_keys .
Then put the working adb_keys file into the problematic Android device's sdcard (using Web or MTP) named as adb_keys, then copy the file into the correct path:
# On the problematic device
cp /sdcard/adb_keys /data/misc/adb/adb_keys
The other method is to simply copy your machine's adbkey.pub from the ~/.android/ directory, and put it into the problematic Android device's sdcard (using Web or MTP) named as adb_keys, then copy the file into the correct path:
# On the problematic device
cp /sdcard/adbkey.pub /data/misc/adb/adb_keys
(Note: there's a similar answer on SO that goes into further details for this method.)
Since I was running a web server on my computer, and I had curl installed on Android, I su'ed from the terminal and ran the following on my Android device:
cd /data/misc/adb
curl 192.168.1.35:8080/adbkey.pub > adb_keys
Killed the adb daemon (using adb kill-server) and BAM! The adb shell worked fine, like it should have been from the beginning.
Hopefully, the method described here works for you as it did for me.
First Remove the adbkey and adbkey.pub from the .android directory in your Home directory.
Make .android directory in your home with 710 permissions: $ chmod 710 .android/ and ownership as: chown -R <user>:<user> .android/. Ex:
$ chmod 710 .android/
$ chown -R ashan:ashan .android/
Go to developer options in your mobile and tap option Revoke USB debugging authorizations
Turn off all USB Debugging and Developer Options in the device and disconnect the device from your machine.
Connect the device again and at first turn on the Developer Options. Then Turn on the USB debugging.
At this point in your mobile, you will get a prompt for asking permission from you. Note: you must check the checkbox always accept from this …. option and click ok.
Now in you machine, start the adb server: adb start-server.
Hopefully when you issue the command: adb devices now, you will see your device ready authorized.
I was hit by this problem, too. I'm using my custom build of AOSP on Nexus 5X. I've added a single line in build/core/main.mk:
diff --git a/core/main.mk b/core/main.mk
index a6f829ab6..555657539 100644
--- a/core/main.mk
+++ b/core/main.mk
## -362,6 +362,8 ## else # !enable_target_debugging
ADDITIONAL_DEFAULT_PROPERTIES += ro.debuggable=0
endif # !enable_target_debugging
+ADDITIONAL_DEFAULT_PROPERTIES += ro.adb.secure=1
+
## eng ##
ifeq ($(TARGET_BUILD_VARIANT),eng)
Now adb shell works fine
Those materials are useful (Chinese articles): http://www.voidcn.com/blog/kc58236582/article/p-6335996.html, http://blog.csdn.net/fanmengke_im/article/details/28389439
Try deleting the adbkey file from C/.android folder
and then run the commands as
mentioned above i.e.
adb kill-server, adb start-server and adb devices
.
Your app is being detected as some harmful program.
Turn off "Verify apps over USB" option. It's in the same view as "USB debugging".
All you need is to authorize debug mode.
1. make sure your Device is connected to your PC.
2. Allow authorized for debug mode via Android-Studio by going to
Run -> Attach debugger to Android process
than you will see the pop up window for allow debug mode in your Device, press OK. done.
i hope it help to someone.
I had the same problem after reinstalled my android studio. Here's what I did to make my adb work again:
-path to C:\Users\User\AppData\Local\Android\sdk\platform-tools
-Shift+r.click and start command from here instead.
for anyone encountering this later this may also help. I encountered this exact issue trying to use adb from a user command prompt and the answers above did not help, but the problem went away with an "adb kill-server" when running in an administrator command prompt.
This worked for me:
rm ~/.android/adbkey.pub
sudo ./adb kill-server
sudo ./adb start-server
sudo ./adb -s emulator-5554 install ~/apk_to_install.apk
I'm not sure if is a good idea run adb with sudo privileges,but it was the only way I get it works. Regards.
I got this as root when as a non-root user I was getting permissions errors trying to connect to custom recovery (Philz). so I killed adb server, copied the .android subdirectory of my user account into /root, chowned -R to root.root, and restarted adb server. I'm in!
Disconnect USB between PC and device
Stop adb server by entering "adb kill-server" in command window
On device use "Revoke USB debugging authorizations" in "Developer Options"
On PC delete "adbkey" file in user directory, for example "C:\Users\Amit\.android"
Reconnect the device to the PC
Open a command window and enter "adb devices". Watch the device's screen for any Authorization message and allow the connection.
I suppose you have enabled On-device Developer Options in your smartphone? If not you can take a look at the steps provided by Android, http://developer.android.com/tools/device.html#developer-device-options
For FIRE STICK 4K it actually says in the dialog:
Otherwise check for a confirmation dialog on your device
Indeed on the TV in the other room there was a confirmation dialog. Doh'!
I had this problem and it wasnt solved by the deleting of any keys (at least deleting them didnt fix it, maybe had an effect after i did fix it though)
I actually had a discrepancy between my sdk-tools version and my Android Studio version. After updating my tools it still didnt work, but after updating AS (to 1.4) everything worked fine again.
Always update both sdk-tools and AS version together ;)

adb: device not found

I'm trying to build a Kivy app on my Android phone using Buildozer. But adb is not finding my device. This is the error I am getting:
dan#dan-asus:~/kivy$ adb usb
error: device not found
dan#dan-asus:~/kivy$ adb devices
List of devices attached
I've added my vendor and product id that I got from lsusb in my /lib/udev/rules.d/70-android-tools-adb.rules file as so:
# Lenovo A789
SUBSYSTEM=="usb", ATTR{idVendor}=="17ef", ATTR{idProduct}=="7497", MODE="0666", OWNER="dan", TAG+="uaccess"
Have two 1.1 and two 2.0 USB outlets. Tried all four of them. Made sure I restarted adb every time I made a change and even tried to reboot my phone a few time.
What am I missing?
adb version is 1.0.31
I know this should be a comment, but I don't have enough reputation for that... so here is my "answer".
I can think of a couple of things that you don't mention specifically in your question:
Do you have a file ~/.android/adb_usb.ini? If yes, is the vendor ID written there? (in your case should be 0x17EF in a single line). Try with that and restart your ADB server.
Is ADB enabled in your device? You can check that with lsusb -v -d 17ef:7497 | grep -B 3 -i iInterface and look for some interface with class 255, subclass 66, protocol 1. That's your ADB USB interface in the device, if you don't find it, check the device's settings/configuration.
Hope it helps.

Insufficient permissions for device in Android Studio Workspace running in openSUSE 13.2

I have a rooted Motorola Defy+ running a Cyanogenmod v11 custom ROM (nightly build) created by Quarx. Using Android Studio Workspace,(ASW) v.1.1.0, when I try and debug on this device, I get
????????????[null]
listed in the Choose Device window, with the Logcat window showing
insufficient permissions for device
I would really like to use this device and ROM for debugging purposes.
When I enter lsusb from the command line I get,
Bus 002 Device 002: ID 22b8:431d Motorola PCS
This is the correct device id for Motorola units. I have installed 51-android.rules and 71-android.rules in /etc/udev/rules.d/ with the correct Motorola ids in these files.
I've also tried Revoke USB debugging authority, from Developer Options on the device, with no luck.
I have not tried running ASW as root hoping that there might be another option; is there?
Update: I was able to get in and access ADB by
uvachem-gsmith2:/home/greg/Android/Sdk/platform-tools # ./adb
I then did a kill server, did an SU to root user and restarted the server. I then tried to connect to the device from Android Studio. Got a message on the device about accepting the RSA key from the PC, said "Yes" and then was able to deploy the app to the device. So back to my original question, Is there another way to access this device without logging in as root? It seems as if there is a permission issue on the phone file system that is preventing this...
Update #2 The core problem here was a permission thing. Even though running ADB as root will allow access to the rooted Android device, a better solution is to change permissions in the udev file for this device...resetting 664 to 666, (see answer below). This allows the PC to access the file system on the device.
I had this while using a Linux machine with a Nexus 4 running Android 5.1
The fix was to enable both 'debug over USB' and 'connect as MTP'. The opposite is true when using the same device and Android Studio and adb on OSX though - to allow Android Studio to recognise the handset, I need to disable 'connect as MTP'.
I found a simple answer that worked for me:
adb kill-server
sudo adb start-server
sudo adb devices
You will find your device then.
Reference: http://itsfoss.com/fix-error-insufficient-permissions-device/
It's simple.
Just change your USB mode to File Transfer mode then it works.
Android 8
MTP is no longer available. On my android 8 "Transfer Files" option did not work.
"Transfer photos PTP" Is worked, and Studio showed the device name.
Steps on your cell phone
Open the developer options
Enable USB debugging.
change USB connection to PTP
Steps on Linux
on console run sudo usermod -aG plugdev $LOGNAME
Android 9
With Android 9 use the option File Transfer.
Changing permissions in this line from /etc/udev/rules.d/51-android.rules,
#Motorola
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0664", GROUP="plugdev"
to,
#Motorola
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666", GROUP="plugdev"
resolves this issue in a manner that DOES NOT require running adb as root.
IN my phone Symphony W75,
in option USB computer connection-> selecting Connect as Media device(MTP) has solved the problem.
Long to short,
I had the same problem with a Prestigio PMP5570C tablet,
all you have to do is to confirm on your tablet that you want to copy data to/from your computer (what i forgot), and add the 2 lines that #portsample wrote.
You can find the idVendor of your device typing
lsusb
in UBUNTU 12.04, then you get:
Bus 001 Device 011: ID 2207:0010,
where 2207 is your vendor id.
Summed up the question and answer...
I updated my device (Nvidia Shield) that was previously connecting fine, so I knew that the PC setup is correct already. The developer settings seem to have a new layout on Android 7.0.
It is under Settings > Preferences > Developer options > Networking > Select USB configuration
Here, I needed to select PTP and everything works fine again:
Enable USB debugging
Use USB to transer file
This procedure solves the problem for me:
- On the Android device, drag the top menu and select "USB for file transfer"
- Press "Run" again
Go to Developer Options -> Default USB Configurations and Change to PTP
Run these two commands in terminal
sudo adb kill-server
sudo adb start-server
Should Work!
I made a script for this error. For me it works fine in Fedora 28, but it should work in many Linux distributions.
Just create a file with the content of the selfexpanied script. I called it usbDebbugingAndroidStudio.sh
Give him execution permission with: chmod +x usbDebbugingAndroidStudio.sh
And run it: sudo ./usbDebbugingAndroidStudio.sh
After that check the list displayed by the command lsusb and introduce the Id of
your device.
For example:
My output was: Bus 006 Device 002: ID 05c6:9091 Qualcomm, Inc.
So I type 05c6 and press enter.
The script:
#!/usr/bin/env bash
#This script configure Android Debug Bridge permissions to solve the following
#error: com.android.ddmlib.AdbCommandRejectedException: insufficient permissions for device
#This error is produced when you try to install an APK from Android Studio in your device.
#You can check the vendorId here:
#https://developer.android.com/studio/run/device#setting-up
#If your device's brand isn't listed check the info displayed by the command lsusb
lsusb
#My output was:
#Bus 006 Device 002: ID 05c6:9091 Qualcomm, Inc.
#The id for this line is 05c6
echo -n "Enter the id of your mobile device: "
read usbProviderId
cd /etc/udev/rules.d/
sudo touch 51-android.rules
(
sudo cat << _EOF_
SUBSYSTEM=="usb", ATTR{idVendor}=="$usbProviderId", MODE="0666", GROUP="plugdev"
_EOF_
) | sudo tee 51-android.rules
#Give read and write permissions to the file
sudo chmod a+r /etc/udev/rules.d/51-android.rules
#Kill the Android Debug Bridge server to restart it
cd $HOME/Android/Sdk/platform-tools
sudo ./adb kill-server
#If this still doesn't work unplug the usb cable and connect again.
#And repeat the last step Kill the ADB server.
What the F... ! :)
Note : I have seen it on android 8.1 on a One+5t...
Even we do all of above, it is necessary to make something on your android device .. in addition to go in dev options menu (usb debug) (don't hesitate to reset "cancel authorization" or something like this (I am in french version ;) )
If some people meet the same problem than me, maybe it could be usefull for you too :
Don't forget to authorize devices in your phone (each time of usb connect on the android device if you don't select always box). Beside, you can suppress the old authorized devices on your phone and start with proper parameter to authorize clearly your pc on your android device
When you connect the android device, a pop up or notification ask to authorize a mac address or equivalent to the device : authorize it if you want to authorize connection between your linux pc and your android device.
It is necessary to obtain autorisation on your android device when you use connect the usb cable (if you don't accept all the time but if it is the first time this box is going to appear on your devices) if you don't do it, adb devices show unauthorized even all rights are good (666, UDEV etc)
Note : thank you for your precious help.
A last thing, sorry for my english
I'm facing this issue while run flutter app from android studio 4.1, i did remove usb cable and plug into second usb port and its working :),
I'm writing this if someone face same issue then they can get help.
Same issue on Fedora 32, to fix this try this:
adb kill-server
adb start-server
For me and possibly many others the issue is to do with access rights to devices on the machine. Now that this is well documented in the android documentation, I think the best solution is here
On Debian based Systems you can run lsusb or dmesg to get vendor id if your vendor does not exist on the given list
I have face the same problem and i have resolved this by
Adding the path of your_android_sdk_path to the environment variable like
sudo export $PATH:/your_android_sdk_path/platform-tools/adb
its your wish how you want to add this to your account or system wide by editing these file ~/.bashrc file or ~/.profile
or
/etc/profile, /etc/bash.bashrc, or /etc/environment if u want to add to system wide access.
and then create the link of that in bin
sudo ln -s /your_android_sdk_path/platform-tools/adb /bin/adb
if you have used adb devices or any command then first kill the server like
adb kill-server
then start the server like
adb start-server
adb devices
now you can see your devices are listed properly without an issue
As the error message said, it is a permission insufficient problem. In my experience, it only happened on my Linux machine, and works well on MacOS and Windows. Launching your Android Studio with root permission could avoid this problem.
$sudo /your_android_studio_path/bin/studio.sh
In my situation:
cd /etc/udev/rules.d/
sudo chmod a+r ./*.rules #the name of your rules files.
Then,I can use adb without this error.
if accepted answer not worked for you then just simple follow steps:
Just open your android studio terminal:-
adb kill-server
adb start-server
it worked for me.
Without running Linux
sudo apt-get install adb. Don't forget to enable USB debugging.
Ref: https://developer.android.com/studio/run/device

Android Debug Bridge (adb) device - no permissions [duplicate]

This question already has answers here:
set up device for development (???????????? no permissions)
(30 answers)
Closed 5 years ago.
I have a problem connecting HTC Wildfire A3333 in debugging mode with my Fedora Linux 17. Adb says:
./adb devices
List of devices attached
???????????? no permissions
my udev rules (first rule for Samsung which works just fine and second for HTC which is not):
SUBSYSTEM=="usb",SYSFS{idVendor}=="04e8",SYMLINK+="android_adb",MODE="0666",GROUP="plugdev"
SUBSYSTEM=="usb",SYSFS{idVendor}=="0bb4",SYMLINK+="android_adb",MODE="0666",GROUP="plugdev"
For Samsung devices everything's okay:
./adb devices
List of devices attached
00198a9422618e device
I have been trying all of the answers given in a simmilar thread wthout any luck: Using HTC wildfire for android development
I just had this problem myself under Debian Wheezy.
I restarted the adb daemon with sudo:
sudo ./adb kill-server
sudo ./adb start-server
sudo ./adb devices
Everything is working :)
The cause of that problem has to do with system permissions (thanks # IsaacCisneros for this suggestion). Somehow HTC Wildfire (and maybe the others) need something more from the system than Samsung devices. Simple solution is to run Eclipse as a root, but this is not very comfortable with non-sudo Linux systems like Fedora.
I've found another way of achieving the same goal, which seems to be more user friendly and is lesser security hole then running entire IDE with super user privileges. Mind this is still only a workaround of the problem. System root usage should be minimalized only to administrative tasks, and “adb” was designed to work with normal user account without SUID. Despite of the fact that the proper setting of SUID is quite secure, every single permission increase is a potential system security hole.
1.Setting ownership of the adb binary (owner – root, owner group - user_group):
chown root:user_group adb
2.Setting permissions with SUID:
chmod 4550 adb
This should result something similar to this (ls -llh):
-r-sr-x---. 1 root user_name 1.2M Jan 8 11:42 adb
After that you will be able to run adb as a root, event though you'll be using your normal user account. You can run Eclipse as a normal user and your HTC should be discovered properly.
./adb devices
List of devices attached
HT0BPPY15230 device
I have a similar problem:
$ adb devices
List of devices attached
4df15d6e02a55f15 device
???????????? no permissions
Investigation
If I run lsusb, I can see which devices I have connected, and where:
$ lsusb
...
Bus 002 Device 050: ID 04e8:6860 Samsung Electronics Co., Ltd GT-I9100 Phone ...
Bus 002 Device 049: ID 18d1:4e42 Google Inc.
This is showing my Samsung Galaxy S3 and my Nexus 7 (2012) connected.
Checking the permissions on those:
$ ls -l /dev/bus/usb/002/{049,050}
crw-rw-r-- 1 root root 189, 176 Oct 10 10:09 /dev/bus/usb/002/049
crw-rw-r--+ 1 root plugdev 189, 177 Oct 10 10:12 /dev/bus/usb/002/050
Wait. What? Where did that "plugdev" group come from?
$ cd /lib/udev/rules.d/
$ grep -R "6860.*plugdev" .
./40-libgphoto2-2.rules:ATTRS{idVendor}=="0bb4", ATTRS{idProduct}=="6860", \
ENV{ID_GPHOTO2}="1", ENV{GPHOTO2_DRIVER}="proprietary", \
ENV{ID_MEDIA_PLAYER}="1", MODE="0664", GROUP="plugdev"
./40-libgphoto2-2.rules:ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="6860", \
ENV{ID_GPHOTO2}="1", ENV{GPHOTO2_DRIVER}="proprietary", \
ENV{ID_MEDIA_PLAYER}="1", MODE="0664", GROUP="plugdev"
(I've wrapped those lines)
Note the GROUP="plugdev" lines. Also note that this doesn't work for the other device ID:
$ grep -Ri "4e42.*plugdev" .
(nothing is returned)
Fixing it
OK. So what's the fix?
Add a rule
Create a file /etc/udev/rules.d/99-adb.rules containing the following line:
ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="4e42", ENV{ID_GPHOTO2}="1",
ENV{GPHOTO2_DRIVER}="proprietary", ENV{ID_MEDIA_PLAYER}="1",
MODE="0664", GROUP="plugdev"
This should be a single line, I've wrapped it here for readability
Restart udev
$ sudo udevadm control --reload-rules
$ sudo service udev restart
That's it
Unplug/replug your device.
Try it
$ adb devices
List of devices attached
4df15d6e02a55f15 device
015d2109ce67fa0c device
You udev rule seems wrong. I used this and it worked:
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev"
(ATTR instead of SYSFS)
Changing the USB Mode from phone did the trick for me. (I set it to File Transfer)
under ubuntu 12.04, eclipse juno. I face the same issue. This what I found on Yi Yu Blog
The solution is same as same as Leon
sudo -s
adb kill-server
adb start-server
adb devices
Stephan's answer works (using sudo adb kill-server), but it is temporary. It must be re-issued after every reboot.
For a permanent solution, the udev config must be modified:
Witrant's answer is the right idea (copied from the official Android documentation). But it's just a template. If that doesn't work for your device, you need to fill in the correct device ID for your device(s).
lsusb
Bus 001 Device 002: ID 05c6:9025 Qualcomm, Inc.
Bus 002 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse
...
Find your android device in the list.
Then use the first half of the ID (4 digits) for the idVendor (the last half is the idProduct, but it is not necessary to get adb working).
sudo vi /etc/udev/rules.d/51-android.rules and add one rule for each unique idVendor:
SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", MODE="0666", GROUP="plugdev"
It's that simple. You don't need all those other fields given in some of the answers. Save the file.
Then reboot. The change is permanent. (Roger shows a way to restart udev, if you don't want to reboot).
...the OP’s own answer is wrong in so far, that there are no “special system permissions”. – The “no permission” problem boils down to ... no permissions.
Unfortunately it is not easy to debug, because adb makes it a secret which device it tries to access! On Linux, it tries to open the “USB serial converter” device of the phone, which is e.g. /dev/bus/usb/001/115 (your bus number and device address will vary). This is sometimes linked and used from /dev/android_adb.
lsusb will help to find bus number and device address. Beware that the device address will change for sure if you re-plug, as might the bus number if the port gets confused about which speed to use (e.g. one physical port ends up on one logical bus or another).
An lsusb-line looks similar to this:
Bus 001 Device 115: ID 4321:fedc bla bla bla
lsusb -v might help you to find the device if the “bla bla bla” is not hint enough (sometimes it does neither contain the manufacturer, nor the model of the phone).
Once you know the device, check with your own eyes that ls -a /dev/bus/usb/001/115 is really accessible for the user in question! Then check that it works with chmod and fix your udev setup.
PS1: /dev/android_adb can only point to one device, so make sure it does what you want.
PS2: Unrelated to this question, but less well known: adb has a fixed list of vendor ids it goes through. This list can be extended from ~/.android/adb_usb.ini, which should contain 0x4321 (if we follow my example lsusb line from above). – Not needed here, as you don’t even get a “no permissions” if the vendor id is not known.
I'll prepend this postscript here at the top so it won't get lost in my earlier explanation.
I can reliably produce and resolve the no-permissions problem by simply changing the USB connection type from Camera (PTP) to Media device (MTP). The camera mode allows debugging; the media mode causes the no-permissions response in ADB.
The reasoning seems pretty evident after reflecting on that for a moment. Unsecured content on the device would be made accessible by the debugger in media server mode.
===========
The device is unpermissioned until you accept the RSA encryption warning on the debugged device. At some point after connecting, the device will ask to accept the debugging connection. It's a minimal security protocol that ensures you can access the device beyond the initial swipe lock. Developer mode needs to be enabled, I believe.
The "no permissions" flag is actually a good first indicator that adb recognizes the device as a valid debugging target. Notice that it doesn't list your other USB devices.
Details at the following and related pages.
http://developer.android.com/tools/device.html
Same problem with Pipo S1S after upgrading to 4.2.2 stock rom Jun 4.
$ adb devices
List of devices attached
???????????? no permissions
All of the above suggestions, while valid to get your usb device recognised, do not solve the problem for me. (Android Debug Bridge version 1.0.31 running on Mint 15.)
Updating android sdk tools etc resets ~/.android/adb_usb.ini.
To recognise Pipo VendorID 0x2207 do these steps
Add to line /etc/udev/rules.d/51-android.rules
SUBSYSTEM=="usb", ATTR{idVendor}=="0x2207", MODE="0666", GROUP="plugdev"
Add line to ~/.android/adb_usb.ini:
0x2207
Then remove the adbkey files
rm -f ~/.android/adbkey ~/.android/adbkey.pub
and reconnect your device to rebuild the key files with a correct adb connection.
Some devices will ask to re-authorize.
sudo adb kill-server
sudo adb start-server
adb devices
Had the same issue. It was a problem with udev rules. Tried a few of the rules mentioned above but didnot fix the issue. Found a set of rules here, https://github.com/M0Rf30/android-udev-rules. Followed the guide there and, voila, fixed.
I encountered the same problem today.
I followed the official instructions, but I didn't noticed that I SHOULD
run command "chmod a+r /etc/udev/rules.d/51-android.rules"
After I set this file to world readable and re-plug my usb cable,the status became unauthorized. Then just grant the permission and everything goes fine.
I agree with Robert Siemer and Michaël Witrant. If it's not working, try to debug with strace
strace adb devices
In my case it helps to kill all instances and remove socket file /tmp/ADB_PORT (the default is /tmp/5037).
Another possible source of this issue is USB tethering. If you have used USB tethering, turn it off, then unplug the device from USB, plug it back in, then do
adb kill-server
adb devices
That did the trick in my case (Ubuntu 12.04, Nexus S, SDK in home dir, never needed root to get it running). Depending on your device, you may need to run adb devices as root, though.
Try "android update adb" command. It helps me with samsung galaxy gear.
The output of ls -al /usr/bin/adb should show that it is owned by user root and group root. You can use Linux ACL (Access Control Lists) to give your local user permissions for adb as follows:
setfacl -m "u:userName:rwx" /usr/bin/adb
This is preferable to setting the SUID bit on /usr/bin/adb and also limits the users who can use adb to userName and root.
The answer is weaved amongst the various posts here, I'll so my best, but it looks like a really simple and obvious reason.
1) is that there usually is a "user" variable in the udev rule some thing like USER="your_user" probably right after the GROUP="plugdev"
2) You need to use the correct SYSFS{idVendor}==”####″ and SYSFS{idProduct}=="####" values for your device/s. If you have devices from more than one manufacture, say like one from Samsung and one from HTC, then you need to have an entry(rule) for each vendor, not an entry for each device but for each different vendor you will use, so you need an entry for HTC and Samsung. It looks like you have your entry for Samsung now you need another. Remember the USER="your_user". Use 'lsusb' like Robert Seimer suggests to find the idVendor and idProduct, they are usually some numbers and letters in this format X#X#:#X#X I think the first one is the idVendor and the second idProduct but your going to need to do this for each brand of phone/tablet you have.
3) I havent figured out how 51-adb.rules and 99-adb.rules are different or why.
4) maybe try adding "plugdev" group to your user with "usermod -a -G plugdev your_user", Try that at your own risk, though I don't thinks it anyriskier than launching a gui as root but I believe if necessary you should at least use "gksudo eclipse" instead.
I hope that helped clearify some things, the udev rules syntax is a bit of a mystery to me aswell, but from what I hear it can be different for different systems so try some things out, one ate a time, and note what change works.
Close running adb, could be closing running android-studio.
list devices,
/usr/local/android-studio/sdk/platform-tools/adb devices
On THL W100 running the device as root (as described above) worked only together with tethering enabled (I used AirDroid for that).
I had the same situation where three devices connected to one same host but only one had 'no permissions' others were online.
Adding SUID or SGID on adb was another issue for me. Devices seen offline every time adb restarts - until you acknowledge on the devices every time.
I solved this 'no permissions' issue by adding 'o+w' permission for a device file.
chmod o+w /dev/bus/usb/00n/xxx

Install app on Motorola Backflip from AT&T

I'm trying to test an app out on the Motorola Backflip with AT&T as the carrier. I checked USB debugging on the phone's Development screen.
Using Eclipse, how do I get the app to load on the Backflip so I can test it? DDMS shows a device with a bunch of question marks and unkown. Seems that it only gives me the option to load the app on the SD card which doesn't do me any good.
I searched and found a Motorola driver which I'm supposed to install to the adb folder. Where is that folder? I've checked the phone and on my development machine. Maybe I need new glasses?
More info:
I have Run set to manual. When I click on run I get:
Choose a running Android Device:
Serial number ????????
AVD Name N/A
Target Unk
State ??
and the OK button is greyed out so all I have left is to Cancel.
Still trying:
I don't know if this helps but in DDMS the following messages show up:
[2010-03-28 19:20:41 - ddms]execute: running ls -l /
[2010-03-28 19:20:41 - ddms]Got reply 'FAIL', diag='insufficient permissions for device'
[2010-03-28 19:20:41 - ddms]execute: returning
Did what Commonwares suggested:
eric#i7Linux:~/Eclipse3.5/android-sdk-linux_86/tools> ./adb kill-server
eric#i7Linux:~/Eclipse3.5/android-sdk-linux_86/tools> ./adb kill-server
eric#i7Linux:~/Eclipse3.5/android-sdk-linux_86/tools> ./adb start-server
* daemon not running. starting it now *
* daemon started successfully *
eric#i7Linux:~/Eclipse3.5/android-sdk-linux_86/tools> ./adb devices
List of devices attached
???????????? no permissions
eric#i7Linux:~/Eclipse3.5/android-sdk-linux_86/tools>
First, try adb kill-server followed by adb start-server (or just reboot your development machine). Then, with the device plugged in, run adb devices. If your device shows up (and with a real device ID, not question marks or anything), try it again from Eclipse, or use adb install ... (where ... is the path to your APK) to install it.
Since the Backflip does not support app installs outside of the Market, there was a fair bit of public experimentation to ensure the Backflip supported adb-based installs, so I know it works in general.
If you are using Eclipse. when you run the application it should automatically set your phone as the target and push the apk to the phone and execute it. You might have to set your phone as the target instead of the emulator.
Wow. Easier than I thought and I don't know how I missed that post.
If you are running Linux (I'm running Suse 11.2 x64) go to http://developer.android.com/intl/de/guide/developing/device.html for full instructions. I created the 51-android.rules file and I was able to install the app on the Motorola Backflip to test it. (Needless to say, but I'll say it anyway, more testing required. The layout on the Backflip doesn't match the emulator)
Repeating the instructions in the link:
Login as root
go to your etc/udev/rules.d folder
create a file called 51-android.rules
I put this line in the file: SUBSYSTEM=="usb", SYSFS{idVendor}=="22b8", MODE="0666"
save the file
Instructions say to chmod a+r the 51-android.rules file but I didn't have to. Permissions should be -rw-r--r--
Eclipse now sees the phone and I can load directly to it from Eclipse.
Back to coding :-))

Categories

Resources