Problem to run my application on a real device - android

I am developing android application under Linux Ubuntu 10.04, with Eclipse IDE.
I successfully managed to run my application through eclipse virtual device emulator (target android2.1-update1).
Then, I followed the tutorial to run my application on a ZTE tablet device through eclipse. I followed every step of the tutorial.
My rules file is located under /etc/udev/rules.d/51-android.rules, with content:
SUBSYSTEM=="usb", SYSFS{idVendor}=="19D2", MODE="0666"
The vendor ID of ZTE is 19D2.
I also enabled USB debugging both on the ZTE device and in my application's manifest file.
When I run the application in Eclipse, there is a "Android Device chooser" window popped up, which shows a device with:
serial number: "?????????????"
AVD name: N/A
target : Unknown
Debug:
Why eclipse can not recognize the ZTE tablet device correctly??
What could be the possible reason?
(I also tried to reboot my linux machine, but nothing changed)
State: ??

Change the line to SUBSYSTEM=="usb", ATTR{idVendor}=="19D2", MODE="0666"

Try changing your /etc/udev/rules.d/51-android.rules to:
SUBSYSTEMS=="usb", ATTRS{idVendor}=="19D2", OWNER="user", GROUP="group"
where user is the username of the account you develop under; and group is the group of the account you developer under.

??? symbols means that device is either offline or adb has not wright permission to access the device.Inorder to change the permission we need to update /etc/udev/rules.d/51-android.rules file in the following way.
SUBSYSTEM=="usb", ATTRS{idVendor}=="1782" ,MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0502", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="12d1", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1004", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="22b8", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04e8", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fce", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0489", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", SYMLINK+="android_adb", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04e8", MODE="0666", GROUP="plugdev"
using lsusb command to find vender id..

Related

android asus zenfone 5 not detected on ubuntu os

I have an asus zenfone 5, i want to develop android application on it and i am currently use ubuntu as my only OS,
what im already did was :
enabled usb debugging but still not detected in my computer
when i type lsusb on terminal the phone detected as Bus 002 Device 006: ID 18d1:d002 Google Inc.
these are my detail information about the system that i used, in case someone ask
OS : ubuntu 12.04 /elementary luna 64 bit
Android Device : zenfone 5 with android version 4.4.2
thanks^^
Many times, on Ubuntu, "it just works" -- you plug in the device, you accept the "yes, I want to allow debugging from this PC" dialog on the device, and you are set.
Sometimes, though, you need to customize your udev rules. Instructions for this can be found in the documentation. Search engines can usually turn up the rules you need, if your device is reasonably popular.
So, for example, here are some lines from the 51-android.rules set of udev rules on my development machine:
# Acer A700
SUBSYSTEM=="usb", ATTRS{idVendor}=="0502", MODE="0666"
# LG
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666"
# HTC
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666"
# SONY
SUBSYSTEM=="usb", ATTR{idVendor}=="0fce", MODE="0666"
# ASUS
SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", MODE="0666"
# Rikomagic
SUBSYSTEM=="usb", ATTR{idVendor}=="2207", MODE="0666"
# Kindle Fire HDX
SUBSYSTEM=="usb", ATTR{idVendor}=="1949", MODE="0666"
# Qualcomm MDP 800
SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", MODE="0666"
# Nokia X
SUBSYSTEM=="usb", ATTR{idVendor}=="0421", MODE="0666"
# hudl 2
SUBSYSTEM=="usb", ATTR{idVendor}=="1d4d", ATTR{idProduct}=="504b", MODE="0666"
I usually then restart udev via service udev restart, before plugging the device in again. Then, if the device has debugging enabled, you should get the confirmation dialog on the device, and if you accept that dialog, you will be able to use development tools to work with that device (set breakpoints, inspect LogCat, etc.).

Why ADT Ubuntu does not recognize my device?

I have a Motorola G, and I try to install my programs from DEVELOPED ADT Ubuntu, the problem is that I get the message when I ejercutar application
From terminal, the following is displayed
zhelon#zhelon-Lenovo-IdeaPad-Z400:~$ sudo adb devices
List of devices attached
???????????? no permissions
The most pragmatic way to fix this would be to run adb tools with root access. You are getting a no permissions error, because you need super user privileges to interact with attached devices.
To improve the answer, and alleviate superfluous security concerns, you can also run adb without root by adding a udev rule for your device. Instructions here.
First, query lsusb:
$ lsusb
Bus 002 Device 103: ID 04e8:6860 Samsung Electronics Co., Ltd GT-I9100 Phone [Galaxy S II]
Then create a new rules file and add the rule to it (/lib/udev/rules.d/10-adb.rules):
# ADB
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="6860", MODE="0600", OWNER="username"
Then restart udev, or reboot your computer (recommended).
I had the same problem and i fixed it using following steps.
Run Following command.
$ sudo gedit /etc/udev/rules.d/51-android.rules
Add the following lines to it and save it:
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0e79", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0502", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0b05", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="413c", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0489", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="091e", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="12d1", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="24e3", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="2116", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0482", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="17ef", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1004", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="22b8", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0409", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="2080", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0955", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="2257", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="10a9", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1d4d", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0471", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04da", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="05c6", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1f53", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04e8", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04dd", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fce", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0930", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="19d2", MODE="0666"
Run Following command.
$ sudo service udev restart
Run Following command.
$ sudo killall adb
after complete following steps reconnect the phone.
Running adb in root will resolve this issue.
In my case my device does not running as root,
So,
/sdk/tools$sudo adb kill-server
then
/sdk/tools$sudo adb start-server
Helped me immediately to find my device in the list.
I had a same problem with an Ideapad A1 Tablet, I fixed installing "android-tools-adb"
sudo apt-get install android-tools-adb
Oddly enough I had tried to add to the rules.d as suggested but my primary issue came from the mode set on USB PC Connection options. In the case of the LG G tablet, it would not work in Charge Tablet or Media Sync (MTP) modes obviously so if either of those are selected it may not work. It did work in PTP mode though =]. Hope this helps someone dealing with the LG tablets.
sudo chmod a+r /etc/udev/rules.d/51-android.rules

