请注意,截至 2023 年 5 月:MIT 不再支持 App Inventor 的 Genymotion 模拟器,但欢迎您继续尝试 Genymotion 和其他模拟器。
将Genymotion模拟器与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 (free for personal use). 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)
-
Click here to create a Genymotion user account.
-
Download Genymotion’s user guide [a] 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:
- Start an AVD in Genymotion:
- Go back to MIT App Inventor and download the HelloPurr project as an APK file.
- 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.
-
Install the App Inventor Setup Software (see step 1 on this page) on your computer., if you have not already done so.
-
Make sure that you are using the latest version of the App Inventor setup package: versions before fall 2014 are not compatible with Genymotion.
-
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.html . You should see[b]:
If the aiStarter console is visible, there should see some activity as well:
Leave the AVD and aiStarter running.
- Download the MIT AI2 Companion App [c]http://ai2.appinventor.mit.edu/companions/MITAI2Companion.apk and drag and drop it into the running Genymotion AVD. You should get something like:
- 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:
- How do you install Google frameworks (Play, Accounts, etc.) on a Genymotion virtual device?
- How to use adb with a Genymotion virtual device?
- How to solve the "failure install failed cpu api incompatible" error message when installing an APK file in Genymotion?
- How to copy virtual devices downloaded by Genymotion to another machine?
- How to transfer folder/files from your computer to the Genymotion instance?