I'm trying to get my android phone working to run apps from inside an IDE.
Got it working on windows no problem, currently working in fedora (18) a lot though so wanted to get it working with that.
Got IntelliJ and android sdk installed, problem is when I try to run the default hello world app it wont work it just says waiting for device..
Ran adb devices got
List of devices attached
???????????? no permissions
Leads me to believe the driver isn't installed? Phone I'm using is a HTC Sensation. Does anyone know what I can do to try and resolve it? The HTC web page doesn't offer me drivers to install.
Also noticed in /etc/udev/rules.d/..android.rules there is nothing about Sensation. Seems it recognises my nexus 7 though..
Edit: Tried my nexus.. got
List of devices attached
901839238298923 offline
So it doesn't even work with that.. confusing..
Any help would be appreciated.
Thanks,
B
For HTC try downloading HTC sync and give a try..
I also had this problem and i used eclipse IDE. I Re connected and try 2-3 times and after that i run adb devices I got it as online.
Also check out for the devices TAB in eclipse(if you are using that) .It also gives a list of attached devices.
Also try adding this android:debuggable="true" to application tag(<application>) in androidmanifest.xml
Hope it helps :)
As you are installing from the beginning, have you updated the SDK manager. I have had this issue before too, every time on a new computer it trips me up. If SDK manager isn't loading see here: Android SDK manager won't open
I get a similar problem when my user have no permissions, so I did a script to restart the adb on fedora as root:
Script Gist Link
the script basically runs it:
su -c ' \
ADB="/path/to/your/sdk/platform-tools" && \
$ADB/./adb kill-server && \
$ADB/./adb start-server \ '
Related
I'm very new to Android Studio. I have been using it on Windows but the machine was too old to run any of the emulators so I installed it (via Ubuntu Software store) on a laptop running Unbuntu 18.04.
It all seems to work OK except the Logcat does not show anything. Sometimes, after cold starting the emulator, I get some output to the Logcat but then it just halts and nothing I do (see below) causes it to output anything else.
I cannot get ANY output when running an app.
I have searched extensively here and via Google and tried the following:
restarted the Studio
restarted logcat
killed and restarted adb
invalidate caches and restart AS
deleting and recreating AVDs
use logcat via AS built in terminal and external shell :
./adb -s emulator-5554 logcat
and get:
Unable to open log device '/dev/log/main': No such file or directory
NB: When using an attached phone e.g. Moto G. the logcat works fine. I get all the system output and the app output works as expected.
Thanks in advance
2019-12-14 UPDATE: when the emulator is running it shows the active processes (see screenshot) in the drop down, including my app but NO entries. Not sure if this gives anyone a clue? It is clearly communicating with the emulator in some way.
2019-12-16 UPDATE: Started in from scratch. Installed MX Linux 19 and fresh Studio install. Created new AVD. EXACTLY THE SAME!!! This is so ridiculous. Anyone, please?
sometimes you might be trying to use a gun to kill a fly. For a try, ensure that the emulator you have run is actually selected in logcat like in this screen shot
.
I've been trying to get emulators to work for NativeScript on my brand new clean Windows 10 laptop for three days and nothing is working.
To be more accurate, I think I was able to get the 'emulator-5554' to launch, but it doesn't not load the Groceries app.
I have all the Angular requirements installed since I also build Angular SPAs and they work fine. I read and followed all these articles, and I still can't get emulators to work.
I even installed GenyMotion, but it is not detected. I have not installed Android Studio since I'll be developing with Visual Studio Code, so I used the Android CLI to install the SDK.
https://docs.nativescript.org/start/general-requirements
https://docs.nativescript.org/start/introduction
https://docs.nativescript.org/start/cli-basics
https://docs.nativescript.org/tooling/android-virtual-devices?_ga=2.188319272.1221867054.1547512018-618552819.1547075699
https://docs.nativescript.org/start/quick-setup
https://docs.nativescript.org/start/ns-setup-win - this was my primary emulator setup
I have also read many SO posts and none have solved my problem.
Is there some documentation somewhere that is simple and clear, with step by step instructions on how to get emulators installed that will work with Nativescript? What am I missing?
BTW, when I connect my Samsung Galaxy S8 Active phone to my laptop, it's not recognized by the tns device command either.
I can't believe it's this difficult to get emulators to work. I also can't believe that the Nativescript documentation has left this information out of their instructions.
This might not be the answer most are looking for, but this is what was wrong with my installation and this is how I fixed it:
I noticed that the docs all had $./advmanager [someArg] and I had to be sudo for commands to execute. So I ran sudo chown -R myUser:myUser /usr/local/android thus changing all owner:group permissions from root to myUser.
then I could run ./avdmanager create.... (full command below) without having to be superuser
restarted Nativescript Sidekick
I know this is kinda stupid, but I worked out that if the AVD was created as root, the Sidekick program running as myUser could not see and access it. This was confirmed when I ran avdmanager list avd as sudo and got a result, but after changing my files' ownership from root to myUser, nothing was listed from the same command.
I recreated my virtual devices (AVDs) as a normal user and Sidekick was able to see them.
edit: the actual line I ran to create the AVD (because I see a lot of variation in these):
$ ./avdmanager create avd --name Pixel -k "system-images;android-28;google_apis;x86" --device "pixel"?
The uppercase and lowercase "pixel"s come from one entry from the output of
$./avdmanager list
id: 17 or "pixel"
Name: Pixel
OEM : Google
---------
Do this "create" step for each device you want to emulate.
Install Android Studio and open it. Then (without starting a new project) click on:
Configure --> AVD Manager.
There you can create virtual devices, which will be recodnized by NativeScript Sidekick and its virtual device launcher.
Until yesterday everything was working perfect until today that I connected my phone (just updated to Jelly Bean) and adb.exe stop working. If I execute adb.exe I can see the help but when I want to use any command it just run forever and no message is shown.
I tried with "kill-server" and "devices" and it runs forever, no message at all is displayed and I must terminate the process to close it.
I just connect the same phone to other PC that was fully functional and also adb.exe stop working. The strange thing is that adb.exe will not work any more even If I disconnect the phone and/or I connect my tablet. Adb.exe just got useless.
I was using the same phone yesterday (android 4.0), with my tablet (android 4.2) and adb.exe was working.
Adb.exe is not corrupted as I checked it MD5 and it is the same as in working pc (5787e5df1a68e7afea82d58e5f0d6549 *adb.exe).
I have Android Debug Bridge version 1.0.31 and Android SDK tools 22. I uninstalled android sdk tools and Installed again but when is near to finish it hangs because it launches adb.exe and again it will run forever.
Please any suggestion or help?
Try rebooting. Sometimes the USB drivers lock up. I work HEAVILY with ADB in my project at http://android-casual.googlecode.com and I find it to be one of three things when ADB locks up.. 1. USB drivers, or 2. adb_usb.ini needs an update, or 3. on new devices you have to "pair" them so that ADB can perform any action.
To pair, you can disconnect, reconnect and run "adb devies" to display the pairing on the device.
Not sure if you're still facing this issue, but for what it's worth I had the same kind of issue with adb.exe, and came across this post while trying to troubleshoot it. In my case, I wasn't using any physical Android devices, only the Emulator. Everything had been working fine and then suddenly adb.exe would no longer respond (couldn't get any output from any adb command - it just appeared to hang).
In the end, my issue turned out to be another application I had installed on my development machine. It was starting as a service, and was listening on the exact same port that the adb server runs on (5037), which appeared to be confusing it. Once I changed the application to use a different port, adb started working again and everything was fine.
Run command
where adb
I had such kind of situation.
In my case
where adb
gave output
C:\Windows\adb.exe
D:\AndroidSDK\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe
I tried to run adb from disk C, when Eclipse used second adb from AndroidSDK (from disk D).
I removed adb from strange path C:\Windows\adb.exe, and this solved this problem.
I got the same problem,my solution is going to cmd and paste adb.exe path,and then click enter button.For example
D:\Android\Android\platform-tools\adb.exe
I've been developing my first android apps on Eclipse installed on OSX Lion. I would like to use my Jelly Beans Galaxy Nexus for debugging, but the Android Device Bridge (adb) can't find the device:
./adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
The phone is in debugging mode.
The phone is recognizable as a camera (PTP), but not as a media device (MTP). ADB does not work regardless of PTP\MTP setting.
I have restarted noth the phone and the mac
Following this advice, I've installed Android File Transfer. The ATF recognizes the device, but no luck with the ADB.
Any ideas?
Addendum: I have reported a bug for this. Workarounds are still most welcome!
Sep 5 13:28 UTC - Workaround #1: Dropbox: I've moved the OSX Eclipse workspace to Dropbox and installed Dropbox on the device. The APK is written to bin/, and I re-install it from the Dropbox app after each successful build.
I'm answering this because my boss just had the exact same issue with his Galaxy Nexus, and we finally fixed it yesterday. He had an application, "EasyTether" that was snagging his connection to ADB and it couldn't be used anywhere else. Is it possible that you've setup this application, or a similar one that might be using ADB for you? If "Android File Transfer" works (it was working in parallel with EasyTether for my boss), then your connection is active, so as long as "USB Debugging" is enabled in your settings, you should be seeing a connection. Here's a quick how-to in the event that you do have "easytether"
BEFORE you plug your phone in run the following in terminal
sudo kextunload /System/Library/Extensions/EasyTetherUSBEthernet.kext
If that fixes the issue, and you want to remove easytether altogether, you can us the rm command with the -rf flags to keep it from happening again...
sudo kextunload /System/Library/Extensions/EasyTetherUSBEthernet.kext
sudo rm -rf /System/Library/Extensions/EasyTetherUSBEthernet.kext
You can use adb over wifi.
See this post to do it yourself.
or there are quite a lot of apps on google play. But these need root access
Try taking the usb stick out of the phone and put it back
Try taking it out of the mac and put it back
Try to put the stick in another port
Try to wriggle the stick so you are sure it is connected.
There is a long discussion with possible solutions here: Can't find android device using "adb devices" command
Have you tried a different cable? I ordered a bunch of cheap cables off of eBay, and the first one I used would not work for adb. It did work for charging and file transfers however.
I have a nexus S for sprint that I am using as a developer phone rooted to be running android 4.1. Eclipse recognizes the phone, drivers, etc. I can run "adb devices" and the phone id is displayed. However, if I try to debug my app or any other imported project I get the following error:
Unable to open zip '/data/local/tmp/com.myapp.apk': Permission denied
(I would post the image but haven't posted here before)
If I manually transfer the .apk and install via Astro, everything runs perfectly. I am considerably lost and any help would be appreciated.
For anyone looking at this with a more recent version of the siyah kernal, if you don't wish to switch your kernel, you can use the "ExTweaks" app to change a settings under "MISC" called "ADB Binary Mode". I set this to "Development ADB"(was "Normal ADB") and can now successfully debug with eclipse! :D
I have a custom ROM installed in my Galaxy S2. Searching by google i came to this post: http://forum.xda-developers.com/showpost.php?p=29454043&postcount=203
The problem in my case was the kernel too (Siyah 3.5.2).
I installed another kernel for JB (http://developer.clockworkmod.com/downloads/51/3354/kernel-cm-10-20120801-i9100-signed.zip) and the problem was solved.
Basically
/data/local
doesn't have the right permissions, so a simple:
adb shell
cd /data
chmod 777 local
should work. (Not sure if the new permissions are overbroad, but I'm not too worried)
As per ekim's answer, I had the same issue, again, a Galaxy S2, etc. The latest version of Siyah fixes this problem and I can get back to running/debugging from Eclipse.
I updated SGS3 (I9300) to stock 4.1.1 ROM and I got the same problem.
After I unsuccessfully tried everything here and elsewhere suggested:
clean all projects
install via adb chmod 777 for /data/local/tmp (and direct subfolders)
dancing the chicken dance (dunno who suggested that, but at least it
produced some laughs ;)
etc.
I installed SiyahKernel S3-v1.6.8 and the problem was gone.
After inspecting my UMASK, I saw it's now 0000 (and it was 0077 on stock kernel), so I concluded that the wrong UMASK was the root cause of the error.
Still, as can be seen from numerous other threads on this issue out there, it's very wrong for the stock kernel to cause that problem.
Here's a quick way to see if it's a permission issue:
adb install -s Your.apk
this will install on the SDcard rather than /data/local