"List of devices attached" is empty on Ubuntu 12.04

I am unable connect my Android to Ubuntu. I have added rule to udev, I have added device to adb_usb.ini and I'm still getting same empty list.
My lsusb:
`Bus 002 Device 124: ID 04e8:6860 Samsung Electronics Co., Ltd GT-I9100 Phone [Galaxy S II]`
adb_usb.ini
# ANDROID 3RD PARTY USB VENDOR ID LIST -- DO NOT EDIT.
# USE 'android update adb' TO GENERATE.
# 1 USB VENDOR ID PER LINE.
0x0e79
0x04e8
51-android.rules
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0e79", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0502", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0b05", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="413c", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0489", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="091e", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="12d1", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="24e3", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="2116", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0482", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="17ef", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1004", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="22b8", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0409", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="2080", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0955", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="2257", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="10a9", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1d4d", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0471", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04da", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="05c6", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1f53", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04e8", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04dd", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fce", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0930", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="19d2", MODE="0666"
And I have usb debugging on. Is there anything else that I can try?
EDIT
I have tried to restart adb-server with adb kill-server and adb start-server, but it also doesn't help me.
I tried a lot of advices to be my Android device visible by "adb devices" command but none worked.
And finally I found.
Just add your Android device vendor ID (like 0x1f3a) to
~/.android/adb_usb.ini
and then try other advices.
It turned out that I did not have the necessary phone drivers
For LG G3 (maybe others)
We had to go to the USB options when connecting
Allow installation of applications from the phone
Waiting for installation
Select the PTP (Send images mode)
For those who are having intermittent problems with adb. Here's a simple procedure you can use to rectify the issue.
Keep the device connected.
run
sudo adb kill-server
then go into your mobile device and
revoke all usb authorizations in your android developer section in settings on your mobile device.
Next turn debugging off and then on again after 10 secs or so.
You will get a pop up for authorization in your device.
Select yes to it on the device and then run the following in terminal
sudo adb devices -l
Your device should be back in action.
It seems that problem is caused by my smartphone. I tried to plug in Android 4.3 and it works correctly.
Adding device in android rules file:
Use the following commands in Ubuntu:
How to get the device vendor id:
lsusb
Command for adding device rules, run the following commands:
sudo gedit /etc/udev/rules.d/51-android.rules
sudo chmod a+r /etc/udev/rules.d/51-android.rules
In my case After
adb kill-server
I did
sudo adb start-server
then
sudo adb devices
and got it worked!

Can't run Hello World on my Android device

What's with the downvote? I know this is a dumb question but is it not a "good" question?
I've never done any Android programming but thought it might be fun to put together a toy app for my morning and evening commutes.
So I'm going through this tutorial.
When I go through the steps to "run on real device" (connect via USB and enable USB debugging) and then click run, I get the following:
Any help is appreciated.
This is how I solved that in my Ubuntu:
http://ptspts.blogspot.com/2011/10/how-to-fix-adb-no-permissions-error-on.html
Save this file at /tmp/ as android.rules
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0e79", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0502", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0b05", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="413c", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0489", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="091e", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="12d1", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="24e3", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="2116", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0482", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="17ef", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1004", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="22b8", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0409", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="2080", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0955", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="2257", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="10a9", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1d4d", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0471", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04da", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="05c6", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1f53", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04e8", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04dd", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fce", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0930", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="19d2", MODE="0666"
Run the following commands:
$ sudo cp /tmp/android.rules /etc/udev/rules.d/51-android.rules
$ sudo chmod 644 /etc/udev/rules.d/51-android.rules
$ sudo chown root. /etc/udev/rules.d/51-android.rules
$ sudo service udev restart
$ sudo killall adb
Disconnect the USB cable between the phone and the computer.
Reconnect the phone.
Run adb devices to confirm that now it has permission to access the phone.
If you are using a linux machine, you have to restart your ADB.
That's the problem you are facing I think.
To restart ADb follow the below steps,
1)Login as root user.
2)Go to the Directory where you have android-sdk folder.
3)Then traverse to platfrom-tools directory.
4) Then execute the below commands,
./adb kill-server
./adb start-server
Now you will be able to see a message like this,
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
If not repeat the fourth step once again.
set your application target to android 2.2.3 then run because you set your application target to 4.1 but your device is compatible with only 2.2.3 or lower version of android and restart your device.
You need to set up your device vendor id, as described at Android Developers : Here
Plug into USB and from the command line run:
$ lsusb
This will give you the ID of your device (and other connected USB devices). For example, if you have a Samsung Galaxy S II Skyrocket connected you would get:
Bus 001 Device 010: ID 04e8:685e Samsung Electronics Co., Ltd GT-I9100 Phone [Galaxy S II] (USB Debugging mode)
In this case the Vendor ID is “04e8″ and the Product ID is “685e″.
Then edit:
sudo gedit /etc/udev/rules.d/51-android.rules
Add the following line to it and save it:
SUBSYSTEMS==”usb”, ATTRS{idVendor}==”04e8″, ATTRS{idProduct}==”685e″, MODE=”0666″
Restart udev:
$ sudo restart udev
Check if the device is recognized:
$ adb devices
Sometimes I also have to restart adb:
$ adb kill-server
$ adb start-server
i think USB debugging is not enabled in your android device.
Set it in your device go to
Settings -> Applications -> Development -> USB debugging
USB debugging = True

