有什么事吗[尝试自动化android构建]

时间:2019-02-21 17:03:30

标签: android ionic-framework capacitor

我是android新手。 People tell me我可以使用gradlew.bat来构建apk。当我在调试中启动它时,它似乎可以运行,但是在任何地方都找不到.apk。这是怎么回事?

e:\dev\mobility\mob-ion>android\gradlew.bat --status

e:\dev\mobility\mob-ion>if "Windows_NT" == "Windows_NT" setlocal

e:\dev\mobility\mob-ion>set DEFAULT_JVM_OPTS=

e:\dev\mobility\mob-ion>set DIRNAME=e:\dev\mobility\mob-ion\android\

e:\dev\mobility\mob-ion>if "e:\dev\mobility\mob-ion\android\" == "" set DIRNAME=.

e:\dev\mobility\mob-ion>set APP_BASE_NAME=gradlew

e:\dev\mobility\mob-ion>set APP_HOME=e:\dev\mobility\mob-ion\android\

e:\dev\mobility\mob-ion>if defined JAVA_HOME goto findJavaFromJavaHome

e:\dev\mobility\mob-ion>set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_201

e:\dev\mobility\mob-ion>set JAVA_EXE=C:\Program Files\Java\jdk1.8.0_201/bin/java.exe

e:\dev\mobility\mob-ion>if exist "C:\Program Files\Java\jdk1.8.0_201/bin/java.exe" goto init

e:\dev\mobility\mob-ion>if not "Windows_NT" == "Windows_NT" goto win9xME_args

e:\dev\mobility\mob-ion>if "@eval[2+2]" == "4" goto 4NT_args

e:\dev\mobility\mob-ion>set CMD_LINE_ARGS=

e:\dev\mobility\mob-ion>set _SKIP=2

e:\dev\mobility\mob-ion>if "x--status" == "x" goto execute

e:\dev\mobility\mob-ion>set CMD_LINE_ARGS=--status

e:\dev\mobility\mob-ion>goto execute

e:\dev\mobility\mob-ion>set CLASSPATH=e:\dev\mobility\mob-ion\android\\gradle\wrapper\gradle-wrapper.jar

e:\dev\mobility\mob-ion>"C:\Program Files\Java\jdk1.8.0_201/bin/java.exe"    "-Dorg.gradle.appname=gradlew" -classpath "e:\dev\mobility\mob-ion\android\\gradle\wrapper\gradle-wrapper.jar" org.gradle.wrapper.GradleWrapperMain --status
PID STATUS   INFO
22140 IDLE     4.10.1
27356 IDLE     4.10.1
22428 STOPPED  (after being idle for 6 minutes and not recently used and to reclaim system memory)

Only Daemons for the current Gradle version are displayed. See https://docs.gradle.org/4.10.1/userguide/gradle_daemon.html#sec:status

e:\dev\mobility\mob-ion>if "0" == "0" goto mainEnd

e:\dev\mobility\mob-ion>if "Windows_NT" == "Windows_NT" endlocal
e:\dev\mobility\mob-ion>

2 个答案:

答案 0 :(得分:1)

尝试使用gradlew.bat build命令,该命令应在android/app/build/outputs/apk/debug/app-debug.apk上创建.apk。

还请检查gradlew.bat task,因为它会向您显示更多可用任务,例如installDebug,它将应用程序安装在已连接的设备中。

答案 1 :(得分:0)

我不太清楚这种方法,但是当我使用CLI构建apk时,它会在以下路径生成。

  

platform / android / build / output / apk / debug / debug.apk

可能此方法也会在此生成。