2017년 7월 8일 토요일

Using the Genymotion emulator with App Inventor


The Google Android emulator distributed with App Inventor runs slowly.  Some people prefer using other emulators, such as one produced by Genymotion.


MIT’s App Inventor setup package does not include the Genymotion emulator, because MIT does not have permission to distribute it.   But you can download and install Genymotion on your own, after registering for a free license.   Unfortunately, this needs to be done individually  for each computer, which makes it awkward for classroom use, and Genymotion does not provide free educational use licenses.  Once Genymotion is installed, you’ll see a gain in speed and also flexibility, since you can configure the emulator to provide multiple screen sizes and form factors using different AVDs (Android Virtual Devices).


Here are the steps involved in installing and using Genymotion:

Step 1: Installing Genymotion and creating an Android Virtual Device (AVD)

Step 2: Deploying an APK file into an AVD
Step 3: Connecting Genymotion to MIT App Inventor through USB
Going further

Step 1: Installing Genymotion and creating an Android Virtual Device (AVD)

  1. Click here to create a Genymotion user account.
  2. Download Genymotion's user guide  and follow the Installing Genymotion Section and then scroll down to the Getting Started section to set up an Android Virtual Device (AVD). You can ignore all the other pages.

Step 2: Deploying an APK file into an AVD

Once Genymotion is installed, you can use it to run packages apps (APK files), including apps that you have built and packaged with App Inventor.  Here is an example:

1. Start an AVD in Genymotion:



2. Go back to MIT App Inventor and download the HelloPurr project as an APK file.



3. Drag and drop the APK file to the window of the running AVD. The HelloPurr application should launch:




Step 3: Connecting Genymotion to MIT App Inventor through USB

You can also use Genymotion in live development in App Inventor, just as with the Google emulator.  When doing this tell  App Inventor that your are connecting “USB” rather than “emulator”, but you won’t be using a real USB device (or cable) - it’s just that the Android interface (ADB) will see the Genymotion through the USB interface.    


Here’s how to set up Genymotion for live development in App Inventor.

1. Install the App Inventor Setup Software (see step 1 on this page) on your computer., if you have not already done so.

2. Make sure that you are using the latest version of the App Inventor setup package:  versions before fall 2014 are not compatible with Genymotion.

3. To test that everything is working OK, start the Genymotion AVD following the Genymotion directions, make sure that  aiStarter is running, and visit the page http://appinventor.mit.edu/test/ . You should see:



If the aiStarter console is visible, there should see some activity as well

Leave the AVD and aiStarter running.

4. Download the MIT AI2 Companion App http://ai2.appinventor.mit.edu/companions/MITAI2Companion.apk and drag and drop it into the running Genymotion AVD. You should get something like:




  1. Now it's time to connect App Inventor to Genymotion: start an App Inventor project and  click on connect > USB.




The project application should appear in Genymotion after 10 or 20 seconds:
Going further
Here is some additional documentation from Genymotion:




댓글 없음:

댓글 쓰기