☃️ Desktop Winter Offer -20%

How to use MobSF with Genymotion SaaS

In this tutorial, it is assumed that you are familiar with MobSF and you are using it from a physical local machine. For detailed information about MobSF, please refer to MobSF documentation.

Important

This tutorial requires modification to MobSF source code; it will not work with MobSF official docker image.

Prerequisite

  • MobSF code from github is cloned on your local machine
  • Git must be installed on your local machine
  • ADB from the Android SDK platform tools is installed on your local machine
  • gmsaas CLI is installed on your local machine

Setup gmsaas CLI

Configure the path to your Android SDK

Use the following command:

Bash
gmsaas config set android-sdk-path <sdk_path>

<sdk_path> should point to the Android SDK installation directory, similar to the ANDROID_SDK_ROOT or deprecated ANDROID_HOME environment variables.

Configure authentication

You will need a Genymotion SaaS API token for this step. If you haven’t created one yet, you can follow the steps from our on-line documentation.

Next, use the following command:

Bash
gmsaas auth token <token>

Alternatively, you can store the API Token in the environment variable: GENYMOTION_API_TOKEN

Verify gmsaas configuration

Run the command:

Bash
gmsaas doctor

If the command returns “Authentication OK” and “Android SDK OK”, you are all set with gmsaas!

Connect an instance to ADB

Start your instance. When it is in “Running” state, copy the instance UUID (you can get it from Genymotion SaaS UI dashboard, or with the gmsaas recipes list command), then use the following command:

Bash
gmsaas instances adbconnect [--adb-serial-port PORT] <instance_uuid>

Replace <instance_uuid> with the instance UUID. The command returns to shell once ADB is connected. If the --adb-serial-port <PORT> option is set, the instance will be connected to ADB on localhost:<PORT>.

Another method is to connect any running instances to ADB by combining this command with the --quiet or -q option and xargs:

Bash
gmsaas instances list -q | xargs -n1 gmsaas instances adbconnect

You can verify with the adb devices command; adb should now be connected to “localhost:XXXXX device”. For example:

Bash
$ adb devices
List of devices attached
localhost:45485	device

Configure MobSF

1. Clone MobSF code from github

Clone MobSF open-source code to your computer:

Bash
git clone https://github.com/MobSF/Mobile-Security-Framework-MobSF.git

2. Modify the code

Edit the Mobile-Security-Framework-MobSF/mobsf/DynamicAnalyzer/views/android/environment.py script and comment the following lines in def connect_n_mount(self):

  • self.adb_command(['kill-server'])
  • self.adb_command(['start-server'], False, True)
  • logger.info('ADB Restarted')
Python
    def connect_n_mount(self):
        """Test ADB Connection."""
        if not self.identifier:
            return False
        """self.adb_command(['kill-server'])
        self.adb_command(['start-server'], False, True)
        logger.info('ADB Restarted')"""
        self.wait(2)

Save the script.

3. Install MobSF

Important

It is strongly recommended to use a Python Virtual Environment to install and use MobSF.

In the Mobile-Security-Framework-MobSF folder, run:

Bash
./setup.sh

4. Launch MobSF

When done, run this command:

Bash
./run.sh 127.0.0.1:8000

Now, you can access MobSF by browsing to http://localhost:8000/.

Log in and navigate to DYNAMIC ANALYSER, your Genymotion SaaS instance should appear as connected at localhost:XXXXX :

Screenshot showing MobSF Dynamic Analyzer running with an Android 11 instance from Genymotion SaaS
MobSF Dynamic Analyzer Page
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.

Select a Cloud provider Marketplace

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 Device On-premise
- 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.

Indie Plan Application Form

This plan is strictly reserved to individual workers (freelancers, self-employed).

Contact Sales
- Premium Plan -

Educational Plan Application Form

The Educational plan is restricted to:

  • schools, teachers or students who wish to use Genymotion Desktop for tuition
  • students who wish to use Genymotion Desktop for a school project

It is subject to valid proof (student card, teacher card, etc.)