adb error:device not found [duplicate] - device

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
adb cannot find my device for Android debugging. Why?
i am new to android development. i am getting "adb error: device not found" in my command prompt when i am using this command "adb shell" .. i am using eclipse with android sdk in windows xp..
What i did is i was updated my android sdk version 2.2 to 3 .
before this updation it was working perfectly but after updation it is showing "adb error: device not found"
Can any one please help me

At least in the version of androidSDK I downloaded it says that the adb has moved folders, now you can find it in android-sdk/platform-tools instead of android-sdk/tools
You need to reconfigure you environment_variable path to this new path and it should fix it.
You can check if your adb is working by running
$adb devices
A list of your connected devices should appear (check that you DO have connected devices). If the message "adb is not recognized as an internal or external android" you didn't set up adb correctly.
Try rebooting and take a look at this post it could be helpful
I hope it helps!

check if your emulator is running and/or your device is plugged into the usb port, if it is a real device, also check wheter or not usb debugging is activated

Related

Failure [DELETE_FAILED_INTERNAL_ERROR] When running Xamarin.UITests on the new Android 10 OS

There appears to be a console error every time a Xamarin UI test run on my Pixel with OS 10 on it. The error is as follows "Failure [DELETE_FAILED_INTERNAL_ERROR]" The error does not seem to stop the application from running it more of a question as to why it's occurring and how to fix it.
Thank you for any information.
I think we worked together!
Your Xamarin UITest might be trying to delete some system app using pm uninstall. But if it instead uses
pm uninstall --user 0 com.android.service or adb uninstall --user 0 com.android.service (without opening adb shell), the command is issued as root. So without the extra tags, you should get the error.
To be safer, you can try to find the problematic system app and just disable it in the settings.

ADB Failure: Error: must either specify a package size or an APK file

I'm trying to install an apk via adb on a mac. It's not my mac, but they have adb and it sees the rooted phone correctly (verified using adb devices, so I know adb works, too).
However, when I try to install the app:
adb install [app_name].apk
I get the following message:
Performing Streamed Install
adb: failed to install [app_name].apk: Error: must either specify a package size or an APK file
I know the file is an apk, it is a good version (I've installed it successfully on other phones using other computers), it downloaded completely, and I am in the same directory as the file. It is also spelled correctly (I even tab-completed to be sure).
I can't seem to fine any real google results on this error, however. Does anyone know what might be causing it? How to fix it? Thanks in advance!
So the issue here appears to have been a file-format error. In this case, the apk didn't download all the way to the computer, even though it looked normal. Therefore, it wasn't registering as a true apk. By deleting the file and redownloading it to the computer, I was able to successfully install the app using adb.

PnPutil commands to uninstall the display adapter driver does not work

I am currently trying to uninstall display adapter driver in power shell.
I can simply go to device manager to find display adapter and uninstall the driver and then install the new driver. But I want to write an automated script to make it easy.
I tried to use "pnputil.exe -f -d oem##.inf" in power shell to uninstall the display adapter driver.
But it did not work and gave me something like that
"Deleting the driver package failed: One or more devices are presently installed using the specified INF"
Does anyone know how can I solve this problem and make pnputil work?
This isn't a PowerShell question really, as it's a window util.
from running pnputil /?
/delete-driver <oem#.inf> [/force]
Delete driver package from the driver store.
/force - delete driver package even when it is in use by devices.
so running pnputil.exe /delete-driver oem##.inf /force should work for you.
Example removing a device using the driver first on the commandline with devon. Devon comes with the Window SDK. Windows SDK - Windows app development _ Microsoft Developer The pnputil command should work after that.
devcon remove "HDAUDIO\FUNC_01&VEN_1013&DEV_4206&SUBSYS_106B0600"

Could not initialize SDL(No available video device), qemu-system, Windows Subsystem for Linux

I'm learning how to write a basic OS kernel with intermezzos.github.io
I'm running in Windows Subsystem for Linux on Windows 10 v1607.
I'm at the point where I want to run my .iso with qemu-systems-x86_64 -cdrom os.iso.
Previously I was able to run the command and QEMU would run a window, which was running into another problem, posted here: QEMU, No bootable device, Windows Subsystem for Linux
Now when running the command, I receive the following error: Could not initialize SDL(No available video device) - exiting
When I ran into this problem before I installed Xming, ran it, and then QEMU successfully ran. But now, when I try to run Xming it no longer solves the problem.
I even tried installing xorg and running startx on WSL but that starts another issue: xf86OpenConsole: Cannot open /dev/tty0 (No such file or directory)
I really don't know what I'm doing and I have so many questions.
I'm under the impression that for QEMU to successfully run, it needs to be able to find a video driver. Is that the purpose of X11?
I am able to get qemu-system-x86_64 -cdrom os.iso to run the expected window after setting: export DISPLAY=:0
Partially solves my problem because I'm still running into QEMU, No bootable device, Windows Subsystem for Linux
I'm wondering if I'm setting the DISPLAY environment variable correctly.
Here's documentation on the DISPLAY variable, for anyone else that wants to learn: http://gerardnico.com/wiki/linux/display
Anyway, this portion is solved!

Permanent removal of all IMEs?

I use Ubuntu 12.04, 64-bit, Acer Aspire One D270
I gave these commands
adb shell mount -rw -o remount /dev/block/mtdblock0 /system
adb shell rm /system/app/PinyinIME.apk
adb shell rm /system/app/LatinIME.apk
adb shell rm /system/app/OpenWnn.apk
and thought they were lethal weapons in getting rid of the thorny IMEs installed in the emulator, thereby enabling me to work solely with the hardware keyboard and saving me the trouble of going to Language and Keyboard settings each time I start the emulator and disabling the IMEs.
But I had never imagined that there would be even the remotest chance that all the IMEs (but for the sample soft keyboard which I removed using adb uninstall) would be back and enabled once I restarted the emulator for next use!
How to make the adb shell rm command permanent? It seems from this that the removals using uninstall are permanent. So I tried using the adb uninstall command to uninstall the other IMEs:
aneesh#nb-14:~$ adb uninstall jp.co.omronsoft.openwnn
Failure
aneesh#nb-14:~$ adb uninstall com.android.inputmethod.pinyin.PinyinIME
Failure
aneesh#nb-14:~$ adb uninstall com.android.inputmethod.latin.LatinIME
Failure
Why does this not work?? If none of the above is answerable then consider the following: In light of the fact that all the IMEs are reinstalled, it's obvious that theire installation is part of the booting process of the emulator. Can someone help me to remove these IME installation commands from the boot process??
I want this pain-in-the-ass killed because, if after inserting an emoticon (whatsapp) I change the position of the cursor to insert some text, I find that the cursor remains there for 3 to 8 seconds and goes back to its original position and the honourable dignitary, Latin keyboard comes up. Then it lets me insert text wherever I want until I again want to insert smileys. But this initial fuss each time I change cursor position does not augur well with me!
Snapshot enabling option is missing! Screenshot below:
As a result it's not surprising that even the Launch from Snapshot and Save from Snapshot options are disabled:
When I create an emulator from the latest version it still shows the same options as in the first screenshot in this question, no emulation options. Really strange! Been updating to newer sdk versions but never saw this development!
You cannot use adb uninstall on apps installed in the /system directory.
If those apps are "reappearing" after you restart the emulator, I would imagine it is because your emulator is not using snapshots, to save the current state when it closes.
If you are using Eclipse/AVD manager to manage your emulators, take a look at the pictures below. If you are using snapshots, and the apps are still restored, please comment or update your question. Then we can look for an alternate solution.
Enable snapsots when creating emulator:
Launch emulator from snapshot:
Images courtesy of: http://tools.android.com/recent/emulatorsnapshots
Edit:
In Ubuntu, you should still have the option to enable snapshots. I tested creating an emulator without initially enabling snapshots, and when I edit-ed the AVD, I had the snapshot option:
I am a little confused, since you have the snapshot option (albeit, not available) in the AVD launch options. Are you using the latest version of the SDK?
Edit 2:
When creating a new AVD, do you have the emulator options?
Edit 3:
Alright, I'm really starting to run out of ideas here. I take it that when you create an AVD you do not have the snapshot options? I updated to the latest version of the SDK manager and I did have them.
Try making an emulator through the command line:
Use:
android list targets
to get a list of target IDs.
Then create the AVD:
android create avd -t 12 -n test_002 -a --abi armeabi_v7a
The -a argument will specify that the emulator should use snapshots. In my case, 12 was the ID of 4.2.2, but it may vary so use the first command to find the ID you want. For more information on command line options see the following:
http://developer.android.com/tools/help/android.html
http://developer.android.com/tools/help/emulator.html
You should be able to add combinations of -help to most of the commands to get additional help info.

Resources