Stuck At Initializing ADB - Android Studio - android-studio

My Android Studio Logcat is stuck and does nothing. It displays Initializing ADB and does not show filtering options and does nothing

Invalidated Caches and Restart did the trick. If is solved now. Thanks for your comments and answers.

Few solutions i tried and which worked for me in different times :
Go in devices view, delete the device and create a new one.
Kill the adb through command line
Before you execute the commands in CMD make sure that you added the adb tool to your Environment Variables path.
Killing adb
adb kill-server
Starting adb
adb start-server
other way of killing adb is Go to task manager->processes and kill the adb.exe process.
Even after doing all these if it prevails, the final thing i did is restarted my whole machine so that adb process is removed from RAM.
Hope it helped :)

Related

Buildozer, WSL adb not finding device, adb in Powershell works

I have a python program using PySimpleGUI. It works on Windows, a pure Linux machine and it also works on the WSL. I'd like to use it on my phone(Pixel 7 pro). Buildozer makes the apk file but during the process 'buildozer android deploy run logcat' it runs the adb devices cmd and finds nothing. The adb devices from a PowerShell works fine. It probably has something to do with the virtual machine WSL provides. I've queried google and read pages of information and suggestions and nothing so far works.
Please let me know if I can provide anymore info that will help solve this.
I've tried running the adb in the build environment manually, outside build script of buildozer, with the same results, no devices found.
I'd like to move on the next step of trying or troubleshooting the app on my phone.
Thanks in advance, Craig

When I start the ADB, system completely freezes

When I start the ADB in command line:
$ sudo adb start-server
I get message like this:
* daemon not running. starting it now in port 5037 *
* daemon started successfuly *
And after this system(Ubuntu 16.04(x86_64)) completely freezes.
How I can fix this problem?
UPD: I run
strace adb start-server
and get, which system freezed on command nanosleep.
on my system i have solved my problem with plugging in laptop power.
when my laptop is connected to power cord. adb works. and when i is on battery its gonna freeze.
i think this is something with Acpi.
another solution:
to start using adb when i am on battery:
sudo tlp ac
and when i want to quite:
adb kill-server
sudo tlp start
Try upgrading to 16.10 and make sure you have the following set in your BIOS:
- From Legacy to UEFI boot
- Disabled USB 3.0 legacy
Ref: https://ubuntuforums.org/showthread.php?t=2313496
I choose poprietary driver and this work, but not all time, sometimes this problem repeated.
I was having the same problem on my archlinux system (with ANY version of the kernel).
The problem for me seems to be the usb auto-suspend function of tlp. I've disabled it completely setting:
USB_AUTOSUSPEND=0
And for the moment it seems to have solved the problem.
EDIT: It wasn't the usb autosuspend i had to uninstall completely tlp to make it work until i can investigate this further.
Fo me, it was tlp
Edit the conf file at /etc/default/tlp
I did
USB_AUTOSUSPEND=0
and
USB_BLACKLIST_PHONE=1
Maybe you don't need to put USB_AUTOSUSPEND=0
EDIT: doesn't seem to work anymore.

android studio doesn't detect my device on my ubuntu laptop

