Testing Android applications on a pure emulator

When I want to test the application for Android, I create a new AVD, run it in the emulator, wait for the emulator to finish loading, then use ADB to install the application, and when I finish, uninstall AVD. Are there any tools that automate all these steps? I tried to write my own, but I could not find a way to find out if the emulator is fully loaded, as the Android SDK website says that it does not use "adb wait-for-device install file.apk".

+5
source share
1 answer

You are right not to use wait-for-device. It does not wait for the package manager to be available, what you need. I'm not sure how eclipse does this, but you can poll the emulator until the package manager is accessible with the command adb shell pm path android. The command should return "package: something". Check out this python script that uses the technique: www.netmite.com/android/mydroid/1.6/.../adb_interface.py. It is quite large, but if you are looking for the command above, you will find the corresponding script fragment.

Why do you want to delete AVD every time?

, - , AVD, : adb install -r file.apk. -r . adb.

, "" ? , AVD. -wipe-data . AVD , . .

, script.

+4

All Articles