简体   繁体   English

如何使用批处理文件安装Android APK

[英]How to install android apk using batchfile

I am working on hybrid application for that every time i have to move some files from some place to assets in android application,so for this i wrote batch file.If i execute line by line command in command prompt it is working but if run batch file it is stopping before installing apk in device. 我正在混合应用程序上工作,每次我必须将一些文件从某个位置移动到android应用程序中的资产时,为此为此我编写了批处理文件。文件,它将在设备上安装APK之前停止。

commands: 命令:

D:
cd D:\NewFolder\SampleApp
gradlew.bat assembleDebug
cd D:\NewFolder\SampleApp\app\build\outputs\apk
adb -d install  app-debug.apk

If we are running in multiple batch files in batch file,we should use call for gradlew.bat assembleDebug, Actually it is closing command prompt so that remaining commands are not executing. 如果我们在批处理文件中的多个批处理文件中运行,则应使用gradlew.bat assembleDebug的调用,实际上它正在关闭命令提示符,以使其余命令无法执行。

commands:

D:
cd D:\NewFolder\SampleApp
call gradlew.bat assembleDebug
cd D:\NewFolder\SampleApp\app\build\outputs\apk
adb -d install  app-debug.apk

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM