解决方法
这里的帖子:
http://www.hrupin.com/2011/06/21/how-to-run-android-application-then-you-use-maven-in-your-project
<plugin> <artifactId>exec-maven-plugin</artifactId> <groupId>org.codehaus.mojo</groupId> <configuration> <executable>${basedir}/scripts/run_app.sh</executable> </configuration> </plugin>
使用下一个内容在${basedir} / scripts / dir中添加脚本:
adb shell am start -a android.intent.action.MAIN -n your.app.package/.YourMainActivity
用于构建和运行app的命令
mvn clean install android:deploy; mvn exec:exec