Tips and Tricks for Android Emulator

What is your emulator function that you couldn't work with?

What unknown big shortcut, console command or launch option did you find, and do you think this should be known to all other Android developers?

Share with us the wisdom of the Emulator.

+46
android android-emulator
Oct 29 2018-10-29
source share
12 answers

F6 - ball track emulation

When working with a high-resolution screen, you can reduce the size of the emulator to better match the PC screen: AVD Manager - Start - check the box "Display scale to actual size" and set the screen size to a suitable value (6 works for me)

+13
Oct 29 '10 at 18:22
source share

Not really an emulator function, but related.

When using the Eclipse development for Android, the debug certificate, which is generated automatically, lasts 1 year. When it expires, it pains you to delete all your development .apk files because the new certificate does not match, so you cannot update them in all of your AVDs. You should also get another MAP-API development key. The published recommendation is to simply delete the debug.keystore file, and Eclipse (ADT really) will create a new one for you, again after 1 year. But you can create your own debug certificate in debug.keystore with any expiration. Do this in the .android folder in the HOME directory:

keytool -genkey -v -keystore debug.keystore -alias androiddebugkey -storepass android -keypass android -keyalg RSA -value 14000

ADT sets the first and last name in the certificate as "Android Debug", the organizational unit "Android" and the two-letter country code as "USA". You can leave the organization, city, and state values ​​Unknown.

+20
Oct 29 '10 at 20:58
source share

You can enable / disable the emulator network with: F8

Great for testing service interruptions when your application is connected to some kind of web service. This allows you to disable very quickly only at the time of download or web service.

+16
Oct 29 '10 at 17:18
source share

You can rotate it: Ctrl + F11 .

+15
Oct 29 '10 at 17:21
source share

You can try your hand at a bunch of tricks using the keyboard keys and taken from the official Android documentation. See image below.

Emulator tricks and tips

+13
Mar 08 2018-11-11T00:
source share
+11
Oct 29 '10 at 16:17
source share

Demonstrate Android App from USB Drive

Assuming you want to show your application to a friend / client, and they don’t have an Android SDK, Eclipse or even an uptodate JRE on their machine, you can put everything you need onto a USB stick without affecting your development environment.

Create the “androiddem” folder on a stick, copy the minimal sdk file (no documents or samples needed) with the necessary platforms and Java runtime into your own folders.

Open the DOS window from the root of the USB drive and set the local environment variable ANDROID_SDK_HOME to the root of the disk. (This env variable is a little wrong if you use Eclipse the way it doesn’t need it, and selects the SDL location from the general Android settings). It controls where the AVDs are created, so as soon as you set it to h: \ (let's say), you can go to the tools directory on a stick and create AVD in normal mode - they will end up being .android on a stick.

If you copy the files you need (make sure they are signed with the release key), then from another DOS field (with the ANDROID_SDK_HOME parameter set as before, you can use the adb commands to install the apks for AVD that you did.

All you have to do is take the stick on the target machine, reopen the DOS field, set ANDROID_SDK_HOME, add the JRE to the path and run the emulator that assigns the target AVD.

You can simplify the process by creating batch files on a stick to set env variables and paths.

+8
Oct 31 '10 at 16:00
source share

Keep the emulator open during development to avoid load times.

(Source: Pragmatic Programmer Hi, Android book - Ha, I just read it yesterday.)

+8
Oct 31 '10 at 16:07
source share

You can use DDMS to take screenshots of applications running on hardware. Just hit Ctrl-S from the DDMS program. Great for taking screenshots for the Android Market, especially if your application does not work well on the emulator.

I collected screenshots from the emulator and cropped them using Image Magick until it was pointed out to me by a colleague at work.

DDMS screenshot menu

+8
Jan 02 '10 at 16:20
source share

Using DDMS to debug a service that does not have an Activity.

Assuming you wrote a service in your own apk that will be used by another application, then it is not possible to set breakpoints in the code of the service application and call them when another application starts and the service is called.

If, however, you switch to the DDMS perspective, find the service flow and highlight it, then click the error icon in DDMS, breakpoints fire.

This answers one of my (unanswered) questions.

+4
Oct 30 '10 at 8:11
source share

Use ADB commands to optimize your performance. Very useful examples:

adb shell am broadcast -a com.test.IntentName - simulate intent

adb shell date -s 19860407.115033 - change the date / time (for my birthday;)

adb shell dumpsys alarm - print registered alarms

+3
Mar 14 2018-11-11T00:
source share

1) Reset adb every time the console has adb errors.

enter image description here

2) Use startup options wisely:

2.1) If you have a problem emulator "not responding" every time it starts, restart the emulator with "destroy user data". It will clear all applications installed previously and make the emulator new.

2.2) Checking "Starting from a snapshot" will save time when starting the emulator. It reads from a snapshot (if any).

2.3). Checking "Save to snapshot" will save the snapshot to launch the emulator immediately next time. Uncheck the box if you want to close the emulator faster.

enter image description here

3) Backup "sdcard.img" if you intend to resize it. I used to lose data when I try to resize it.

4) Download and install the offline Android SDK if your computer has a problem connecting to the Internet.

5) Install Android Market on the emulator .

+2
Aug 17 '11 at 11:41
source share



All Articles