I'd like to choose the emulator to simulate the testing of my android app but when I hit run, eclipse opens a new window with a new emulator. How can I make eclipse run on the emulator that is already open?
Its better to check your run configuration. Check target tab, its sure that your target avd doesn't match your running emulator.
Do one thing, make emulator selection manual instead of automatic. It will let you choose desired emulator or device when there are more than one avds available
Related
I have a problem when I tried to start my AVD in android studio. It was working fine but all of a sudden it just turns black. I have tried to restart my pc but it didnt help. Any solution? Or is there any AVD application that I can use because android studio's AVD is kinda slow.
This also happens to me from time to time. To fix this, open your AVD Manager. Then, click the arrow to the far right. Finally, click Cold Boot Now.
I will say it will be better if you use physical mobile devices and the step to use that is mentioned below:
Pre-requesting:
Android Studio
USB cable
Android Device
Steps:
Enable USB
debugging(Link)
Automatically get device driver install on the system.
Run your app using a connected device. check ou this link
Why I am suggesting to you because this will improve your productivity of coding.
If you want multiple device testing then only go through Virtual emulator such as BlueStack, GenyMotion, AndY which I used and prefer more due to of less memory uses.
You can try Genymotion instead. It is faster than android studio's AVD and easy to use. Also in some cases, you might have riot vanguard (riot games anti cheat system), and you need to uninstall it to use android studio's AVD.
When I run the android emulator it gets stuck on the android animation. After I have waited 1 hour it said "Proccess system is not responding". I've tried to delete it and create a new one but it didn't work. I want to start android developing but I'm about to give up because nothing works. Please help.
Thanks in advance.
Try re-installing the avd. or better still you can use an android device an Emulator, which is better and faster. to use an android device follow this steps.
1. Get an android device and a usb cable.
2. Go to settings on your android device and select developer options.
If your device does not have the developer options, goto about phone and click on Build number 7 times., go back to settings (Developer options would have appered by then)
select developer options, turn it on and enable debugging.
3. plug your device into your system.
4. your phone will notify you on access to degug.. Accept.
5. Close any avd you might have opened before..
6. Run your app..
You are good too go...The app should run on your android device..
BUILD NICE APPPPPPPPPSSSSSSSS
i m starting (or at least trying to) developing android application(s) and I m using eclipse for it along the android sdk.
Now I m wondering if there's a faster way to "test" and tryout something newly writen in the code than starting it in the emulator?
I'm wondering because I m running on 8gb ram and q9550 (quadcore) and it takes some time (let's say 20secs) to upload and start the apk and now
I'm wondering if this really is the only way to test since it requires huge amount of time, especially when I'm trying something new which doesn't work and thus I'm always gotta run it like this let's say like 20 times until I figure out what's wrong with my code...
You can connect your android phone using USB debugging mode and debug your code. If you can't do that, you can export an apk file (which is quick) and use dropbox/gmail to send it to your phone. I am not a big fan of emulator :)
Here's how to enable usb debugging
http://www.groovypost.com/howto/mobile/how-to-enable-usb-debugging-android-phone/
I would recommend running on your device rather than the emulator.
http://developer.android.com/tools/device.html
In short:
Turn on "USB Debugging" on your device.
On the device, go to Settings > Applications > Development and enable USB debugging (on an Android 4.0 device, the setting is located in Settings > Developer options).
Set up your system to detect your device.
If you're developing on Windows, you need to install a USB driver for adb. For an installation guide and links to OEM drivers, see the OEM USB Drivers document.
If you're developing on Mac OS X, it just works. Skip this step.
If you're developing on Ubuntu Linux, there is a detailed guide in the link above.
Now in eclipse, your device should be available to run on.
In the eclipse toolkit, you have the option to run it directly on a device. It's rather quick to do so.
Enable USB debugging as well as installation of apk from sources other than the market. Then assuming you have already setup the required drivers/settings to connect to your phone via ADB, you should be able to run it on the device and debug. In the run dialog, it will list all available devices and you can simply select the one you want to use.
If you already have a run entry (i.e. you've already run your application),
select your project
click Run -> Run Configuration
You should be in your application run configuration (on the left under Android Application -> Your_App).
In the Target tab, you should be able to select your device. It will likely already be in "Automatically pick compatible device...". On my setup, it will run directly on my phone if it's the only available device. You can select Always prompt to pick device which will let you choose every time.
Eclipse plugin (ADT) information: http://developer.android.com/tools/help/adt.html
Information about setting up your device: http://developer.android.com/tools/device.html
I know android emulator is too slow.
You can either use device or
try bluestacks it saves lots of time.
User device only when you want to test your app for particular device.
Here is what you are looking for :
http://developer.android.com/tools/device.html
To summarize:
Plug your phone to your computer with a USB cable.
Make sure the drivers are installed and your phone properly connected.
Make a Ctrl + F11 from eclipse.
It will build the apk, transfer it to your phone and then launch it automatically.
If you have unit tests, Robolectric lets you run them without using the emulator or the device.
you can download bluestacks as emulator, as it is really fast.
after then make settings in eclipse as window->preferences->android->build -> then uncheck the 3rd checkbox written as "skip packaging and...", then apply and restart the eclipse to take effect.
now open the bluestacks in background and just double click the apk file in bin folder of eclipse and bluestack will install it in 2 to 3 secs and you can directly see the result.
NOTE here that you have to only save the file ,you working on in eclipse and only double click on apk, and result will directly appears to bluestacks. Without uninstalling and reinstalling apk in bluestacks.
and you can delete your apk also, it automatically immediately create
a fresh version of apk (thus not required) as soon as you save all your files apk will be updated.
Google BlueStacks.
It runs on Windows and it's really fast.
Why does Eclipse open an new emulator while there is already an emulator opened ?
Sometime it happens, sometime it's not. Does someone knows why ? I hate when it doesn't that and i would like to fix this "problem"
This is caused when your project properties are not setup to run manually and for whatever reason (SDK or Target version) the emulator opens in a new instance.
To Solve: Right Click your Project --> Run As --> Run Configurations
Then, make sure the Project in question is the one selected on the left and the Name is on the top.
You will then see 'Target' at the top:
Choosing Manual should allow you to choose the running emulator. If not, make sure your project SDK is set with an SDK version you have installed or a range that is compliant:
<uses-sdk android:minSdkVersion="3" />
<uses-sdk android:targetSdkVersion="14" />
or whatever range you plan on supporting and AVDs/Emulators you have setup.
Hope that helps!
Yeah, it's annoying. I don't know how to fix it per se either, but instead I set it to always let me manually select the device to debug on. Then at least you can choose the correct device/emulator. Right click your project, select Run, Run configurations..., then select the Target tab. Change the Deployment Target Selection Mode to manual. Automatic with a selected device is supposed to work, but I find once in a while it'll launch something else. If that's not set you can try that and see if it works for you.
its according to your project.
if you are running normal AVD and you are trying to run google api project then it will automatically open the google avd that its suits.
and also your api level.
if your project is 2.3 and you are running android 2.1 API then its will try to open 2.3 avd from your AVD list.
Usually this happens because of two things:
adb crashed
Yeah that happens, adb crashes in some way and loses track of devices/emulators. In this case close the second emulator and restart adb, e.g. via the ddms app or on the command line by using adb kill-server followed by adb start-server. Then relaunch and it should be fine.
You try to launch an app with a higher/different api than the emulator
If you run a 3.0 app and you have an 2.3. emulator open, the plugin will start a higher api level emulator for you. Or if you need the Google APIs and the emulator doesn't have them, the same thing will happen. Sometimes you get a dialog to select what you'd like to do, but not always. Not sure when that happens exactly actually.
I have faced this annoying thing many times, it happens occasionally. and I think I know the way to correct it. I think what happens is that the adb's connection with the emulator breaks or becomes faulty, so android launches a new emulator although you have already an existing emulator for the same platform running. To correct this problem.
Go to DDMS-->Devices Tab-->Click the option "Reset adb" (which is the last option) .
You will then see some error report in the console, but after a minute your emulator would be ready to be used without problems. I do it all the time and it works.
This is the message I receive always (100%) if I try to start the emulator with an existing snapshot. The system is Windows 7 32bit, ADT14 and SDK14.
I need to start every emulator session with "wiped user data". Whenever I try to reload the emulator with a snapshot Windows prints this message (in German: emulator-arm.exe funktioniert nicht mehr) and the only option available is to close the application (emulator-arm.exe).
I can reproduce that at will. Even with fresh installs of Eclipse (Helios and Indigo), SDK, ADT. I could see that with all versions in the last year. I can reproduce that on three different machines in my house (all Windows 7 32bit) at will. There's not much software on my machines. On one machine is the Android Development environment only. All three computers are no gaming machines and don't have much power. I mean, just to use the Eclipse editor, it must be enough.
All applications (Eclipse, etc.) are not configured to special needs. I always use the Android development as is out of the box.
Any help is highly appreciated. It's not funny to always go for lunch or coffee just to switch from one emulator to the next one - lasts for approx. 10 minutes here.
Personally I suggest not to use Snapshot features. Just having a normal reboot is totally fine, it doesn't take much time, just one or two minutes.
The Snapshot thing really troubled me in the past, and resulted in a newly-fresh installation of SDK. Don't know why it is exactly but it is better not to use Snapshot, first, it doesn't speed up your emulator speed; second, it is a emulator stuff, not on a real device.
Correct me if I'm wrong or mistaken something!
Launch your AVD Device via the AVD Manager, ensure not to wipe user data or use launch from snapshot.
If your application is not deployed to AVD Device:
Right click your eclipse project select run as => run configuration. Ensure under the target tab deployment mode is set to manual. Click Run, from here you can select the current running AVD you started earlier.
To redeploy your application to AVD Device
Leave the AVD Device up and running, use the Application Manager on the AVD Device to uninstall the app from the AVD Device. Next, right click your eclipse project select run as => run configuration. Ensure under the target tab deployment mode is set to manual. Click Run, from here you can select the current running AVD you started earlier.