내 장치 (Nexus One, Android 2.3.6)에 apk를 설치하고 시작하려면 다음을 실행하여 android-maven-plugin 3.2.0을 사용하고 있습니다.), usb를 통해 연결되고 adb에 표시되는 유일한 것입니다. 병렬로 실행되는 에뮬레이터도 없습니다. 다음은 mvn android : deploy가 작동하지 않음 (성공 확인에도 불구하고)
mvn install android:deploy android:run
모두 좋아 보인다 내 껍질에 출력하고, 심지어라는 메시지가
을 HT9CPP805008_HTC_NexusOne 할 수 있지만,이 APK는 내 장치에 설치되어 있지 않은, 사실이 아니다, 응용 프로그램에서 찾을 수 없습니다.성공적으로 /Users/myuser/Projects/MyCompany/com.mycompany.abc 설치 /target/com.mycompany.abc-1.0-SNAPSHOT.apk 이
android:deploy
이 올바르게 작동하지 않는 것 같아서 제가 현재 apk를 설치하는 유일한 방법은
workaround입니다. (adb 자체는 제대로 작동하지만 adb을 통해 수동으로 모든 명령 (푸시, 설치 등)을 실행할 수 있으며 문제없이 내 장치를 찾을 수 있습니다 .Adb v1.0.29가 포함 된 Mac OS X Lion에 있음
업데이트 : 앱이 이미 전에 내 장치에 설치 한 후 받는다는을 실행하면 잘 작동 android:deploy/run
, 다음 이전 APK 배포를 취소 먼저 다음 재배치 것 : 여기
내가 방금 만든 흥미로운 발견이다 새로운 것. 이 작품! 그러나 이전에 장치에 장치를 설치하지 않았거나 maven을 실행하기 전에 수동으로 응용 프로그램을 삭제 한 경우에는 작동하지 않습니다. <undeployBeforeDeploy>
의 값을 true
에서 false
으로 변경해도 여기에는 아무런 차이가 없습니다.
이전에이 문제가 발생 했습니까?
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.mycompany:com.mycompany.abc:apk:1.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.codehaus.mojo:exec-maven-plugin is missing. @ line 85, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building com.mycompany.abc 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- android-maven-plugin:3.2.0:deploy (default-cli) @ com.mycompany.abc ---
[INFO] Waiting for initial device list from the Android Debug Bridge
[INFO] Found 1 devices connected with the Android Debug Bridge
[INFO] android.device parameter set to usb
[INFO] Device HT9CPP805008_HTC_NexusOne found.
[INFO] Successfully installed /Users/myuser/Projects/MyCompany/com.mycompany.abc/target/com.mycompany.abc-1.0-SNAPSHOT.apk to HT9CPP805008_HTC_NexusOne
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.334s
[INFO] Finished at: Sat Jun 30 01:23:01 CST 2012
[INFO] Final Memory: 12M/126M
[INFO] ------------------------------------------------------------------------
pom.xml 파일 : 나는 아무 문제 (Linux 및 갤럭시 넥서스)와 Maven 플러그인 작업과 잘 작동하고있어
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompanyany</groupId>
<artifactId>com.mycompany.abc</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>apk</packaging>
<name>com.mycompany.abc</name>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>2.2.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<!-- Simply read properties from file -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>android.properties</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<androidManifestFile>${project.basedir}/AndroidManifest.xml</androidManifestFile>
<assetsDirectory>${project.basedir}/assets</assetsDirectory>
<resourceDirectory>${project.basedir}/res</resourceDirectory>
<nativeLibrariesDirectory>${project.basedir}/src/main/native</nativeLibrariesDirectory>
<sdk>
<platform>11</platform>
</sdk>
<deleteConflictingFiles>true</deleteConflictingFiles>
<undeployBeforeDeploy>false</undeployBeforeDeploy>
<!--<sign><debug>false</debug></sign>-->
<device>usb</device>
</configuration>
<extensions>true</extensions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<artifactId>exec-maven-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<configuration>
<executable>${basedir}/scripts/run_app.sh</executable>
</configuration>
</plugin>
</plugins>
</build>
</project>
시도해 보았지만 차이는 없습니다. 필자는 이미 pom.xml에 usb 을 가지고 있지만 추가 매개 변수는 필요하지 않습니다. 그러나 여하튼, 심지어 그것과 더불어, 어떤 차이가 아니라도. 내가 이상한 점을 알지 못해서 아주 이상하다. –
여기에 흥미로운 발견이 있습니다. android : deploy/run 잘 작동합니다. * 전에 앱을 설치 한 다음 * maven을 실행하면 앱을 먼저 배포 취소하고 새 앱을 다시 배포합니다. 이 작품!하지만 전에 앱을 내 기기에 설치하지 않았거나 maven을 실행하기 전에 앱을 수동으로 삭제하더라도 작동하지 않습니다. 여전히 테스트 중 ... 'undeployBeforeDeploy'의 값을 true에서 false로 변경해도 여기에는 아무런 차이가 없습니다. –
이것은 pom http://pastebin.com/RvBcVFKr – sourcerebels