2017년 4월 20일 목요일

Installing and Running the Emulator in AI2 (Debugging issues)


Debugging issues in running the App Inventor Setup Tools and the emulator on Windows
(or what to do when things don’t work right!)
You are welcome to add comments to this document. To do so, open it in Google Docs.
MIT App Inventor’s setup tools will install and work on most computers.  But there can also be occasional difficulties.  Several things can cause App Inventor to fail. These include: (1)insufficient memory on the computer, 2) Use of programs that restrict access to the Internet (Firewalls, anti-virus software etc) or prohibit the computer from performing read/write operations to the PCs hard drive.
For school setups especially, the App Inventor team does not know all the kinds of limitations that schools impose on classroom computers, that cause problems for App Inventor. We are updating our tools to deal with specific limitations as we discover them.  Please help us by adding comments to this document at places where the procedures listed below do not work.  Please also report the limitation as issues in the App Inventor support forum.   We may contact you to learn more about your particular computer and networking configuration.
This document provides help in dealing with problems that people typically encounter getting App Inventor to run on Windows computers.   A separate document dealing with Macintosh computers is being prepared.   Some issue can be easily dealt with by reinstalling the setup tools.   Other issues may may debugging and investigation, and you may need to get help from someone familiar with the use of the Windows command line.
The instructions below cover four stages getting the setup tools working, and then connecting to the emulator:
⦁ Installing the setup tools and getting aiStarter to run.  aiStarter is the software that allows AI2 to communicate with your PC.
⦁ Starting the emulator. The emulator is a piece of software that simulates the use of a phone or tablet on your PC.
⦁ Getting the emulator to connect to App Inventor
⦁ Getting the emulator to update to the latest available version, if necessary
PART 1:  App Inventor Setup Tools installed, updated and aiStarter is running.

⦁ Step 1: Make sure you are logged into an Administrator account
⦁ Step 2: Go To the App Inventor 2 Test page by clicking the following link.

http://appinventor.mit.edu/test

This page will perform some tests and indicate whether you have the aiStarter program running and if you have the current version of the setup tools installed.  From the AI2 browser menu, select Help>About to find the current version of AI2 and the date of its most recent modification. The About box also tells you which version of AICompanion you should be using with this version of AI2. Check and you know you have the correct AI2-Companion combination

⦁ Step 3: If aiStarter is running proceed to step 4.  You will know aiStarter is running if a Windows screen called aiStarter appears on your desktop. There are lots of numbers on a black field.

If aiStarter is not running, then start aiStarter by locating the aiStarter icon on the desktop.   When aiStarter was installed, the installer provided a desktop icon. There should also be a link in the start menu, or in the AppInventor directory located in the “Program Files” or “Program Files (x86)” directory.  Now try the test page again. If the aiStarter is running then proceed to Step 4.

If aiStarter is still not running then you need to install the setup tools by following the instructions at the link below and try the test page again.

http://appinventor.mit.edu/explore/ai2/windows

Don’t neglect the part of the instructions dealing with logging out (or rebooting) and running the uninstaller.   Again, you must reboot your PC before runing the uninstaller from the Program Files directory, and then attempting to install/re-install aiStarter.

⦁ Step 4: If aiStarter is running but your setup tools are not up to date

If aiStarter is running but your setup tools are not up to date as indicated on the test page, reinstall the setup tools by following the instructructions below and come back and try the test page again.

http://appinventor.mit.edu/explore/ai2/update-setup-software

Repeat these steps until aiStarter is running and you have the updated setup tools.

Note:  When the setup tools are installed aiStarter will automatically start when you log in to your Google account the next time.

