In Android Studio on Run 'app', the emulator stays behind the Android Studio window, so to get it focused I have to hit Command+Tab.
Is there anyway that emulator window gets focused automatically once the app build/launch process is finished.
Its the default behaviour of Xcode, after the build process finishes, simulator window comes on top of Xcode.
I don't believe there is. I have just gotten into the habit of immediately clicking on the emulator once I hit run. Could submit feedback and ask for this to become a feature though! I'll be doing that.
Related
I installed VS2017 a few days ago, created the simple app Build your first Xamarin Forms App, and now I want to debug.
I am having issues with the default Android emulator created by the VS2017 installation (Android_Accelerated_x86_Oreo) so I created a new emulator. This is the screenshot.
How can I change the default so it debugs in the newly-created emulator?
I wanted to point out that I'm new to all of this, so I would like to run it without having to install anything else. I would like to see something run before I install anything else.
I also wanted to point out that I've tried clicking on "Start" on either one of them when not in debug mode, and I get Could not start emulator. Unable to load DLL 'DismApi' error.
The only way it automatically starts is if I hit F5 and the emulator window pops up. Then I go to Tools > Android Device Manager and the default emulator says "Stop" (it's running). If I click on "Stop" and then press "Start", I will get the same error again: Could not start emulator. Unable to load DLL 'DismApi'.
Where you launch the debugger just click the arrow pointing down to open the dropdown. Then select you new device. It will stay as you default device. Please see the image for reference:
Note: You may have to restart Visual Studio for your new device to appear.
Running Your App -> Run on the Emulator clearly explains how to RUN an app from within Android Studio by launching the emulator.
My question is -
Once I've done that: "How should I STOP the emulated app from running?"
Thought #1 - Use the "Run -> Stop (Ctrl + F2)" option on Android Studio's menu. But, when running my simple Hello-World-type application, that option is disabled.
Accordingly, Ctrl+F2 has no effect.
Thought #2 - Close the emulator window, by right-clicking the emulator's icon in my task bar, and selecting "Close window."
That closed the application all right, but then it seemed to leave things in a strange state.
-- When I tried to run the application again, it gave an error and I had to recreate the project.
That happened repeatably.
Thought #3 - Try shutting down the (emulated) Android device.
I tried that on Saturday evening: I held down the (emulated) Power button. Clicked the option in the "Device options" window.
It's now Monday morning, and it still says that it's "Shutting down...".
So, "How should I stop the emulated app from running?"
Thank you for any suggestions/help you can provide.
Russell
I now see that I had asked the wrong question.
I should have asked how to stop a running emulator.
Although I had been able to do so by right-clicking the emulator's entry in the task bar, and selecting "Close window", that had SEEMED to cause some problems.
["The selected device is incompatible" was displayed in the "Device Chooser" dialog.]
So, I thought that was the wrong way to do it.
Since then, though, I think I've figured out that something else was causing my problems:
I had an Android emulator process (emulator-arm.ese *32) which
hadn't terminated properly.
When I selected another device, I hadn't
given the (slow) Android emulator enough time to clear the "The
selected device is incompatible" error(s).
The problem process stayed in Windows' Task Manager after I shut down Android Studio, and Task Manager's failed to kill it.
So I rebooted my PC, and now everything seems to work OK.
Use the multitask button on the emulator itself to open the list of running apps, then click the "X" to close your app.
I am using Android Studio 0.9.9 and Genymotion 2.3.1.
When I press run app in Android Studio, the Android Studio will allow me to choose to deploy my app in Genymotion which I usually do.
At this point, the app is running.
Let say at this point, I want to make a change in the code.
I saved the changes in Android Studio.
How do I reload my changes and redeploy the app without rebooting the Genymotion?
EDIT
Ultimately, just upgrade to latest stable downloads of Android Studio was the solution.
Press F1 in Genymotion and click on "Reload JS" incase of react-native app development.
Press F2 for Android Studio emulator.
First as eyal-lezmy mentioned you should download Android Studio 1.0.2 Stable edition, (you always want the latest edition, especialy if the IDE is that fresh as Android Studio is.
If I understood correctly you want to erase and re install your application from your emulator. To do so,In your emulator, go to Menu-->Settings-->Apps, then choose your application and unistall it. Then, go to Android Studio and run your applciation.
Edit considering your comment
Reload being the fact that if my app has a button in activity A, and I press it, and it opens activity B, and I go back to Android Studio to type a comment, I want to reload the app and it auto starts right back at activity A.
If you make any change to your code, then to see in in action you must re-run the application. However, if you want your default starting activity to be Activity B, then you should go to your manifest file, remove this from Activity A code:
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
and place it inside the activity B code, where you want your application to start from.
-Turn off the emulator
-In Genymotion Window click the settings icon infront of the device name
-under "Android system options", check the "Show Android navigation bar"
-click ok and start the emulator
You will get the navigation bar from where you can kill the app
I have met a similar problem in Android 2.3.7 under Genymotion. I just closed the application before starting
If you only need to reload (refresh) an application on your Genymotion mobile device emulator and see your last changes in the code, you are going to do the following:
Go to the window of Genymotion virtual device, that you run yet;
Point cursor on the top bar with ᴧ Expo logo
Make left click mouse and hold it
Move cursor to the refresh symbol ↻ and push on it
You actually don't really need to do nothing.
When you click on the IDE's button to build and deploy your app. Android Studio will close it, install it and then run it again including your changes.
What's happening on your side?
Btw, I really advise you to update Android Studio, since the 1.0 version, the soft is very stable and behaving really as expected.
I'm a complete newbie trying to learn how to write an app. I'm trying to run Hello World using the emulator in Eclipse on my Mac. I launch and unlock the emulator. Android Training then implies that I should click the Run icon in Eclipse. But the ADT Manager window is in front of the Eclipse window and Eclipse is disabled. If I minimize the ADT Manager window it just quits the ADT Manager, and then I must close the emulator window.
I did discover that I can run the app with the Run button without starting the emulator as a separate step, although that takes a long time to get going.
Another Answer implies that I can just rerun the app by clicking the run button again, but I can't do this because the Eclipse window is disabled.
I'm used to being able to use the IDE while a program (Yes, I'm an old programmer) is running. What am I missing?
Duncan
You're right - simply hitting run on the application cold turkey takes forever because the emulator has to initialize. When you click on your AVD Manager (where you can create, edit, and customize the android emulator you'd like to use), Select the emulator you'd like, then click Start.
After waiting for the emulator window to popup, just wait until the UI loads (when you can unlock the emulator).
At this point, it appears that the AVD Manager is still necessary (due to the "loading" type green bar along the bottom seemingly feeding the emulator), but you can just close the window, and the Eclipse window will become clickable again.
Now, you can just leave the emulator running. I typically leave it running for hours at a time (even overnight) and I can usually just click Run as Android Application and everything works perfectly.
I'm getting started with Android development and with Genymotion. It's difficult to get Genymotion to install a .apk and run it more than once. Here's what I'm doing:
Begin with Genymotion running.
Press Genymotion icon in Elipse.
See Genymotion Virtual Devices Manager. Note that State of my VM is on
Create a new Android Project
Press the green Run button
See Run As dialog. Select Android Application
See Android Device Chooser. Select Genymotion_nexus_one
See hello world app run. Press GM home button
From here if I change the app, it's difficult to get the app to re-display in the emulator:
Drag a button to activity_main.xml. Save.
Press the green Run button
Nothing happens
To get the app to re-display requires jiggle the Handle type actions:
If I Clear the console log or bring up the GM Virtual Devices manager, before I press the Run button, the app will generally display in Genymotion.
Any ideas how to make Genymotion behave without Jiggling the handle?
I'm running the latest SDK: 20131030 on OSX 10.7.5
Drag drop apk on Genemotion emulator ,it will automatically installs and creates a shortcut.enjoy.
run in command-prompt :
adb install your_app_name.apk
:-)
Solved:
Since installing the adt-bundle-mac-x86_64-20131030, I'd never right-clicked the Run button to display the drop-down menu there. Having done that once, pressing the Run button now brings up Android Device Chooser every time (as it should).
When I first ran into this problem, I reinstalled adt-bundle-mac-x86_64-20131030 and Genymotion. I saw no change in behavior. This appears to be a minor bug in this version of adt-bundle-mac-x86_64-20131030
In Android Studio, if you run your project (shift+F10) when Genymotion virtual device is running; you'll see the device in connected devices list in Select Deployment Target window.