Submitting Cocos2D-X application to the Google Play Store

Hello! I’m developing on a Mac with Xcode and the process to submit to the Apple App Store seems to be a no-brainer. However submitting an application to the Google Play Store is a mystery to me. From the terminal I run the application on Android emulator with “cocos run -p android -j 4”. At the same time this generates a “xxx-debug.apk” file in the “debug/android” -folder. Is this the apk-file to submit to the Google Play Store, or should I create the correct apk by “cocos deploy” or something? I haven’t found any tutorials from start to finish to complete the whole process.

cocos -run -p android -m release

runs(and also compiles) a signed apk app in emulator or connected device. Generating keystore is another story… :slight_smile:

what about cocos deploy?

It’s pretty good. I often use it :smiley:

If you use Eclipse or android studio you only need to release an android app with signed keys just right click Android tools->export signed application package actually it’s easy.

I’d rather stick to the command line if possible. I found this tutorial and I wonder if it applies to Cocos2D-X applications too?

I found another tutorial which seems more in-depth:

http://ionicframework.com/docs/guide/publishing.html

The tutorial is for Ionic, but the steps to generate keystore, to sign and to zipalign seem to work for this case.

That’s something new.

I use Android Studio for android development. To build a release build you need to generate a keystore file, place it in the proj.android-studio/app folder and add the following to build.gradle file of your project (one with Module: YourGameName)

signingConfigs {
    release {
        storeFile file("your.keystore")
        storePassword "yourpasswordforkeystore"
        keyAlias "youralias"
        keyPassword "yourpasswordforalias"
    }
} 

After that, in the Build Variant tabs (it’s vertical, on the left side) set your game to release and build. Signed apk will be waiting for you in proj.android-studio/app/build/outputs/apk/

Thank you for your replies!

I’m new in to Eclipse and Android Studio, and I’ve been keen to using Xcode and debugging with a physical iOS device and then running the project in an Android emulator via terminal to check it’s running ok. So far it’s been great! Even though I like the Android ecosystem nowadays, I prefer Xcode for IDE and i’d like to finish the Android deployment steps via command line.

Android Studio is not a replacement for Xcode, but integrating third party libraries for Android and making wrappers is way easier in this IDE than anywhere else.