These directions apply to a Windows install of App Inventor.
If
you do not have an Android device, you can still develop and test
your app with the built-in emulator.
Working with the emulator
during development from the Blocks Editor allows you to test the
operation of one screen at a time.
However, if you are passing
values between screens using open another screen or other screen
closed, it is necessary to either have an android device for testing
or you can install the apk to the emulator.
Although the
emulator can install apks, storage is limited. If you are unable to
install an apk due to an out of memory error, you can uninstall any
previously installed apps, then try again.
See the section titled
Uninstall an APK if you need
to do so.
Using this
guide to get me started, I was able to figure out how to install an
apk to the emulator.
The folder locations mentioned in the article
are not present in the AppInventor install folder.
But not to
worry. All you need is the adb.exe program to do the install and a
copy of the apk file.
In order to modify the contents of the
AppInventor folder, you will need administrative privileges.
Install APK:
I started the
emulator.
I found the command to run the emulator in "C:\Program
Files\AppInventor\commands-for-Appinventor\run-emulator.bat" using the Windows Explorer.
I
created a shortcut on my desktop to make this easier to do by right-clicking the run-emulator.bat file in the AppInventor folder, dragging it out to the desktop and choosing create shortcut from the popup menu.
(You can download the installapk.zip file and extract the installapk folder to the desktop.
Inside the installlapk folder is a shortcut to run-emulator.bat to start the emulator and an installapk.cmd script which when run will prompt for the apk file name and install the apk.)
Using Windows Explorer, I navigated to the "C:\Program
Files\AppInventor\commands-for-Appinventor" folder where the
adb.exe program is located.
I placed my apk file in that folder.
Detailed steps for running the adb.exe install command:
This section is intended for the developers familiar with the Windows command line.
If you want to skip the details of how I did the install skip to
the section Easy Install where you can use my script to aid
you...
I then went to the Start menu and typed cmd in the
search box
In the command window I navigated to the adb.exe folder using cd and dir commands.
Once there I entered the following command:
adb install animator.apk
A message was returned that the apk was installed.
If the emulator cannot install the apk due to limited memory you can unistall other apks to free up some memory and try again.
To see how to uninstall an apk from the emulator go to Uninstall an APK.
Easy Install:
Download the attached installapk.cmd file to your desktop.
Double-click it and enter the name of your apk file if it is stored in the same folder as adb.exe or the path to it if it is stored elsewhere.
If successful, then you can follow these steps to run your app.
If it failed due to insufficient memory then see the section titled Uninstall an APK
Here are some screen captures of these steps...
The adb.exe program will need the path to the apk. I copied it to the same folder/directory to simplify things:
When the emulator loads to this screen you can begin...
If you are using my installapk.cmd script, double-click it:
Type in the path or file name of the apk:
Click the icons button on the emulator:
Your app will show in the programs list:
I have clocked my app's icon and rotated the emulator using Ctrl+F11.
You can also maximize/restore the emulator to full screen using the Alt+Enter toggle feature.
END Install APK.
Uninstall an APK:
You may need to uninstall apks to free up memory on the emulator before it will allow you to install a new apk.
Starting at the initial screen...
Click the menu button then the Settings icon...
Click Applications ..
Click Manage applications
Click the app to delete...
Choose uninstall.
END Uninstall an APK
Send a file to the emulator:
Get a file from the emulator (/mnt/sdcard/Appinventor/assets/fruits.jpg)
...copied to the the commands-for-Appinventor folder by default (Administrative privileges needed):
Install an app to internal storaage:
END