How do I select the device LogCat is showing in eclipse? - android

I'm using eclipse for Android development. Often I have several emulators (and devices) running in order to test my app.
LogCat magically switches to the log from the device I just launched the app on. This is fine most of the time, but sometimes I want to switch back to a different device without restarting an app.
I can't figure out where to select which device LogCat is showing. Where can I change it?
I'm using Eclipse Juno on OS X, if that makes any difference. Here's what my LogCat window looks like:

Go to Window -> Show View -> Devices.
Now you'll have another devices tab present, and in that you can select which device you want to see in the LogCat, as well as the running apps on that device in debug mode.

Related

Reboot Android Emulator

I have Android on a Pixel 5 on the standard Android Emulator inside Android Studio. I just want to restart the phone using the power button like a normal Android user. However, clicking the power button just makes the screen go blank like this:
Clicking it again just wakes it up, and holding it down brings this up:
Most of the documentation I've seen tells me to do a cold boot, but when I do, I see this.
So, I delete these two files and try cold boot again. Android Studio displays some text that says something like "Start AVD now" but nothing happens. The phone does not restart.
I cannot find any way to restart the OS. It's jammed in one spot. I've deleted and recreated image after image without any way to restart the phone. Any help would be much appreciated.
Clicking on the dots menu on the emulator row on Device Manager you will find the option Cold Boot Now.
Alternatively, you can use
adb reboot

My Emulator won't unlock

I created a brand new emulator today but it is behaving weird today. Here is my setting:
When i start it up, it loads fine. Until it gets to the lock screen. I keep on dragging/swiping from bottom to top to unlock, but it wont! This is the first time I encountered such behaviour. I tried with target Android 6.0 - API Level 23 but was able to unlock. I want to test my app on Google API 23. Please help to figure out the proper setting values.
Happened to me as well.
Another solution in addition to what #TTRansmit suggested is as below:
Close emulator.
Go to AVD manager screen, edit your Emulator and go to Advanced Settings.
Select Cold boot as Boot option located in Emulated Performance section. This way you will be able to restart your emulator and get it unlocked without loosing data.
Power off (via holding power) on the device buttons and wipe data (from Android Virtual Device Manager) worked for me. It was turning off the Device Frame from the edit/Virtual Device Configuration screen of AVD that seemed to cause the problem.
I still did not solve this problem, somewhat. To get thru, what I did was I activated the Camera emulation then relaunched the emulator. On the lock screen, I dragged the Camera icon. The camera would crash and emulator would notify you about it thru a pop up dialog. Once you exit the dialog, it will go back to your homepage UNLOCKED! I know, it was weird but it worked.

How to change target emulator in Android Studio?

I have several genymotion emulators for different API levels. The problem is this:
I run the app on a single emulator with the option 'same device for future launches' checked.
I open another emulator.
I run the the app again.
After this, the app only runs on the first emulator and I can't figure out how do I show the dialog (select target) again to run the app on both emulators.
Click Run → Edit Configurations...
Then uncheck Use same device for future launches
As mentioned by #B-GangsteR, you can also launch your app on multiple devices at the same time. To do this, select targets using ctrl key.
Note that even if "Use same device for future launches" is unchecked, you can't launch app on other device while it is still running on first device. So you've got to
terminate app on first device before running on another device,
or kill adb process (it will restart),
or run your app on multiple devices at the same time from the start (when choosing target, select multiple targets using 'ctrl' button or 'ctrl' + A)
In Android Studio 3.5 or above, the "Deployment Target" part of the configurations dialog has moved into the main toolbar.
Click Edit config beside run app.
Close the existing running app in all emulators to have this option even if the problem persist after doing configuration changes
You can change profiles by going to "Run" -> "Run..." -> "1.app" (click on the arrow) -> "Profile", then choosing which device (virtual or physical) you'd like to run on. This took me a while to find and I couldn't find anything like it in the answers above, so hopefully, I help someone out.
You can hold ctrl to select multiple devices (mentioned by #B-GangsteR).
In Android Studio 3.5, need to click on the Emulator name which is the left option of Run 'app' button.
You can select specific Emulator of your choice or multiple Emulator as well.

Android app wont run in device

I have an app in development that runs fine in the emulator but wont run on any android device, when the application icon is clicked the screen goes blank for a second then returns back to the device apps page, i have experimented with setting different permissions but it does not seem to solve the issue. Any ideas?

android eclipse avd

I'm a newbie that needs some help on getting the AVD running with my app. I've been developing C code for decades, but I have to admit the Eclipse/AVD setup has me stumped! I'm following the 'HelloWorld' tutorials on the developer.android website (and some others) and everything seems to be working OK, up to the point where I try to run it on the AVD simulator. I'm not getting any warnings, the Eclipse build/run output window says that everything is installed OK and the AVD does startup and run. Eclipse says that my app is loading, but it never runs. All I get is the simulator window with "ANDROID" on the screen and the buttons on the right-hand side.
I've got Eclipse Indigo and r18 of the Android PlugIn (I tried to install Helios, but the Eclipse website directed me to Indigo!). Is Indigo OK for running the simulator, or do I specifically need Helios? I also have Java 1.7.
The API level I have installed is Level 15 (v4.xxx of Android, I think). Don't know if I need a lower version to get my tutorial app to run, but level 15 is the only one I can select when setting up a device in the AVD manager.
I've been trying to get this going for days, trying all sorts of switches and buttons, but to no avail. Before I start uninstalling everything and reinstalling, can anyone advise if there is anything I might be missing, or has tripped over this problem themselves and found a way around it? Something that always trips up new starters maybe? Or do I need to go back to scratch?
Any help would be much appreciated.
How long are you leaving your emulator running after you attempt to launch your application? The Android OS can take a long time to boot up in the emulator. If it's stuck on the "ANDROID" screen then you're either not waiting long enough or there's something wrong with your emulator. It should eventually boot into the normal Android lock screen or home screen just like a device.
You can launch your emulator ahead of attempting to run your app by opening the Android Virtual Device Manager (toolbar icon in Eclipse, if installed properly) and then selecting an emulator and clicking the "Start" button. If you don't have any emulators listed, then you need to create one by clicking the "New..." button.

Categories

Resources