问题
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.
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.
回答1:
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:
pct2:
This seems to force adb to listen on the port 8001
EDIT1 an other way to kill and restart adb.exe:
List item:
- put your UAC (in start menu) at the lower level
- launch your emulator, when it's ready (SD card prepared) do the following
- go in
C:\Program Files (x86)\AppInventor\commands-for-appinventor
right click new and "text" and rename this filerun.bat
(to change .txt in .bat) - right click to edit the file with notepad
- write just:
CMD
- save and close
- now double click that
run.bat
file - write:
adb kill-server
(press enter and wait) - write:
start-server
(your emulator should now connect)
Edit2: Genymotion works much faster with app inventor 2.
来源:https://stackoverflow.com/questions/29207717/mit-app-inventor-2-emulator-doesnt-launch-companion