Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :: place this batch file inside the created [cordovaproject] folder
- @echo off
- :: Re\Building android project with
- call cordova build android
- :: Copy the apk file (generated by cordova build) onto the Android SDK's platform-tools repository
- :: Enforcing a copy of the .apk (file type) and an .apk file overwrite (if already exists)
- echo YF|(xcopy ".\platforms\android\app\build\outputs\apk\debug\*.apk" "%ANDROID_HOME%\platform-tools\ionic_cordova_project.apk")
- :: Restart adb server
- (cd /d %ANDROID_HOME%\platform-tools && adb kill-server && adb start-server && cd /d %cd%)
- :: Install the project's apk file onto the current emulator
- (cd /d %ANDROID_HOME%\platform-tools && adb install ionic_cordova_project.apk && cd /d %cd%)
- :: Force the application to be triggered as a process onto the emulator
- (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%)
- :: Done!
- pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement