Android: fastboot does not find virtual device / emulator - android

I want to flash a special disk image onto an Android Emulator (Google Pixel 2) using adb and fastboot. The virtual device can only be detected by adb but not by fastboot. I already tried (cmd as an administrator):
C:\windows\system32>adb devices
List of devices attached
emulator-5554 device
C:\windows\system32>adb reboot bootloader
C:\windows\system32>fastboot devices
C:\windows\system32>
I am using Android Studio (Android SDK and Google USB drivers are installed properly, i also enabled USB debugging in the emulator) on Windows 10. Is it possible (in principle) to use fastboot together with an emulator? If yes, do you have an idea why it does not work here?

No, you can't use fastboot with Android Studio emulator. AVD does not have a bootloader, it just boots the system and ramdisk images.
If you want to use fastboot, you'll need a real device that supports it (mostly everyone but Samsung's).
You may find more information in this post: how to reboot the emulator into recovery mode

Related

Fastboot devices not showing device

I am trying to unlock bootloader on my Samsung A40 with Android software tools. I have installed software tools through Android SDK Manager in Android Studio.
Adb lists devices:
However when I enter bootloader by typing adb reboot bootloader my device doesn't show with command fastboot devices:
I have tried installing drivers from Samsung site and through Android Studio Google drivers but neither worked. I installed drivers manually through device manager too.
I tried doing same commands in VM with Debian 10 but with same result.
I have tried flashing TWRP with Odin too but I got error: custom binary (vbmeta) blocked by oem lock.
I tried different USB ports too and a different cable.

Nexus 4 not showing in adb Devices