Debugging Android App on Device

I know there are many questions about this but none of them helped my situation.I'm running Ubuntu 11.10 and I'm trying to debug an app on my LG phone. I followed this guide: http://developer.android.com/guide/developing/device.html
I enabled USB debugging on my phone,set the project to debuggable in the manifest, and edited the /etc/udev/rules.d/51-android.rules rules file. Here is the contents of the file:
SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666", GROUP="plugdev"
1004 is the vendor ID for LG. The device is mounted; I can access it in my filesystem and the USB mounted indicator is in the notifications area. When I run adb devices, the phone is not listed, only the emulator is. It is also not recognized in Eclipse. How can I get Eclipse to recognize my device?
Here is my ultimate script to adding rules for all Android devices. You should delete your xx-android.rules files if you wrote it and make this with sudo:
#!/bin/bash
android_SDK=$1
if [[ $android_SDK == "" ]]
then
echo 'usage: sudo add_device_rules_to_unix.sh /android-SDK/platform-tools/dir/path'
exit
fi
PATH=$PATH:$android_SDK
rules_file="/etc/udev/rules.d/99-android.rules"
# Adding rules to 99-android.rules file
echo '# Acer
SUBSYSTEM=="usb", SYSFS{idVendor}=="0502", MODE="0666"
# Dell
SUBSYSTEM=="usb", SYSFS{idVendor}=="413c", MODE="0666"
# Foxconn
SUBSYSTEM=="usb", SYSFS{idVendor}=="0489", MODE="0666"
# Garmin-Asus
SUBSYSTEM=="usb", SYSFS{idVendor}=="091E", MODE="0666"
# Google
SUBSYSTEM=="usb", SYSFS{idVendor}=="18d1", MODE="0666"
# HTC
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
# Huawei
SUBSYSTEM=="usb", SYSFS{idVendor}=="12d1", MODE="0666"
#Kyocera
SUBSYSTEM=="usb", SYSFS{idVendor}=="0482", MODE="0666"
# LG
SUBSYSTEM=="usb", SYSFS{idVendor}=="1004", MODE="0666"
# Motorola
SUBSYSTEM=="usb", SYSFS{idVendor}=="22b8", MODE="0666"
# Nvidia
SUBSYSTEM=="usb", SYSFS{idVendor}=="0955", MODE="0666"
# Pantech
SUBSYSTEM=="usb", SYSFS{idVendor}=="10A9", MODE="0666"
# Samsung
SUBSYSTEM=="usb", SYSFS{idVendor}=="04e8", MODE="0666"
# Sharp
SUBSYSTEM=="usb", SYSFS{idVendor}=="04dd", MODE="0666"
# Sony Ericsson
SUBSYSTEM=="usb", SYSFS{idVendor}=="0fce", MODE="0666"
# ZTE
SUBSYSTEM=="usb", SYSFS{idVendor}=="19D2", MODE="0666"' > $rules_file
# Applying rules and restarting adb
chmod a+r $rules_file
service udev restart
adb kill-server
adb start-server
Hope it helps you.
I found my problem. The Android guide says to name the udev file 51-android.rules. But for newer version of Ubuntu (Karmic and sooner) it needs to be names 70-android.rules. This is the tutorial I followed: http://esausilva.com/2010/05/13/setting-up-adbusb-drivers-for-android-devices-in-linux-ubuntu/. Thanks for your answers though.
You should install usb-drivers for your device (even if you have access with your file system). Maybe it's a standart driver, that allows you to use SD card on your phone (but nothing more).
Try searching for generic adb drivers for LG for Ubuntu, install them, reboot and connect your phone. Then go to terminal, navigate to folder with adb and use the following command to see if your device is recognised:
./adb devices
If it shows your device, it is ready to be used with android sdk.
There is an extra step on 64 bit Ubuntu:
apt-get install ia32-libs
Maybe this is the issue?

Categories

Resources