Build the app file for Android

From Color Infection Wiki
Jump to: navigation, search

For your first app

  1. make sure the development tools are installed (Install devlopement tools).
  2. run git clone 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.
  3. download the latest ANE file from, 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.
  4. duplicate the demo folder and rename the new folder, such as "app-MyAppName", we call it app folder below.
  5. 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
  6. 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.
  7. modify the icons under the app folder as needed, don't change their sizes and names.
  8. 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.
  9. create a file named app.txt under the project folder, add a line = 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 = app-MyApp2 in it. The last line will be used, if it is not a comment line.
  10. 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.
  11. register as Google Play developer at to manage app description and screen shots and upload your app (need one time $25 fee).

For your non-first app

  1. run git pull under the project folder to update the build script (you should also update the project when rebuild an old app)
  2. if the extended feature is needed, re-download the latest ANE file from, and put it in the etc/anes folder under the project folder and change its name to PhyardAneAll.ane.
  3. 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.
  4. modify the app.config.txt file in the new app folder as needed.
  5. add a line = app-MyApp2 at the end of the app.txt file under project folder.
  6. 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.