Search code examples
androidemulationwindows-7-x64app-inventor

MIT App Inventor 2: emulator doesn't launch companion


When I run aiStarter.exe as administrator, and the click on connect to the emulator in http://ai2.appinventor.mit.edu, then the emulator starts, the black screen with android is displayed and after a couple of seconds I get the android home screen.

Then every couple of seconds, a line "127.0.0.1 - date/hour/ "GET/echeck/..." is added in aiStarter.exe, and on http://ai2.appinventor.mit.edu the message asking me to wait a minute or two while it's starting emulator remains. I have waited for something to happen at this point for 30 minutes, but nothing changes.
enter image description here

If I understood it well, the companion should be automatically launched and then I should be asked if I when to update it. But this never happens, it is as if emulator get stuck just before companion get launched, or App Inventor never recognizes that emulator has started.


Solution

  • There is a simple fix to that bug:

    once your emulator is loaded (just wait until you see that: pct1), don't close anything, just open Windows Task Manager (Ctrl+Shift+Esc or Ctrl+Shift+Del -> Task Manager) in the process kill the adb.exe (while the emulator is working) cf. pct2. Don't do anything else, wait for few second and you will see a new popup to this site saying that it has detected the emulator. Repeat that each time the emulator stuck.

    pct1:

    enter image description here

    pct2:

    enter image description here

    This seems to force adb to listen on the port 8001

    EDIT1 an other way to kill and restart adb.exe:

    List item:

    1. put your UAC (in start menu) at the lower level
    2. launch your emulator, when it's ready (SD card prepared) do the following
    3. go in C:\Program Files (x86)\AppInventor\commands-for-appinventor right click new and "text" and rename this file run.bat (to change .txt in .bat)
    4. right click to edit the file with notepad
    5. write just: CMD
    6. save and close
    7. now double click that run.bat file
    8. write: adb kill-server
      (press enter and wait)
    9. write: start-server
      (your emulator should now connect)

    Edit2: Genymotion works much faster with app inventor 2.