Advertisement
Guest User

Untitled

a guest
Jan 21st, 2020
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. :: place this batch file inside the created [cordovaproject] folder
  2.  
  3. @echo off
  4.  
  5. :: Re\Building android project with
  6. call cordova build android
  7.  
  8. :: Copy the apk file (generated by cordova build) onto the Android SDK's platform-tools repository
  9. :: Enforcing a copy of the .apk (file type) and an .apk file overwrite (if already exists)
  10. echo YF|(xcopy ".\platforms\android\app\build\outputs\apk\debug\*.apk" "%ANDROID_HOME%\platform-tools\ionic_cordova_project.apk")
  11.  
  12. :: Restart adb server
  13. (cd /d %ANDROID_HOME%\platform-tools && adb kill-server && adb start-server && cd /d %cd%)
  14.  
  15. :: Install the project's apk file onto the current emulator
  16. (cd /d %ANDROID_HOME%\platform-tools && adb install ionic_cordova_project.apk && cd /d %cd%)
  17.  
  18. :: Force the application to be triggered as a process onto the emulator
  19. (cd /d %ANDROID_HOME%\platform-tools && adb shell "pm list packages -3|cut -f 2 -d : | xargs sh -c 'am start -n $1/.MainActivity' sh" && cd /d %cd%)
  20.  
  21. :: Done!
  22.  
  23. pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement