How to open avd amulator when windows starts - android-emulator

I work with AVD emulator and I have to restart my PC again and again because of some updates. so each time I start the pc, I have to run the custom bat file to start the emulator again and that becomes a tidy process to me.
Here is my way to make bat file to open emulator
I have searched on stackoverflow and on other places but couldn't find the exact solution.
Here are some relevant links
Run AVD Emulator without Android Studio
https://developer.android.com/studio/run/emulator-commandline

For Windows Users
Make a shortcut of your bat file
Press Ctrl+R
Write shell:startup (it's a command to reach to startup folders) and press enter.
it will open a location in my case it is like "C:\Users\UserName\AppData\Roaming\Microsoft\Windows\StartMenu\Programs\Startup"
Paste your short cut here and on next start up your bat file will run automatically and will open the AVD emulator.

Related

As soon as I open the Flutter doc file the command prompt opens only for a second and then it get closed immediately

I tried opening the Flutter doc file after installing it on Windows 8.1 Pro. I have only tried double-clicking (left mouse) on the file.
I don't think it is supposed to run flutter doctor the way you are trying.
Usually you open the directoy of your flutter project in the terminal and execute flutter doctor.
Please read the documentation for further information: https://docs.flutter.dev/get-started/install/windows#run-flutter-doctor
I tried opening the flutter_console.bat file by right-clicking and clicking Run as the administrator, it resolved the problem.

Visual studio code integrated terminal unresponsive

I have installed vscode on my ubuntu machine.
Opening it up and choosing Terminal -> New terminal opens up an integrated terminal. However, there is just a white marker where the working directory should be, and it is completely unresponsive. I have read the vscode troubleshooting and search here, but can find anything about it. What is wrong? See image of unresponsive terminal below.

Flutter cannot connect to emulator in VSCode. Waiting for a connection from Flutter

I can see the device list on VSCode in Windows.
And I can select any one.
And the emulator is opening.
But I can see a single message. "Waiting for a connection from Flutter.."
Application does not open.
It doesn't get any errors either. Waiting like this.
Make sure that your API level you're running your device on is the
same as what you have installed on Android Studio.
1.1 Click on the SDK Manager button around the top right corner of AS (The icon is a box with a down arrow next to it).
1.2 Choose the same API level as your device, (When I didn't do this I had a partial install and it took some time to compile), then
click apply and wait for it to install.
We're going to run the project to our avd or mobile device from the directory of ourproject.
2.1 Open up the Command Prompt (preferably as Admin), and chage the directoy to where your project is, the command should look something
like this:
cd Documents/flutterprojects/yourflutterproject.
2.2 Finally type the command flutter run.
Restart the Emulator by holding the power Button and Selecting restart and then try again.
if that failed to work, simply restart your computer.

adb -s <device_id> shell pm clear <package_name> - deletes the app from the emulator

I am trying to clear app's data from several emulators, in a loop inside a bash script.
Doing so from the terminal indeed clears the app's data, but doing so from a bash script will also uninstall the app from the emulator and close the emulator's window (UI).
I don't want my app to be uninstalled as i need to test it.
Is there a reason that this command works differently when executed from terminal vs. when executed from bash script? When executing from a script against a real device it works perfectly as it should - clear the app's data without uninstalling the application from the device.
I found the answer.
When the emulator is open (with GUI) - the command will work as it should, that is clear the app's data.
When the emulator is open without GUI - the application will also get uninstalled.

Chrome remote connection connects but then drops out

I am really struggling to get Google Chrome Remote Debugging to work! I have the phone setup and confirmed:
Then below are what I see in chrome://inspect/#devices and also F12 (both open at the same time);
It flashes with the "Connected" for about 3 seconds, and then goes to:
Offline
ZX1G324RSV Pending authentication: please accept debugging session on the device.
It's driving me nuts, as it should be simple to do, but it just doesn't want to play ball :/ Do I need to do anything special? I've used it before on this PC and although I had some fun and games with it the first time around, it worked after that.
There seems to be a ton of posts/articles about how to fix it, but none of them are working for me. https://bugs.chromium.org/p/chromium/issues/detail?id=450492 for example.
Download Android SDK here ("SDK Tools Only" section) and unzip the content.
Run SDK Manager.exe and install Android SDK platform tools
Open up the Command prompt (simply by pressing the windows button and type in cmd.exe)
Enter the path with ex: cd c:/downloads/sdk/platform-tools
Open ADB by typing in adb.exe
Run the following command by typing it and pressing enter: adb devices
Check if you get the prompt on your device, if you still can't see your phone in Inspect Devices run the following commands one by one (excluding the ") "adb kill-server" "adb start-server" "adb devices"
Here are the things that you can try:
Try different USB cable(s)
Try different USB ports on your machine(for some people using 2.0 port worked out)
Try the same process, with unchecked 'Discover USB Devices' in chrome://inspect (then Chrome will connect through the ADB server, not directly) ==> This solution worked in my scenario.