How to package AIR app for Google Android emulator

It is quite easy to create mobile version of application with Flash Builder Burrito “Preview”. You can run and test this application with Google Android emulator. There are few tricks how to achieve it.

1. Download Flash Builder Burrito and Android SDK.

2. Unpack Android SDK, run SDK manager, download all updates.

3. Add two paths to your PATH system variable: Flex SDK/bin and Android SDK/platform-tools. You will be able to run adt (Flex) and adb (Android) commands.

4. Create Virtual Device in Android SDK Manager. Target platform must be Android 2.2. Android 2.3 does not work with emulator version of AIR. Start this new device.

5. Open shell/command line and go to directory Flex SDK/runtime/air/android/emulator. Install AIR Runtime to Virtual Device by this command:

adb install Runtime.apk

6. Create Mobile project in Flash Builder. Try to run it. It will create some files in bin-debug directory.

7. Open shell/command line and go to this bin-debug directory. Create package for Android emulator:

adt -package -target apk-emulator -storetype pkcs12
-keystore cert.p12 Main.apk Main-app.xml Main.swf

Note: cert.p12 could be create by Flash Builder in “Export release build” step.

8. Install the package to Android emulator:

adb install Main.apk

That’s all :-)

Notes:

  • performance – Air on Android Emulator is quite slow. Real HW is much faster.
  • update application – Add -r to command. It will reinstall package:
adb install -r Main.apk
No votes yet.
Please wait...

Leave a comment

2. January 2011 at 20:09 - Rich Internet Application (Tags: , , , , , ). Both comments and pings are currently closed.

2 Responses to “How to package AIR app for Google Android emulator”

  • Gioni says:

    adb install Main.apk,
    Gives me this error: install_Failled_Invalid_apk.No know why?

    No votes yet.
    Please wait...
  • Arshay says:

    .apk file does not run in Android 3.1 emulator please suggest how to run.

    No votes yet.
    Please wait...