3 Replies Latest reply on Aug 29, 2016 8:26 AM by frazebook

    Download app using cli


      Was wondering if there is any way to use the cli to download an app to a local folder after it has been made using phonegap build?  Basically, I have made an app using phonegap build which I can download from the link on the build page or the QR code.  I would really like to be able to download the .apk file though, for example using something like 'curl https://build.phonegap.com/apps/2235530/download/android -O myApp.apk'.  Does anyone know if this can be done?

        • 1. Re: Download app using cli
          kerrishotts Adobe Employee

          PGB will give you a download link; you should be able to `curl` that link and get the APK. (I'm guessing the app probably needs to be public for this to work; otherwise you'd end up needing to authenticate through curl somehow.)

          • 2. Re: Download app using cli
            frazebook Level 1

            Many thanks for the suggestion.  Unfortunately, ticking 'Allow public sharing' in Settings doesn't help, and PGB requires 'Private application' to be ticked in order to build from a zip file.


            I'm hoping that your answer is basically right still though, i.e. it can be done with curl.  I'm guessing that I need something to go after the /android in the file name.  However, trying '/HelloWorld-debug.apk', which is what the file is called if downloaded from the link, doesn't work - the file that gets downloaded by curl says that the file cannot be found.


            Any other suggestions?

            • 3. Re: Download app using cli
              frazebook Level 1

              I think I've solved it.  The html returned using curl ending in /android gives a link - using curl again with that link, removing anything after the ? in the link, succeeds.  Many thanks anyway for your suggestion/help!