Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing phonegap app to android emulator using windows CLI

I'm trying to install my Phonegap application onto an Android AVD/Emulator. I have launched the AVD and it's registering as 5554:Nexus_S.

When using the Phonegap commands at the Windows prompt I am typing:

phonegap build android
phonegap install android

The output I get says it successfully installed the app onto the device, but it never shows up. This is the output of the install command:

[phonegap] detecting Android SDK environment...
[phonegap] using the local environment
[phonegap] trying to install app onto device
cp: dest file already exists: C:\Users\username\app\platforms\android\assets\www\phonegap.js
[phonegap] successfully installed onto device

I've tried variations of targeting the device using options with no luck:

--device=5554
--target=5554

Any ideas?

like image 620
activelogic Avatar asked Aug 14 '13 06:08

activelogic


2 Answers

I figured it out. You have to specify the --emulator= in the call, so the command looks like:

phonegap install --emulator=emulator-5554 android

You can find the name/id of your running emulators by running the list-started-emulators.bat under the /platforms/android/cordova/lib/ folder in your project.

like image 163
activelogic Avatar answered Sep 19 '22 23:09

activelogic


Another quick note is that sometimes even when you have started the emulator phonegap will not recognize it... so you have to start it from phonegap bat file so that the right process number is registered. to do this. Use the following command, 1. List-emulator-images.bat : This will display available emulator images you have 2. start-emulator : This will start the emulator which will register with phonegap.

Also make sure you are running all of this from and ADMIN Enabled command prompt.

like image 29
Gunish Avatar answered Sep 23 '22 23:09

Gunish