Search code examples
androidunit-testingapkpom.xmlandroid-maven-plugin

Instaling apk via maven


I'm wondering how can i add an .apk file to my pom.xml for, in order, install app from apk file and in second step build project with tests, lunch emulator, install apk which will be testing etc,etc. For now first apk is installed manually but i need install that apk whit maven and then go to second step. Has anyone else run into the same problem?


Solution

  • Ok i solved it on my own, this is a part of pom.xml

    <executions>
      <execution>
       <id>startEmulator</id>
           <phase>initialize</phase>
           <goals>
             <goal>emulator-start</goal>
           </goals>
       </execution>
       <execution>
       <id>install-client</id>
           <phase>initialize</phase>
           <configuration>
              <file>my.apk</file>
           </configuration>
           <goals>
              <goal>deploy</goal>
           </goals>
       </execution>
    </executions>