简体   繁体   中英

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.

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.

commands:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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