Would you like to tell us how we are doing?

You bet No thanks

Test applications using the command line

You can use the command line tools that are included with the for Adobe AIR to package and deploy applications to the BlackBerry 10 Simulator. Before you can package your Adobe AIR application, you must compile your Adobe ActionScript project using the tools included in the Adobe Flex SDK.

Package and deploy your application to a BlackBerry simulator

Before you begin:
  • Use the command line tools included with the Adobe Flex SDK to compile your Adobe ActionScript project into a *.swf application.
  • Add the path to the bin subfolder where you installed the BlackBerry 10 SDK for Adobe AIR to the PATH environment variable for your operating system.
  • For more information about command line options, run blackberry-airpackager from the command line with no options.
  1. Open a command prompt.
  2. Navigate to the folder where your *.swf application and XML configuration files are stored.
  3. Type the following command to package and run your application in the BlackBerry 10 Simulator .
    blackberry-airpackager -package [project_name].bar 
    -installApp -launchApp [project_name]-app.xml [project_name].swf 
    [ANE files][icon file][other_project_files] -device [Simulator_IP_address] 
    -password password -forceAirVersion 3.1

    By default, the simulator does not have a password enabled, so the -password option is not required. Files such as [icon file][other_project_files] are optional, and should be included as needed.

    Your application may not be using Adobe AIR runtime version 3.1. To compile and deploy your BlackBerry 10 application, use -forceAirVersion 3.1 to force the packager to use version 3.1 of the Adobe AIR runtime.

    You must include any AIR Native Extension (ANE) files when you package your application. If you do not copy the *.ane file into your project directory you will have to specify the path to the *.ane files.

    Operating System Default location of the ActionScript native extensions
    Windows (x64) \Program Files (x86)\Research In Motion\blackberry-tablet-sdk-<version>\frameworks\libs\qnx\ane
    Windows (x86) \Program Files\Research In Motion\blackberry-tablet-sdk-<version>\frameworks\libs\qnx\ane
    Mac /Applications/SDKs/Research In Motion/blackberry-tablet-sdk-<version>/ frameworks/libs/qnx/ane

Package and deploy your application to a BlackBerry device

Before you begin:
  • Use the command line tools included with the Adobe Flex SDK to compile your Adobe ActionScript project into a *.swf application.
  • Add the path to the bin subfolder where you installed the BlackBerry 10 SDK for Adobe AIR to the PATH environment variable for your operating system.
  • Create a debug token, and install it on the BlackBerry device. For more information on debug tokens, see Create a debug token from the command line.
You can use the BlackBerry 10 SDK for Adobe AIR to run an unsigned application on a BlackBerry 10 device that has a debug token installed.

You can find the blackberry-airpackager tool in bin subfolder where you installed the BlackBerry 10 SDK for Adobe AIR .

  1. When you package your application, include -debugToken to extract author and authorId from <token> and apply it to your application.
    blackberry-airpackager -devMode -debugToken <token> 
    -package <Project_name.bar> <Project_name-app.xml> 
    <bar-descriptor.xml> Project_name.swf 
    <ANE_files.ane> <others files...>

Debug your application using the command line

  1. To debug your application using the command line, you'll need to compile your application into a *.swf file with debugging enabled. Use the amxmlc tool to compile your application using the following command:
    amxmlc -compiler.debug [project name].as
  2. Open a second command line console, and run the following command to open the Flash Debugger tool:
    fdb
  3. In the first command line console, prepare the following command, but do not press Enter:
    blackberry-airpackager -target bar-debug -connect [Computer_IP_address] -package 
    [project_name].bar -installApp -launchApp [project_name]-app.xml 
    [project_name].swf [ANE files][icon file][other_project_files] 
    -device [Simulator_IP_address] -password password

    By default, the simulator does not have a password enabled, so the -password option is not required. Files such as [icon file][other_project_files] are optional, and should be included as needed.

  4. In the second console, run the following command:
    run

    The Flash Debugger times out after 60 seconds, so it is recommended that you prepare the command in step three before entering the run command.

  5. In the first command line console, enter the command you prepared in step three.
Your application deploys to the simulator and connects to the debugger in the second command line console. It may take some time for the simulator to connect. When the simulator connects, enter breakpoints, use the continue command to start execution without breakpoints, or use the help command for additional information.

If you have a firewall operating on your computer, it may interfere with the debugging tool. Make sure that port 7935 is open.



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus