Android Maven not starting emulator

后端 未结 2 1666
别跟我提以往
别跟我提以往 2021-02-04 11:14

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

相关标签:
2条回答
  • 2021-02-04 11:40

    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.

    0 讨论(0)
  • 2021-02-04 11:47

    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>
    
    0 讨论(0)
提交回复
热议问题