I have recently updated my drivers and I am unable to connect to my Nexus 4.
The nexus is on 5.1. I'm using Windows 7. My HTC desire can be seen listed in adb devices.
I have tried re-installing the drivers. The automatic driver installation installs v7.0.0.1. I don't know if this is the latest version as when I point the installer at \extras\google it says that the current driver is up-to-date.
The phone is in debugging mode, and I have also tried different USB ports on the computer.
Try to manually change/assign the driver in the Device Manager.
Go to Device Manager - Android Device.
Select whatever entry you can find here, then choose:
Update Driver - Browse my computer for driver Software - Let me pick from a List...
Here you should be able to select the proper driver (unticking "Show compatible hardware" should bring some more choices.
If it doesn't work you might want to try using the Universal adb driver (it will be at the "ClockworkMod" manufacturer in the device maanger).
Last but not least, sometimes the issue can be resolved by an adb restart. Just do a adb kill-server, then check again for your device using adb devices
Setting the phone to connect as camera made it show up on adb devices.

Connect USB debugging in AZPEN tablet

I went through this link to connect my tablet with my LINUX machine for USB debugging. It was not working for me. I can able to connect other devices such as CANVAS HD and SAMSUNG smart phones.When trying to connect the AZPEN tablet, No devices are found.
Any suggestion?
I had similar problems with my Azpen A1048 running Lollipop versus Android Studio on Windows 7. I enabled USB debugging on the Azpen, but adb on Windows could not see it. Also, though I could mount it via USB and transfer files, the Azpen never showed up in Windows' Devices and Printers screen.
The tablet did appear under Windows' Device Manager as A1048, but reinstalling Windows' driver for it gave no success with adb. Meanwhile another device called HP 7 G2 seemed to come and go with the Azpen. I initially dismissed it as a phantom but finally used it to make adb work with the Azpen! Here's how:
Install USB Driver Tool *;
Run UsbDriverTool.exe as administrator;
Right click on the HP 7 G2 device;
Select Install Android ADB Driver from the popup menu;
Restart adb from a command prompt using adb kill-server then adb devices -l.
Here is the resulting output from adb:
List of devices attached
033818f698d500000000 device product:astar_h7 model:A1048 device:astar-h7
Also the tablet now appears in Windows' Devices and Printers and Eject screens as "MTP".
I'm guessing the identifier disparities are a slip on Azpen's part, but at least I can deploy to the Azpen directly from Android Studio now.
*I'm not certain USB Driver Tool was a requirement; it's just how I happened to fix this problem.
I had requested to the manufacturer of AZPEN tablet regarding this issue, they told that, there is no such facility available in Azpen tablet. Sorry for the late answer.

Android Fastboot devices not returning device

At the moment I would like to reinstall Android on my device(custom hardware device). I got the image files after building. But when I enter fastboot devices nothing returns.
adb devices is working. It return my device. fastboot flashall -w is also not working. I returns <waiting for devices> and stays like that until I exit.
So the 70-android.rules.d file is right. I have also set ANDROID_PRODUCT_OUT. But someone knows why fastboot does not see my device, but adb does?
Restarting udev or adb does not work. Some people recommend that on the internet.
OS: Ubuntu 11.10
For Windows:
Open device manager
Find Unknown "Android" device (likely listed under Other devices with an exclamation mark)
Update driver
Browse my computer for driver software
Let me pick from a list of devices, select List All Devices
Under "Android device" or "Google Inc", you will find "Android Bootloader Interface"
Choose "Android Bootloader Interface"
Click "yes" when it says that driver might not be compatible
Are you rebooting the device into the bootloader and entering fastboot USB on the bootloader menu?
Try
adb reboot bootloader
then look for on screen instructions to enter fastboot mode.
TLDR - In addition to the previous responses. There might be a problem with the version of the fastboot command. Try to download the newest one via Android SDK Manager instead of default one available in the OS repository.
There is one more thing you can do to fix this issue. I had the similar problem when trying to flash Nexus Player. All the adb commands we working fine while in normal boot mode. However, after switching to fastboot mode I wasn't able to execute fastboot commands. My device was not visible in the output of the fastboot devices command. I've set the right rules in /etc/udev/rules.d/11-android.rules file. The lsusb command showed that the device has been pluged in.
The soultion was quite simple. I've downloaded the the fastboot via Android Studio's SDK Manager instead of using the default one available in Ubuntu packages.
All you need is sdkmanager. Download the Android SDK Platform Tools and replace the default /usr/bin/fastboot with the new one.
I had the same issue, but I was running Ubuntu 12.04 through a VM. I am using a Nexus 10. I had added the usb device as a filter for the VM (using virtual box in the virtual machine's settings).
The device I had added was "samsung Nexus 10".
The problem is that once the device is in fastboot mode, it shows up as a different device: "Google, Inc Android 1.0." So doing "lsusb" in the VM showed no device connected, and obviously "fastboot devices" returned nothing until I added the "second" device as a filter for the VM as well.
Hope this helps someone.
If you got nothing when inputted fastboot devices, it meaned you devices fail to enter fastboot model. Make sure that you enter fastboot model via press these three button simultaneously, power key, volume key(both '+' and '-').
Then you can see you devices via fastboot devices and continue to flash your devices.
note:I entered fastboot model only pressed 'power key' and '-' key before, and present the same problem.
You must run fastboot as root. Try sudo fastboot

Connect USB device to Android Emulator?

We've been looking into Android 3.1+ and its ability to read/write to USB devices connected to the OTG/Host port.
I've found some code examples that allow me to detect and read/write to a USB HID device, but at the moment, I simply don't have a physical 3.1+ compatible device to deploy and remotely debug on.
Does anyone know how I can attach my HID device to the emulator, via the PC/Eclipse so the app can detect and read/write to/from the device?
I've tried listing the currently connected USB Devices but it shows none, as you'd no doubt guess.
Any ideas?
Cheers
The Android emulator is based on QEMU. Even if the emulator version is so ancient, there appears to be support for passing USB devices from the host. It does not seem to be available for ARM devices though, the emulated ARM machine does not have a USB controller. (I have already tried enabling all USB host controllers for the goldfish_armv7 kernel based on Linux 3.4, without luck. The default emulator goldfish_armv7 kernel does not even have Host USB enabled.)
If you are not limited to ARM and can use x86, then I suggest to check out http://www.android-x86.org/, its images can be used with a standard QEMU i386 (or x86_64) machine. This also yields better performance by using the KVM extension on Linux.
To passthrough a USB device with of vendor ID 1234 and device ID abcd, you can run the emulator command:
emulator -avd x86-machine -qemu -usb -usbdevice host:1234:abcd
Or, when using QEMU:
qemu-system-i386 -m 1G -cdrom android-x86.iso -usb -usbdevice host:1234:abcd
You will need read/write permissions for /dev/bus/usb/XXX/YYY, for that you can create a udev rule such as:
SUBSYSTEM!="usb", GOTO="end_skip_usb"
ATTRS{idVendor}=="1234", ATTRS{idProduct}=="abcd", TAG+="uaccess"
LABEL="end_skip_usb"
Now, upon insertion of the USB device, your emulator should recognize a USB device. This is tested for a Linux installation with a Android x86 4.3 image.
AFAIK this isn't possible. Android emulators do not emulate many things that exist in real devices... but this reminds me of an attempt to run ADB over Bluetooth.
This isn't a direct positive answer to your question but perhaps it can help you find a workaround the way I did: Install an "emulator" on a physical x86 netbook (dual-boot) and use the links referred to in my posts to accomplish what you are trying to do via WiFi or Bluetooth.
Hope this helps.
Create android Virtual Machine on virtualBox or vm player with this image.
Connect USB and connect with Eclipse using ADB connect (your device IP).
Installed android guest in virtualbox with Windows 7 host using image android-x86-4.0-r1-eeepc.iso from here (because my company's computer locked bios and I couldn't enable the vt-x emulation I had to install a version prior to 4.4). Then pluged in a usb drive, opened VM - Settings - USB in Virtualbox Manager, clicked the second icon on the right with a plus sign on it, chose the usb drive. Virtualbox then installed driver for the USB drive. After it finished, booted the android VM. Started OpenManager, went to mnt/USB, and files of the usb drive were there!

Categories

Resources