Build the app file for Android
From Color Infection Wiki
For your first app
- make sure the development tools are installed (Install devlopement tools).
- run git clone https://bitbucket.org/tapir/app-packager-apk-air.git to get the app template project (in parent folder of the to-be-created project folder). All below commands should run in the project folder.
- on Windows, you should run it in a git shell window, which can be opened in the context menu of a folder view in File Explorer.
- this template project will be updated often, later, you can run git pull in the project folder to update it.
- download the latest ANE file from https://github.com/Phyard/ANE-Advertisements/releases, and put it in the etc/anes folder under the project folder and change its name to PhyardAneAll.ane.
- this file will also be updated often, so before building a new app release, please re-download this file.
- if your app don't need AdMob and other extended features, this file is not needed.
- duplicate the demo folder and rename the new folder, such as "app-MyAppName", we call it app folder below.
- there is a app.config.txt file in the app folder. You can change the app settings in it.
- set the AIR SDK path for your current OS only
- app version should be larger or equals 1.0.0
- download your design SWF file of your design (the for-building-android-app one) from the design revision page on Phyard, and put it under the app folder and rename it the same as the value App.Input.SWF.File assigned in app.config.txt.
- modify the icons under the app folder as needed, don't change their sizes and names.
- make sure your developer certificate is created
- if it is not created, run ant create-cert to create it. The certificate is created in the cert folder under the project folder. You will be prompted to set a password for using this certificate later.
- if there is already one certificate created, ant create-cert will backup the old one firstly then create a new one.
- Google recommends you use the same certificate for all your apps. So for your later apps, you can copy this certificate instead of creating a new one.
- create a file named app.txt under the project folder, add a line folder.app = app-MyAppName in it.
- a line starts with # in this file is a comment line and will be ignored.
- later, you may add more new apps in the project folder, such as "app-MyApp2" then you can add a new linefolder.app = app-MyApp2 in it. The last line will be used, if it is not a comment line.
- run ant release and input the certificate password to build a release for your app (for Google Play).
- the output file is placed in bin folder under the project folder.
- gnerally, a building needs 25 seconds to finish. But if AdMob or other extended features are needed (configed in app.config.txt), the building time would be about one and half minutes.
- the build script will increase the version number automatically. You can also manually modify it in app.config.txt
- before building the app release file, you can run ant test to test your app, but the behavior would be some different from the real mobile devices.
- register as Google Play developer at https://play.google.com/apps/publish/ to manage app description and screen shots and upload your app (need one time $25 fee).
For your non-first app
- run git pull under the project folder to update the build script (you should also update the project when rebuild an old app)
- if the extended feature is needed, re-download the latest ANE file from https://github.com/Phyard/ANE-Advertisements/releases, and put it in the etc/anes folder under the project folder and change its name to PhyardAneAll.ane.
- re-download AIR SDK if it is upated: http://www.adobe.com/devnet/air/air-sdk-download.html and set it path in app.config.txt.
- duplicate the demo folder or one old existed app folder and rename the new folder, such as "app-MyApp2", we call it new app folder below.
- modify the app.config.txt file in the new app folder as needed.
- add a line folder.app = app-MyApp2 at the end of the app.txt file under project folder.
- build and manage and upload
Install app release on Android test device
After your app is published on Google Play, you can download it there. Before the publishing, you can use USB cable or ftp over your wifi router to translate your app to mobile phones and install it.