2014년 12월 11일 목요일

Please modify run-emulator.bat

I was able to run emulator to test applications I wrote. However,I ran into problems after moving my user profile (i.e., my HOMEPATH and HOMEDRIVE) to another drive. When I hit Connect-Emulator, the aistarter started to run, but the emulator screen never came up. I tried almost everything listed in the page titled "Debugging issues in running the App Inventor Setup Tools and the emulator on Windows" with no success. Finally, I started to examine files in the commands-for-AppInventor folder and found something not completely right in the file "run-emulator.bat".

This file tried to create a folder under user's home directory. The code is listed below. 

call :SetAppinvDir "%HOMEPATH%"
if not exist %APPINVDIR% md %APPINVDIR%

This code will go wrong if you move your home directory to other drive. Therefore, I changed %HOMEPATH% into %USERPROFILE% and it started to work. It will get the same result if you substitute %HOMEPATH% for %HOMEDRIVE%%HOMEPATH%. 

Thus, I issued this ticket and wish someone take care of this minor bug in the file. Thanks.



Thanks.  This issue has been brought to the attention of appropriate MIT AI2 Development Team members.



I remember a post by an advanced user who has installed App Inventor
on an alternate drive.  When he went to deinstall it,
he lost everything under Program Files - a major catastrophe for him.

I have not seen any posts announcing fixes for that.

I suggest taking volume backups as a precaution right before you
run any de install script.



I have the script for run-emulator.bat

Script:

REM @echo off
REM Start an emulator for App Inventor
REM Change current directory and drive to where this script is.
cd /d %~dp0
REM create the user directory for App Inventor if necessary
call :SetAppinvDir "%USERPROFILE%"
if not exist %SDCARDFILE% mksdcard.exe 64M %SDCARDFILE%
start /MIN emulator.exe ^
-kernel from-Android-SDK\platforms\android-8\images\kernel-qemu ^
-ramdisk from-Android-SDK\platforms\android-8\images\ramdisk.img ^
-system from-Android-SDK\platforms\android-8\images\system.img ^
-sdcard %SDCARDFILE% ^
-skindir from-Android-SDK\platforms\android-8\skins ^
-skin HVGA-AppInventor ^
-sysdir "%TEMP%" ^
-data %DATAFILE% ^
-scale 0.7 ^
-no-boot-anim
goto :EOF
REM ----------
:SetAppinvDir
REM Sub-routine called above to set the App Inventor user directory.
REM Parameter 1: The content %USERPROFILE%
set APPINVDIR="%~1\.appinventor"
set EMUDIR="%~1\.appinventor\emulator"
set EMDATA=Appinventor-emulator-data
set DATAFILE="%~1\.appinventor\emulator\Appinventor-emulator-data"
set SDCARDFILE="%~1\.appinventor\emulator\sdcard.img"
Please Reply.





Thanks, yes I'm working on a new setup-tools package that will fix this problem.


댓글 없음:

댓글 쓰기