🤖 Power your dev and integration with AI skills for Genymotion!

Author name: Cécile MAURISSET

Genymotion Cloud (AWS-GCP), Tutorials

Tutorial | Automate Genymotion On-Demand (AWS EC2 Android instances)

Written by Ellinor Kwok – Product Marketing & Pre-Sales at Genymobile Intelligently provisioning and deprovisioning entire workloads on demand is challenging in cloud computing. Being able to automate these as much as possible on Virtualized Operating Systems – on cloud platforms such as Amazon EC2 (AWS) – helps you achieve this. Virtualized Operating Systems available are Linux, Windows… But since the rise of mobile applications, no one has been able yet to offer a professional cloud solution that could automate cloning and scaling a virtualized Android Operating System. Genymotion on-Demand is exactly that, a fully functional Android Operating System available on Amazon EC2. You will be able to configure your Android instance once and – thanks to Amazon Web Services tools – automate the roll out on the fly as needed. Managing the load-balancing will be quite easy and straightforward. That is what we will see in this tutorial which fits many use cases such as apps benchmarking, online advertising of mobile applications, mobile application security threat detection. Typical workflow   Set up   You first need to prepare your Genymotion Android EC2 instance by installing your application and any application dependencies needed (for example Google Play Services, modifying settings…). This will be the pre-configured virtual device that you will use for all the automation process. Configure everything you need that won’t change in your instance so you do it only once. Clone   Once you are done with the configuration, you need to clone the instance by creating a snapshot of the device. Use Then you will be able to automate the creation and start new already pre-configured instances. In this blog post we will focus on how you can automate the use of an already pre-configured instance. Let’s see how to automate an instance lifecycle using AWS APIs   Amazon Web Services provide APIs to help you automate the lifecycle of an instance. You can choose your favorite programming language (Python, Java, Ruby and more…). There are SDKs for that. We will focus on using AWS Command Line Interface (CLI). Here are the prerequisites: • An AWS account with your Access Key ID and Secret Access Key and key pair (key.pem) to access to the instance • AWS CLI tool installed   Use aws configure to quickly configure it. It will prompt you to fill your Access Key ID, Secret Access Key, your default region and output format. Please refer to the quick configuration guide for more information. Use AWS APIs to handle the lifecycle of instances   In this section, I will list some useful commands you’ll need for automation that we will later use in the demonstration. 1. Create a snapshot of an instance aws ec2 create-image –instance-id <instance_id> –name <name> • <instance_id> is the id of the pre-configured instance • <name> is the name of the snapshot   2. Create an instance from a pre-configured AMI aws ec2 run-instances –image-id <ami_id> –count <number> –instance-type <instance_type> –key-name <key_name> –security-groups <security_group> • <ami_id> is the AMI id of the snapshot instance • <number> is the number of instances you want to create • <instance_type> is the type of instance e.g t2.medium • <key_name> is the name of the key pair • <security_group> is the name of the security group   MORE OPTIONS 3. Start an instance aws ec2 start-instances –instance-ids <instance_id> • <instance_id> is the instance id you want to start   4. Get information from instances aws ec2 describe-instances –instance-ids <instance_id> • This command is useful to get the instance IP address once started   5. Stop an instance aws ec2 stop-instances –instance-ids <instance_id> • <instance_id> is the instance id you want to stop Here’s what it gives put into practice   Now that you are familiar with the main AWS commands, let’s illustrate a use case we identified: security. Let’s code a script that will automate the creation of a pre-configured instance and install a third-party application that would be scanned for threats. Configure Genymotion On-Demand   You need to first start an instance. Please refer to the product access page on how to do it. Once your instance is started, you need to configure it. For example, you would need to install Google Play Services, change or disable the authentication, lock an application… Please refer to Genymotion On Demand’s tutorials. You can connect to the device through SSH to change those settings. You need to enable adb as well as we will use it to install third-party applications. Clone the Android instance   Once you are all set with the configuration, you need to clone the instance. Once the snapshot is created, you will get a new Amazon Machine Image (AMI). There are two ways : 1. From the EC2 console By going to Actions → Image → Create Image when selecting your pre-configured instance. 2. Using AWS APIs : For the example, we consider that i-1234567890abcdef0 is the instance we want to clone. And we will name the cloned instance genymotion_snapshot aws ec2 create-image –instance-id i-1234567890abcdef0 –name genymotion_snapshot You get the AMI ID as output : { “ImageId”: “ami-1a2b3c4d” } Keep this as you will use it to create the instance. Usage (i.e. deploy massively)   We will create a t2.medium instance from the cloned Android AMI and get its instance ID instance_id=$(aws ec2 run-instances –image-id ami-1a2b3c4d –count 1 –instance-type t2.medium –key-name keyname –security-groups securitygroup –query “Instances[].InstanceId” –output text) If you want to create more than one instance at a time, you can do it by changing the value of –count When the instance is created, it is being automatically started. We need to check that it is in running state before being able to connect to it with adb. state=$(aws ec2 describe-instances –instance-ids $instance_id –query “Reservations[].Instances[].State.Code” –output text) #wait for the device to start, check every second device state while [ $state -ne 16 ]; do state=$(aws ec2 describe-instances –instance-ids $instance_id –query “Reservations[].Instances[].State.Code” –output text) echo -n ‘.’ sleep 1 done Once the instance is started, we get its IP and connect to it with adb ip=$(aws ec2

