When i right-click my Android Project and Select Run->Android Application
. The emulator gets launched and the changes do reflect.
But when i do the foll
Run mvn android:emulator-start
before mvn android:deploy
. The maven plugin cannot deploy to an emulator that does not exist. You must also wait for the emulator to boot up before deploying.
Use adb devices
to check the active android devices that are connected to your computer.
You can either launch the emulator manually (like Deepak mentioned in his answer) before running mvn android:deploy
, or using the following configuration and run mvn android:deploy
directly, it will automatically start emulator and wait for it before doing the deploy:
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.3.2</version>
<configuration>
... ...
<emulator>
<avd>21</avd>
<!-- Wait for emulator starting (3 minutes) -->
<wait>180000</wait>
<options>-no-skin</options>
</emulator>
... ...
</configuration>
<extensions>true</extensions>
</plugin>