Android Studio detects device only after running it the second time - android-studio

I have Android Studio 2.3.2 installed on my Windows 10. These are the steps I have to undergo to get my code working.
Open Android Studio.
Android Monitor doesn't detect any device.
I type adb start-server in the Terminal.
Close Android Studio.
Reopen Android Studio
Now the Android Monitor initializes and detects my device.
Now, I don't want to go through the first 4 steps. What should I do?
P.S I have tried running the adb start-server from command prompt before doing the first step, but that changes nothing.

Related

How to run an emulator through terminal in android studio's tool window?

From android studio dolphin version emulator launched through F10 started lagging (10-20 fps). I still cannot figure out why it happened. But launching through the terminal with -avd [avd_name] -gpu host parameters an emulator now working at around 60 fps.
But I want to start an emulator in android studio's window tool
The following terminal command doesn't work and it just opens files like these
So... how to solve this problem?

Can't run Android Studio's Emulator

I guess it was because after run instrumented test file so become can't open Android Studio's emulator?
But I am not sure.
Error message:
Launching 'app' on No Devices.
Error while waiting for device: The emulator process for AVD Pixel_4_XL_API_30 was killed.
I used follow solution solved this problem.↓
Tools -> SDK Manager -> SDK Tools (tab) -> Deselect 'Android Emulator' -> OK
Now, when you try to run your app, or launch device from AVD Manager, it will give the 'Install Emulator' error -> Click Ok. This will automatically download the correct version.
I experienced the same problem with emulator version 30.6.4 and Android Studio Arctic Fox 2020.3.1 Canary 15. I tried switching from Intel HAXM to Windows Hyper-V and re-installed all android build tool and emulator packages. Afterwards it worked for a day.
The second thing I tried is manually installing an older version (30.5.5) of the emulator which you can get from here. Now Android Studio does not recognize my manual installation of the emulator and I can not start the AVD from the UI. However I can start it via cmd and install apps from within android studio without crashes (at least for the moment).
Start your AVD with the following command (android/sdk/emulator):
emulator -avd <name-with-_-instead-of-spaces>

How can I run the Android Emulator in Android Studio without opening Android Studio?

Is it possible to open/run an emulator that was created from avdmanager without having to open Android Studio? i.e. Having a start menu shortcut that starts the emulator, without Android Studio opening. I know that avdmanager is not totally dependent on Android Studio, because it is possible to close it while the emulator is running.
Follow the steps in developer description.
Under Windows the emulator is installed in C:\Users\<username>\AppData\Local\Android\android-sdk\emulator The created images are located under C:\Users\<username>\.android\avd.
Example PowerShell:
C:\Users\johndoe\AppData\Local\Android\android-sdk\emulator> .\emulator.exe -list-avds
Nexus_5X_API_23_arm
Nexus_5X_API_23_x86
C:\Users\johndoe\AppData\Local\Android\android-sdk\emulator> .\emulator.exe -avd Nexus_5X_API_23_x86
1.) Navigate to %AppData%\Microsoft\Windows\Start Menu\Programs.
2.) Make a shortcut with %LOCALAPPDATA%\Android\Sdk\emulator\emulator -avd "EMULATOR NAME" being in the location.
In order to find the emulator names run %LOCALAPPDATA%\Android\Sdk\emulator\emulator -list-avds from command prompt.

Genymotion starts 3 instances of adb when running [duplicate]

This question already has an answer here:
Is ther any collision between Genymotion and hardware device on Android studio?
(1 answer)
Closed 5 years ago.
Genymotion starts 3 instances of adb when running. I want to use adb console for manage emulator and phone.
When I try type:
$ adb shell
console output this:
adb server is out of date. killing...
cannot bind 'tcp:5037'
ADB server didn't ACK
* failed to start daemon *
error:
When I kill all adb processes, Genymotion creates them again.
I have been tried to reinstall adb and Genymotion and it didn't help.
Adb version is 1.0.32, Linux Mint, Android Studio 2.3.1.
Edited
Genymotion use Android SDK tools, not Geny's tools.
The adb version shipped with your version of Genymotion is probably older than the one in your version of Android Studio.
Stop all devices
Open the settings dialog
Go to the ADB tab
Tell Genymotion to use the tools from Android SDK.

Command line Logs in Android Studio

I'm using Android Studio to build an Android app. Is there a windows to show up which adb command lines the Android Studio are currently using? For example, when the Android Studio is launching the app to the device or the emulator, the windows will show up the adb commands to launch the app.
I notice that there is an "ADB logs" windows which show the logs, but I hope to see the command lines that AS is calling.
Thanks!
I finally figured out the way to inspect the adb commands. When launching the app, we can inspect those commands in the Run tap at the bottom of the Android Studio, though these commands are mixed with some other logs.

Resources