Just a blog to share my tricks, code snippets

Showing posts with label Android Emulator. Show all posts
Showing posts with label Android Emulator. Show all posts

Friday, March 10, 2017

Some useful adb commands with Android emulators using in mobile automation


Please be notice that below commands are for windows.

  • Manually install the app to the emulator:

adb install path_to_apk
For example:
adb install D:\abc\newapp\VSee-vsee-release.apk
If you have more than 1 emulators, use option 's' to specify the device
>adb devices
List of devices attached
emulator-5554 device
emulator-5555 device

>adb -s emulator-5555 install helloWorld.apk
Note: If you issue a command without specifying a target device when multiple devices are available, adb generates an error.

  • Take a screenshot:

adb shell screencap path_to_save_screenshot
For example:
adb shell screencap /sdcard/screen.png

  • Copy files to/from a device:

To copy a file or directory and its sub-directories from the device
adb pull remote local
For example:
adb pull /sdcard/screen.png .
To copy a file or directory and its sub-directories to the device, do the following:
adb push local remote
For example:
adb push foo.txt /sdcard/foo.txt

For all the adb command, you should check out the Android developer page at HERE

Tuesday, March 7, 2017

Improve Android Genymotion Emulator performance for mobile automation testing



1. Change the resolution: Open Genymotion --> Select Configurate this virtual device --> Reduce the ScreenSize - Density.


2. Disable Animations:
  • Enable developer mode by going to Settings > About phone, then tap on Build number several times to enable it



  • Go to Settings > Developer options, and scroll down to Window animation scale, Transition animation scale, and Animator duration scale. Turm off all of them



  • Some people reported that turning off animation may cause stranger behavior in some apps. Follow this article for more information HERE


Note: if you are not using the Genymotion emulator but the emulator from Android SDK, you can follow this topic to make it run faster HERE