问题
Is there any way to connect App Inventor 2 to a Genymotion instance?
回答1:
Step 1: Installing Genymotion and creating an Android Virtual Device (AVD)
- Click here and create an account.
- Download Genymotion here (make sure you choose the Free-For-Personal-Use version)
- Go to the 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
- Start an AVD in Genymotion:
- Go back to MIT App Inventor and download your project as an APK file.
- Drag and drop the APK file to the window of the running AVD. Your application should launch.
Step 3: Connecting Genymotion to MIT App Inventor through USB
- Install the App Inventor Setup Software (see step 1 on this page) on your computer. Amongst other things it will install aiStarter on your computer.
- As of now, MIT App Inventor’s setup is using an older version of the adb, which results in MIT App Inventor not seeing Genymotion's AVD. To solve this issue,
- Windows: copy the adb.exe supplied with the Genymotion software (default location:
C:\Program Files\Genymobile\Genymotion\tools\adb.exe
) and paste it over the one installed in the commands-for-Appinventor folder on your computer (default location:C:\Program Files (x86)\AppInventor\commands-for-Appinventor\adb.exe
). - Mac: Mac OS X: Make sure that Applications/AppInventor/commands-for-Appinventor/adb is the same as the one in Vbox settings (see screenshot below). You can use this adb.
- Windows: copy the adb.exe supplied with the Genymotion software (default location:
- To test that everything is working OK, start the AVD, start aiStarter, and go to http://appinventor.mit.edu/test/ . You should see:
In aiStarter, there should see some activity as well:
Leave the AVD and aiStarter running.
- Download the MIT AI2 Companion App (http://ai2.appinventor.mit.edu/companions/MITAI2Companion.apk) and drag and drop it into the running AVD. You should get something like:
5 Now you can connect App Inventor to Genymotion: go to your project in App Inventor, click on connect > USB:
Your application should appear in Genymotion after 10 or 20 seconds.
回答2:
Franck has a great guide but just wanted to add some more information for people who might end up with the same issues I had around the end of step 2
Drag and drop was not available out of the box for me https://docs.genymotion.com/latest/Content/03_Virtual_Devices/Interacting_with_virtual_devices/Drag_and_drop.htm
https://docs.genymotion.com/latest/Content/02_Application/Configuring_Genymotion/ADB.htm#adb
so I had to set up the ADB which was mentioned in the MAC area of part 3 ( I'm on PC )
I installed Android studio as the SDK download just gave me a tools folder and that wasn't being recognized as valid in Genymotion, I directed the "Use custom Android SDK Tool" to C:\Users\bob\AppData\Local\Android\Sdk
This allowed me to then drag and drop the general apk files into my Genymotion android emulated client, but it would not allow the companion to install and mentioned an "ARM" issue, which was solved by following this guide
https://pentester.land/tips-n-tricks/2018/10/19/installing-arm-android-apps-on-genymotion-devices.html
Then I just followed on from Step 3.3 and it all worked perfectly.
来源:https://stackoverflow.com/questions/27976467/how-can-i-use-genymotion-with-app-inventor-2