Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to flash zip on Genymotion programmatically

I'm trying to flash google apps into a genymotion emulator. I can do this using the drag and drop feature, but it's required for my project that the google apps .zip is already loaded into the genymotion machine and it's flashed internally. (To avoid having to interact with the desktop)

I've checked questions like this where the flashing is achieved but using the clockworkmod recovery (Which I couldn't install on genymotion). Since there's no docs on the genymotion recovery mode I can't find the commands to flash the zip, but I'm pretty sure they exist.

Which commands can be used for flashing a .zip from the terminal?

The commands can also be run in the machine that's holding the genymotion.

like image 530
Javier Avatar asked Dec 23 '14 18:12

Javier


People also ask

Is Genymotion better than Android emulator?

Genymotion also runs Robotium tests visibly faster, and with a smoother UI. However, be warned there are some noticable differences between Genymotion and the default Android emulators: You cannot use the special 10.0. 2.2 IP address with Genymotion to access localhost on the machine you are running the emulator from.

Which Android version is best for Genymotion?

Android 11 will be implemented with Genymotion Desktop 3.3, and Android 12 is planned for Genymotion Desktop 3.4. - If the device you wish to emulate is not in the list, you can create your own custom template.

Is Genymotion an emulator?

Genymotion Desktop is an Android 1 emulator which includes a complete set of sensors and features in order to interact with a virtual Android environment. With Genymotion Desktop, you can test your Android applications on a wide range of virtual devices for development, test and demonstration purposes.


2 Answers

Genymotion VMs contain some special scripts that interface with their launcher and skin controls. The one that you need is /system/bin/flash-archive.sh which is what gets run when you drag & drop a .zip archive.

You can run flash-archive.sh directly using ADB or from a process within the VM. So if you have the zip in /sdcard/Download/gapps.zip, you can run the following command from the host machine:

adb shell flash-archive.sh /sdcard/Download/gapps.zip
adb reboot

Don't forget to install the ARM translation package first, if applicable. It can be done using the same sequence.

like image 90
Paul Ratazzi Avatar answered Oct 15 '22 09:10

Paul Ratazzi


Paul's answer is good.

Also, we will soon release features related to continuous integration and automation. A command line tool will be included on these features. It allows you to do all what you can do with your mouse, but through the command line. It will be available to paid licenses.

You can find a demo we did at Droidcon Paris here.

like image 22
eyal-lezmy Avatar answered Oct 15 '22 08:10

eyal-lezmy