I have been onto something in Android and it requires me to push some files in the adb. At first I pushed a file in the adb which worked fine but then after that as I tried to push other files in the adb it started to give me a device not found error. I tried killing the process both from the cmd and the Task Manager but it was of no help though after killing the server and again starting it the daemon is successfully loaded in port 5037. Though till now the project of mine works fine and the sdcard is read as I expect but I am hanged because no other files could be uploaded in the sdcard. :/
Thanks in Advance.
I had this happen with my Nexus 4.
I was following
http://developer.android.com/training/basics/firstapp/running-app.html
And I noticed that
C:\trythisworkspace>adb install bin\MyApp-debug.apk
error: device not found
error: device not found
error: device not found
- waiting for device -
^C
C:\trythisworkspace>
and
C:\trythisworkspace>adb devices
List of devices attached
C:\trythisworkspace>
So those are some symptoms for you
Go to device manager and see if like me you had a yellow exclamation mark
Download the google driver here and extract it
http://developer.android.com/sdk/win-usb.html
then go to the device with yellow exclamation mark and properties and update driver and...browse.. and point it to google_usb_driver\usb_driver
.
then it detected it and my device manager showed "Android composite ADB interface".
BTW, Android SDK manager has an option to install google usb drivers. it's possible it puts them in %userprofile%\AppData\Local\Android\android-sdk\extras\google\usb_driver
you could try pointing device manager to that if you find you have that directory.
Related
First of all, this is my first post here and I'm a beginner so my apologies if this ends up being a stupid question or my format is wrong, but any help is appreciated.
Essentially my problem is in trying to set up Unity Remote 5 for debugging in Unity. However, I believe I've finally narrowed it down. The error I'm getting now seems clear:
CommandInvokationFailure: Unity Remote requirements check failed
C:/Program Files/Unity/Hub/Editors/2019.4.17f1/Editor/Data/PlaybackEngines/AndroidPlayer\SDK\platform-tools\adb.exe forward tcp:7201 tcp:7201
stderr[ error: device offline]
stdout[]
exit code: 1
I've looked into this error and came upon this: https://stackoverflow.com/a/39031464/14948855 which seems like it might be useful to me, however the issue is I don't know how to run the commands he suggested and stack overflow made it clear it didn't want me posting a question as a response to that question and I don't have enough prestige to comment.
I'm trying to run "sudo adb kill-server" from an ubuntu linux terminal on windows from the directory abd is in (C:\Program Files\Unity\Hub\Editors\2019.4.17f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools), but it won't run.
proof command not found
I've tried adding it to the path on my computer: I added the directory listed above to "Path" in my "Environment Variables".
My phone is plugged in, I've disabled and reenabled developer mode and usb debugging, and restarted Unity and my phone several times. Any help with running this command in ubuntu or cmd, or even the greater problem of Unity Remote 5 would be fabulous.
Thank you.
Edit: here's a better image showing my issue:
image showing how I've tried to add the folder to the path but it still can't be reached
Final Update:
All my problems have been solved, here's how I got unity remote 5 for android working for posterity:
step 1) Make sure phone is in developper mode (go to "about phone" in settings, tap build number 7 times).
step 2) Make sure "USB debugging" is turned on in developer options.
step 3) Make sure Unity is updated to the most recent supported version through Unity Hub (might not be required but I did this step).
step 3) Download android support module through Unity Hub.
note: if you downloaded current Unity version from the Unity website rather than through Unity Hub, it doesn't seem to let you add modules to it through Unity Hub.
step 4) The sdk path Unity specifies by default is wrong for some reason, so in preferences->external tools, disable the default path and paste in the right directory (should be something like: C:\Program Files\Unity\Hub\Editors\2019.4.17f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK) to be safe I did this for the JDK, NDK and Gradle too.
step 5) When you plug in phone, pull down your notifications, hit "tap to change USB options" and make sure phone is in "camera" mode or some variation. For me it was "Photo transfer".
Note: if you don't have the option to change USB options, try different usb ports/cables, if those don't work you might have debris in your charging port, clean it out with a dab of 91% or 99% rubbing alcohol and a tooth brush/tweezers (this will also make charger sit more snug in phone)
That might be enough to get it working for you, if not...
step 6) (Not sure if necessary) May need to update phone drivers in device manager on windows.
step 7) If Unity gives an adb error saying too many devices connected, it's possible you have a daemon running in the background which adb is picking up as an android emulator because it's using a port greater than 5555. It seems adb checks open ports above port 5555, and assumes anything it finds is an emulator. To check this, as indicated in my original question, and as stated here: https://stackoverflow.com/a/39031464/14948855, in cmd on windows use adb devices (if ur on linux may need to use sudo) to get a list of all devices being detected by adb. (Also use "adb kill-server" to reset it.) If there is an emulator being detected, it should include the port it's using in its name, in my case it was "emulator-5562" in port 5562, which was apparently actually NTKDaemon from Native Instuments, a random music production program I've only used once so far. I'd suggest googling the emulator port you find to try and narrow down the process taking that port. The only thing left to do is to kill the process running in the port. I found NTKDaemon in task manager and also disabled it activating on startup because that's just evil imo.
And that should be it. Hope that works for you if you're here for help.
(btw in terms of my original question, I was able to access adb.exe by changing the directory in cmd, but I still never found why adding the directory to the path didn't work, so if anyone has an answer to that I would be interested)
img
here is the image. I can't find my app's process, but others I can see. why did this happen? what should do? Thanks.
Some possible solutions:
On your notification bar, expand it and click the connection. Then select connect as Camera (PTP) (not as media device)
Try with another USB cable.
Go to your SDK manager and install Google USB Driver (I see you updated your answer regarding this)
Follow the instructions on OEM USD Drivers
if you get errors like below:
Unable to get view server version from device;
Unable to get view server protocol version from device
Unable to get the focused window from device
Unable to debug device
try to check these points below:
if signed app running on the phone, DDMS can't get the process info;
otherwise, can.
if use Virtual Device, then the DDMS&HierarchyView is useful;
reinstall app from IDE (if app process running stop it from IDE or force stop if through android setting)
if nothing happened try restart ADB
$ adb kill-server
$ adb start-server
Hi I am trying to connect the Tizen Emulator version : 2.3.0 Rev2 to an android device.
I downloaded the files for apk files from here. I have done the port forwarding like shown below before starting the emulator :
adb -d forward tcp:8230 tcp:8230
But even after starting the Emaulator still the HostManagerForEmul shows status as disconnected.
I was following the complete instructions from the youtube video found here.
A couple things to try...
If Gear Manager is installed on the Android handset, uninstall it. Gear Manager is not compatible with HostManagerForEmul.
Restart sap-server from the emulator.
I have same problem, after struggling I have finally connected
Here is solution , Go to package manager install both highlighted from extension SDK as shown in picture
after installing connect android phone install apk provided in tutorial and run
adb -d forward tcp:8230 tcp:8230
Now delete emulator and make again, after reboot it will install extension tools and on first boot it will show like this
After that it will reboot again automatically , and on Android side it will show Connected. Done :)
ADB when run stand-alone works fine. I can connect to my device (HTC Desire) and perform .apk installs etc, so I know the USB drivers are working correctly. A common reason for this question, I know, but that can be ruled out.
Occasionally I can connect to the phone, very occasionally. 99% of the time I just get the standard windows popup "adb.exe has stopped working".
I've updated Eclipse to the latest version.
I'm sure the USB drivers are working correctly
I can connect via adb in command line mode with no issues.
I've searched for a solution until google begged me to stop :)
Seems like a DDMS Eclipse issue.
Any ideas ?
Actually, just before I sent this I had a brainwave.
Without Eclipse running I ran adb.exe from command line and performed an install -r of my .apk package.
All worked fine.
I then started Eclipse - the connection to my phone worked fine...
Nope, Eclipse now failing again. BUT with eclipse trying to connect (and failing) I can simultaneously run adb from command line and install the package. It's got to be Eclipse
If you have an alternate "launcher" or "home-screen" installed, that might be forcing the connection to close. If you have one installed, either force stop it or uninstall it.
I've found that some apps running in your phone can cause ADB to crash for some reason. Try to close unnessecary apps running on your phone when developing in eclipse
In my case, I had an instance of adb.exe from another package (Android-Sync) running. Processes with this file name are common in packages that sync devices. You can find more information about programs that use an adb.exe process here: What is adb.exe ? adb.exe info
To determine if you have an adb.exe process already running, look in your Task Manager on the Processes tab to find the running adb.exe. You can right-click and select Properties from the menu to find out the full path of the adb.exe.
To solve the problem and allow Eclipse access to the correct adb.exe, I shut down Eclipse and the emulator. Then I went into the Task Manager and shut down the running adb.exe. There may be more than one. Then I restarted Eclipse and the emulator. Fortunately, when I started my Android Virtual Device, that program was smart enough to start up the correct adb.exe.
In my case was kinda problem with USB driver. Just plug your phone always to the same USB port.
This is pretty simple: I'm using NetBeans on Linux with Android emulator 1.6. I have Logcat on my android phone, but the process of getting the messages to somewhere readable isn't smooth at all.
Can someone tell me how to get Logcat running on the emulator? Is there anything I can do to see debug messages other then having to copy the apk to my phone and testing it?
Thanks in advance!
You have a few options for viewing the debug log output, assuming you have the SDK installed and your command path set up correctly:
Type adb logcat. The log output from the connected device or running emulator will appear. I usually prefer adb logcat -v time to see the time stamps.
Type ddms. This launches the stand-alone version of DDMS. It has a logcat display at the bottom.
Install the ADT extension for Eclipse, and open the logcat view. (Since you're using NetBeans I assume this isn't what you want to do, but I'm mentioning it for completeness.)
In all cases, the interaction is the same whether you're using a physical device or software emulator, because the ADB daemon conceals the details. Whatever you're doing for the device is also expected to work for the emulator.
If you have a device and emulator connected simultaneously, you can use adb -e logcat for the emulator and adb -d logcat for the device. From stand-alone DDMS or Eclipse, just pick the device or emulator from the pop-up menu.
If you have setup nbandroid you can find the adb logcat viewer in netbeans under:
Window -> Output -> ADB Log
--edit
Just followed up on the post above and started using C:\Program Files (x86)\Android\android-sdk-windows\tools\ddms which is alot better then the one in netbeans.
The SDK comes with a handy tool called ddms it should be in the tools folder of the SDK.
At the moment an Emulator is running, or a mobile phone is connected to your machine it should show up in ddms and you can see all the log output in ddms.