0

I need to use grunt-phonegap-build, I have used this method programmatically:

grunt.loadNpmTasks('grunt-phonegap-build');  
  grunt.initConfig({
                "phonegap-build": {
                        debug: {
                              options: {
                                    archive:"myapp.zip",
                                   "appId":"567576",
                                   "user": {
                                        "email":******,
                                        "password":******
                                        },
                                    download:'dist/android.apk'         
                               }
                         }
                  }
                });
  grunt.tasks('phonegap-build', {}, function(args) {
     grunt.log.ok('Done running tasks.');
  });

Problem is executing repeat the same process and after "done running tasks". Sometimes it executes one time. When I press the button call this function via ajax. I have no idea, can u please explain this? How to solve this?

Terminal process:

  Running "phonegap-build:debug" (phonegap-build) task
>> Starting upload
>> Upload successful (HTTP 200)
>> Checking build status successful (HTTP 200)
>> Getting download location for ios successful (HTTP 302)
>> Downloading ios app
>> Checking build status successful (HTTP 200)
>> Checking build status successful (HTTP 200)
>> Downloaded ios app

Running "phonegap-build:debug" (phonegap-build) task
>> Starting upload
>> Checking build status successful (HTTP 200)
>> Checking build status successful (HTTP 200)
>> Upload successful (HTTP 200)
>> Checking build status successful (HTTP 200)
>> Getting download location for ios successful (HTTP 302)
>> Downloading android app
>> Checking build status successful (HTTP 200)
>> Checking build status successful (HTTP 200)
>> Downloaded android app

Done, without errors.

manually if i give grunt phonegap-build command in CLI. it it working fine. Can u help me?

programmatically execution the grunt is not working properly

Angu
  • 862
  • 2
  • 13
  • 32
  • even though this script uses phonegap-build, it is not related to *Phonegap Build*. The issue you are describing \*may\* have something to do with *Phonegap Build API* but not *Phonegap Build*. –  Mar 30 '16 at 11:55

1 Answers1

0

Please create default task first and then call your custom phonegap task.

if you are doing same and i am not getting post your full gruntfile so i can run it here and

khajaamin
  • 856
  • 7
  • 18