Cocos2d-x Android Pack

Source: Internet
Author: User

After the game is packaged in iOS, pack the APK;

Currently using the-X 3.0 if you need to modify build_native.py such as Ndk_root and some error

Modify android.mk Add source file local_src_files: = xxx

Tip: Use ls to command ls all source files, and then use tools like sublime to quickly add

Sublime Artifact

Compile

Libs/armeabi/libcocos2dcpp.so

Using Ant to build apk

xxx-release-unsigned.apk

Script (a few lines, lazy to organize)

#!/usr/bin/pythonImportSYSImportOS, Os.path#--------------Main--------------if __name__=='__main__': Os.chdir ('/users/linxiaojin/dev/git/mywork/game/polymer/cocos2d/cocos/platform/android/java/') Os.system ('/users/linxiaojin/dev/tools/adt-bundle-mac-x86_64-20140702/sdk/tools/android Update Project--path.') Os.system ('/users/linxiaojin/dev/tools/apache-ant-1.9.4/bin/ant Release') Os.chdir ('/users/linxiaojin/dev/git/mywork/game/polymer/proj.android') Os.system ('/users/linxiaojin/dev/tools/adt-bundle-mac-x86_64-20140702/sdk/tools/android Update Project--path.') Os.system ('/users/linxiaojin/dev/tools/apache-ant-1.9.4/bin/ant Release')

Generate release-signed.apk

Edit Ant.properties Join (possibly other wording)

Key.alias=android.keystore
Key.store=android.keystore
key.store.password=lin0-618
key.alias.password=lin0-618

Also execute ant

Get xx-release.apk

Other:

Android.keystore using command line generation

Keytool-genkey-alias android.keystore-keyalg rsa-validity 20000-keystore android.keystore

Cocos2d-x Android Packaging

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.