CST2641 Mobile App Development
Windows Notes


Chrome needs special permissions when using Ripple to access files locally.
Create a shortcut on your desktop for Chrome with file permissions.

Target: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --allow-file-access-from-files

(OS X users, see the me for a script that I wrote for the Mac)


C:\Users\abenusa\workspace>echo %PATH%

C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\Wind
owsPowerShell\v1.0\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Pro
gram Files (x86)\Java\jre7\bin;C:\Program Files (x86)\nodejs\;C:\Program Files\J
ava\jdk1.7.0_40\bin;C:\sdk\platform-tools;C:\sdk\tools;C:\Users\abenusa\AppData\
Roaming\npm;C:\eclipse\plugins\org.apache.ant_1.8.3.v201301120609\bin

Note: There are two separate tools directories for the sdk. Make sure both are in the path.

C:\sdk\platform-tools;

C:\sdk\tools;


phonegap local run --emulator=emulator-5554 android

http://stackoverflow.com/questions/18224686/installing-phonegap-app-to-android-emulator-using-windows-cli

Problem: emulator will not start and install compiled program.
Follow these steps from the command line:

Key:
Black monotext is the command prompt.
Navy monotext is what you type at the command prompt.
Cyan monotext is the response from the system.

This example will assume that the name of your project is "hello".

Go to your project directory and into platforms\android\cordova\lib.

C:\Users\abenusa\workspace\hello\platforms\android\cordova\lib>
list-emulator-images

API_18_Nexus_4_by_Google

C:\Users\abenusa\workspace\hello\platforms\android\cordova\lib>
start-emulator API_18_Nexus_4_by_Google

Starting emulator : API_18_Nexus_4_by_Google
Waiting for emulator...
Booting up emulator (this may take a while).....................................
....
Boot Complete!

At this point the phone emulator will have started and will just be sitting on the home screen idle.

C:\Users\abenusa\workspace\hello\platforms\android\cordova\lib>
list-started-emulators

emulator-5554 device

C:\Users\abenusa\workspace\hello\platforms\android\cordova\lib>
cd ../../../../

C:\Users\abenusa\workspace\hello>
phonegap local run android --emulator=emulator-5554

[phonegap] compiling Android...
[phonegap] successfully compiled Android app
[phonegap] installing app onto emulator

At this point the app will have loaded onto the phone emulator and will be running. You won't get a command prompt back until you exit the emulator.

C:\Users\abenusa\workspace\hello>

It appears that once you have done these steps one time, in the future you will only have to do:

phonegap local run android --emulator=emulator-5554