I am trying to run an app from Android Studio on my Ubuntu laptop.
I have enabled USB debugging, but it is still not working.
When I press run in Android Studio, it does not detect my device (LG G3 Lollipop).
I could not find any help :(
First of all,
Open terminal and do following:
Do lsusb command to check your device is indeed connected.
Do adb devices to check if your device is connected then it is detected as in adb mode.
2.a. if the above command is not found, do sudo apt-get install android-tools-adb and then check if it is listed.
Secondly, post results of step 1 and 2 with your question to help us in finding a correct solution.
Troubleshooting:
Make sure adb mode in enabled.
Make sure you have opted for Allow option when prompted for in your device upon connecting to your ubuntu system.
This one is from some past LG users, Try connecting your device in PTP mode rather than MTP mode, it surprisingly works.
If it atill doesn't work, (most likely your case), try googling. I landed upon this page by pressing I'M FEELING LUCKY, you should try to feel lucky once in a while.
Source for step number 3 and 4
follow the steps as mentioned upon page:
Create a file: /etc/udev/rules.d/70-android.rules.
Write: SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666" to the file.
Assign proper permission via sudo chmod a+rx /etc/udev/rules.d/70-android.rules
Reboot the system and restart udev.
As a second step of troubleshooting (make sure you again repeated troubleshooting from step1 in case you failed at this step)
Again, the process:
Create a file: /etc/udev/rules.d/51-android.rules.
Write: SUBSYSTEM=="usb", ATTR{idProduct}=="1004", MODE="0666" to the file.
Assign proper permission via sudo chmod a+rx /etc/udev/rules.d/70-android.rules
Reboot the system and restart udev.
Make sure you have adb installed in your ubuntu system.
If not then type -
sudo apt-get install adb
Provide your system password and press 'Y' asked during installation process.
Then disconnect your device through USB and then reconnect it.
You will have to grant permission for debugging which prompts on your device just after reconnecting.
I faced the same issue but it was my mistake. I didn't turn on the " USB DEBUGGING MODE ".
Settings > Developer Option > Enable USB Debugging Mode.
Try to revoke USB debugging authorizations and then connect your device, it should show permission prompt for authorization.
go to
settings -> developer options -> revoke USB debugging authorizations.
I tried restarting adb using root priviledges and it worked for me. Use these commands in the terminal:
sudo adb kill-server
sudo adb start-server
Hope it works for you too...
For my situation with Ubuntu 16.04, with my device properly connected via USB, confirmed by lsusb
The solution is let the Studio aware of the Android/Sdk folder by defining
export ANDROID_HOME=<the Android/Sdk folder>
in ~/.bashrc
(I have installed the SDK at a custom location)
Then start a new shell, from there re-start the studio, then it works.
I solved with this: https://stackoverflow.com/a/37109216/5081063
If the problem is only on Android Studio and not in your OS you can solve with that.
So first check if adb recognize any devices with:
$ adb devices
If yes, open Android Studio and follow these steps:
Go to Run > Edit Configurations...
Under Deployment Target Options select Show Device Chooser Dialog from the drop-down-list
if you are doing it first time in Ubuntu Linux, then Use sudo apt-get install to install the adb package. This gives you a community-maintained default set of udev rules for all Android devices.
or, use
sudo adb kill-server
sudo adb start-server
and check using
sudo adb devices
you can also check uncheck the usb debugging option, in your developer option in the phone.
follow this link for more info.
Run apps on a hardware device
Enable USB Debugging from Settings->Developer Options
Enable Developer Mode by clicking on build number several times
My device appeared as unrecognized and when I ran adb devices fom android-tools directory it said: adb not a command. Strange. So what I did is installed adb tools additionally and then run adb devices:
sudo apt-get install android-tools-adb
89LY0810Y unauthorized
Then I saw the dialog on my device and selected: Always authorize.
Please make sure your device is in debug mode.
If you have tried many terminal commands to connect your physical device to android studio in ubuntu and you failed to connect try this :- Connect your device and change your USB preference(device notification) to PTP,android studio will detect your device.see this image
I had the same problem, as I had enabled the USB Debugger but it was my first try so I didn't know what to expect. If you answer "yes" to "use as storage device," you will set it to mtp, if you answer no, after that you will have the option to connect on debug mode and it will appear.
I was using a Samsung A31 and Debian
After trying a lot of different solutions, I notice that the problem was my cable, so I changed it and now it works.
Thanks to RazorHail Answer.

Linux Android ADB and AVD emulator connections

Right now, I have my Android SDK and ADB set it up on my Linux system. I have created an emulator under Android AVD Manager and it runs. The problem is that I am trying to connect to an emulator using ADB shell but every time when I do
adb devices
there is nothing being listed under the command. But when I physically connect an Android device into a computer, adb is able to recognize the physical device.
I have tried
adb kill-server
and
adb start-server
I have also ran everything under ROOT privileges and can't happen to narrow down what is the problem.
If you haven't already, please enable "USB Debugging" in the the emulated Android instance. If you already have, what is the output of lsusb? Are the ports open? Scan 5037 and 5500-5600 on the emulators IP address (assuming you are using a UNIX-based OS and have networking enabled in the emulator).
(see also: https://developer.android.com/tools/help/adb.html)

Can't get started with Android Studio for Ubuntu ADB error

I keep getting this error when I start Android Studio (AS) (I am not running Eclipse). I am running Ubuntu; I did a fresh install of Ubuntu and AS and this happened upon start up:
ADB not responding. If you'd like to retry, then please manually kill
"adb" and click 'Restart'
I have tried this solution: ADB Not Responding - Wait More or Kill adb or Restart (Ubuntu 13) 64-bit
and this: Adb not responding with android studio on Ubuntu as well as the duplicate link that follows.
I tried making an AVD and it doesn't want to run on there. I double checked that ADB is added to my PATH.
Is there more information I can provide? Any response with information or questions is helpful.
In a terminal, type ps -u (your username), find the pid, and type kill -9 (pid). If that doesn't work, use a higher number, such as kill -15 (pid).
When this happens to me I usually do ps -ef to find out adb pid, and then kill -s 15 <adb_pid>. After that everything works fine.

Resources