Problems:  If you cannot successfully complete Part 1, the reasons  might be
Your computer cannot connect to the software download site for the App Inventor setup software.
There is a program running on the computer that is using port 8004, which is the port that aiStarter needs in order to run, or your internet service provider has blocked those ports.
For either of these issues, you will need to work with your network provider or your IT service to resolve them.
PART 2: Getting the emulator running on the computer
Once you are sure that aiStarter is running and your setup software is current, you can try starting the emulator.  With App Inventor running in your browser, choose the “Emulator” option from the “Connect” menu, and the emulator should start.  How fast your emulator starts is a function of your PC's cpu and the amount of memory available to the PC. On a Win 7 PC with lots of memory, the emulator may take only a few seconds to start; on slower PCs, the process might take a several minutes.The might take a few minutes.
The Emulator is a virtual phone. Starting the emulator will both start this virtual phone and will then run the MIT AI2 Companion in this virtual phone. There are several places in the process of starting the emulator where things can go wrong. Here are some hints to help figure out what the problem might be be.
When the virtual phone starts, you should get to a “home” screen that looks like this:
emulator2.png
If you don’t see this “home page” then there is something wrong with how your computer is starting the emulator. At this point you will likely need to find someone who has access to an Administrator’s account on the computer you are using.
They should log in and try to use App Inventor to start the emulator. If they can use the emulator with their administrator, but the ordinary user account on your computer your account cannot, then there is probably some restriction in place on your computer that is preventing App Inventor’s emulator from operating properly. You will have to experiment with removing restrictive settings and or disabling programs that enforce restrictions to see which one is causing the problem. Once this is determined you (or your administrator) should leave this program disabled or figure out how to configure it so that it does not interfere with App Inventor.  We cannot tell you here exactly what you need to do because there are a lot of programs that are used to restrict and protect Windows accounts, and what you need to do will be determined by which program you are using.  Some issues people have encountered include restrictions on access to the Web, prohibitions against running .exe or .bat files, and inability to access the commands-for-appinventor directory.  One way to look for hints as to what might be wrong is to open a command window in the commands-for-appinventor folder, where the setup software was installed.  Then try to launch the emulator manually using the command run-emulator.bat and see if there are any error messages.
Another possibility (on older computers) is that the computer is not powerful enough to run the emulator.  Symptoms might be that the emulator starts, but never gets past a black screen.
PART 3: Getting the emulator to connect to App Inventor
If you see the virtual phone’s home screen (above) but cannot get any further, then there may be a problem with how the virtual phone is set up. You can reset the emulator by selecting the Hard Reset choice in the Connect menu. This will reset the virtual phone to the “factory” state it was in when the setup tools were first installed. Note: When you select Connect->Hard Reset you will see a dialog box warning you that it will reset the emulator.   If the factory version of the MIT AI2 Companion is out of date, the system will lead you through the process for auto-updating the Companion, once the emulator is running.
If you cannot get things working at this point. You can try uninstalling and re-installing the setup tools. If this still doesn’t work, then you will need to find a system administrator (who can login to an Admin account on your computer) and try the steps listed in Part 2 regarding programs that might be interfering with App Inventor. Again, there are many such programs and we cannot tell you how to change their settings.  You will likely need some expert help.
PART 4: Getting the emulator to update
The emulator connects to App Inventor using an app (the AI2 Companion) that runs in the emulator.   If this app is out of date, App Inventor will offer to update it.   If the update fails, you can bypass the update temporarily, but you should update soon, since newer App Inventor features might not run on the emulator, and new apps might crash.
                        companion app out of date.PNG
Some problems you might encounter
If you get the message that your Companion is out of date, and App Inventor does not offer to update it, then you probably have a very old Companion that predates the auto update feature.   Please update your setup software.
PART 5: Talking to the Emulator
Some people have reported getting the Emulator running and even the Companion, but then their blocks do not load. Instead you continue to see the “white screen” of the Companion claiming that it is waiting to get blocks.
The Companion listens on port 8001. If something is blocking that port, then it will not be able to receive any blocks. Similarly if another program is using port 8001 the same thing can happen.
To test if this is the problem, while in this state, use your browser to go to http://127.0.0.1:8001/
If you get a directory listing (it will start with “Directory /”) then you are talking to the Companion. Note: There may only be the line “Directory /” or you may *also* see a listing of files which you should recognize as project assets (images, sounds etc.). What you see isn’t important, it is the fact that you can see it.
If you cannot connect to http://127.0.0.1:8001/ then you will have to look at what other programs on your PC may be interfering with connecting to the Companion. This can be anything from a firewall, to another program using the same port.


댓글 없음:

댓글 쓰기