Automated Testing, Genymotion Cloud, Genymotion Releases

Genymotion Cloud Is Out! – Here’s What You Need To Know

We take the mobile application lifecycle bull by the horns   We are glad to announce that Genymotion Cloud is Generally Available! Which means you can now enjoy our leading Android Emulator in a browser. But there’s more! We are ready to put in your hands for the very first time “Test Automation” features, to the great delight of your Android application users. Here’s what it provides. Genymotion Cloud brings app testing to a whole new level   With Genymotion Cloud Automation features, we are solving it for many constituencies within an enterprise. 1. Developers will have a seamless coding and testing experience. Their current development environment tools won’t change thanks to Genymotion adb tunnel. They will still be able to develop test cases with Java API and seamlessly automate them with Command line tool or with Genymotion Gradle plugin. Developers will commit their code without worrying about breaking the build. 2. QA Engineers will now feel even more empowered while providing their approval to release an application. With Genymotion Cloud, they will be in the driver’s seat. No compromise in setting up test bed. Till now, either they used to curtail their test cases to fit the hardware and software availability or take longer to wave that green flag. With Genymotion Cloud Automation features, they will have all the freedom on this planet to go as deep and as wide in their test cases as they like. They will release with confidence. 3. IT Engineers will love it because we are enabling them to do more with less. Now they can focus on mission critical IT tasks. This is music to CIOs’ ears. At the end, who wins is not Development, not QA and not even IT. It is the end user of the mobile application that got developed and released with utmost confidence. He is going to receive the best end user experience. Goes without saying, that is going to guarantee a customer for life for the enterprise adopting Genymotion Cloud. What’s next?   We have been working on Genymotion Cloud for a while now and yet there’s still a lot of goodness to come. Collaboration features will be implemented in the next few months and will enable live sharing of virtual devices and apk files. Our automation features are just the beginning! So go ahead, embrace Genymotion Cloud with confidence and stay tuned for more details in coming weeks. We can’t wait to share more.   GET ON BOARD

Scroll to Top

Select Product Portal

SaaS Platform

Access to our SaaS solution and use virtual machines in the cloud on any web browsers.

Or

Or

Desktop Platform

Access to manage your Genymotion Desktop licenses, your invoices and account information.

How to get a quote for multiple Business Licenses?

  1. You need a Genymotion Desktop account. If you haven’t one yet, you can create it here.
  2. After creation and activation, or if you already have an account, follow this link.
  3. Add the number of desired licenses to your shopping cart and click “Continue to Billing”
  4. Add a shipping address, or select one if you already created one.
  5.  In the next page, click “Get a quote”:
    Payment details
  6. A quote will be automatically generated in PDF format.

Genymotion Device Image for Cloud providers
- Private Offer -

Genymotion Self-hosted (on-premises)
- Contact Us -

Genymotion SaaS
- Increase Maximum Simultaneous devices -

Genymotion SaaS Enterprise Plan
- Get a Quote -

Genymotion SaaS Premium Plan
- Get a Quote -

Personal Use - Free

Genymotion Desktop for personal use is not suitable for trial or POC: you will not get any assistance and some features will be disabled. If you have already selected “personal use” and wish to get a trial license, please contact our Sales at [email protected].

Technical support is not available with Genymotion Desktop free edition for personal use. For more details, please refer to Genymotion conditions of use (Personal Use).

The following features are not available in personal use mode:

Follow these steps to get Genymotion Desktop and activate personal use mode:

  1. Go to the Download page and get the latest version for your system.
  2. Follow the instructions from Genymotion Desktop quickstart guide to install Genymotion Desktop.
  3. Launch Genymotion and click CREATE to create an account. You should receive an activation email within an hour. If not, make sure to check your spam.
  4. After activating your account, return to Genymotion and log in with your credentials.
  5. Select personal use when prompted.
  6. Read Genymotion Desktop quickstart guide carefully to setup Genymotion for your needs.

Contact Sales
- Premium Plan -

Select a Cloud provider Marketplace