[ 
https://issues.apache.org/jira/browse/CB-7665?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14153330#comment-14153330
 ] 

Michael Brooks commented on CB-7665:
------------------------------------

Hi [~websteve],

You're right, that would be hard to believe! But no, that's not what I'm trying 
to say.

When you run {{cordova build android}}, the Cordova CLI will prepare and build 
the Android project.

In the prepare step, it will translate the Cordova directory structure to the 
Android project. It merges web assets from {{merges/}} into {{www/}}, copies 
the {{www/}} assets into the Android project {{platforms/android}}, and runs 
some transforms described in {{config.xml}} against the Android project.

In the build step, it would execute {{ant debug}} in the Android project 
{{platforms/android}}. I believe {{ant debug}} in turn calls {{ant build}}. 
This will produce an unsigned APK.

When you run {{cordova build android --release}}, the prepare step is identical 
but the build step will instead execute {{ant release}}. The Android 
documentation on [Building in Release 
Mode|http://developer.android.com/tools/building/building-cmdline.html#ReleaseMode]
 explains that {{ant release}} will automatically sign and align your 
application using a specified keystore and alias. So, if you setup the keystore 
and alias correctly, {{cordova build android --release}} will produce a signed 
APK.

I hope that makes more sense!
Michael

> Release process for Google Play has no documentation, requires guesswork! 
> --------------------------------------------------------------------------
>
>                 Key: CB-7665
>                 URL: https://issues.apache.org/jira/browse/CB-7665
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: Android, CLI, Docs
>    Affects Versions: 3.5.0
>         Environment: Mac OS X Lion
>            Reporter: Steve Husting
>              Labels: patch
>             Fix For: 3.5.0
>
>
> I output my myApp version 12 project with: cordova build android --release
> It was output as myApp/platforms/android/ant-build/myApp-release-unsigned.apk
> I changed the name to the final apk name: myApp-release-unsigned.apk = 
> myApp.apk
> I copied the myApp.keystore file used on earlier myApps to the same folder. 
> Starting with that folder, I ran: jarsigner -verbose -sigalg SHA1withRSA 
> -digestalg SHA1 -keystore myApp.keystore myApp.apk myApp
> I successfully verified it with: jarsigner -verify -verbose -certs myApp.apk
> When I uploaded the myApp.apk to Google Play, it said that the file needed to 
> be zipaligned.
> The verbose output shows zipalign being done. So is there a bug when the apk 
> is made via cordova build android --release? 
> Is there a step missing that I should be taking? Unfortunately, all the 
> instructions for this on the Internet assume I'm not using Cordova. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to