Gulp Build Android project, install APK

Source: Internet
Author: User

Gulp Build Android project, install APK

Previous section Gulp installation and use this article says that Gulp can execute terminal commands, isn't there a lot of ideas,:)

This article is not much technical, only for entertainment

Test environment

    • mac:10.10.4
    • gulp:3.9.0
    • Android studio:1.3
    • time:2015 August 21 17:29:07
Premise

The entire Android project has been compiled in Android studio and is ready to work. If it is not compiled, it can only output the error log at the terminal.

File directory

|----gulpfils.js|----AndroidProject           |----app           |     |----build           |     |      |----xxxx              |     |              |     |----xxxx           |                 |----xxxx           |----xxxx
Build project, install APK

Everyone knows to build the project with gradle build , install apk with adb install xxx.apk .

Nonsense not much to say on the code

varGulp =require(' Gulp '), exec =require(' child_process '). Exec;gulp.task (' Default ', function(){exec' CD androidproject && gradle build ', function(){    if(Error!==NULL) {Console.log ("Gradle Build Error:"+ error); }Else{Console.log ("Gradle build OK"); exec' adb install-r androidproject/app/build/outputs/apk/app-debug.apk '); }  });});

This tool is not very convenient, save the dot on the compiler to compile, run the app.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Gulp Build Android project, install APK

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.