Editor’s note: below is a blog post from Bryan Higgins from the WebWorks team. @bryanhiggins on Twitter
The BlackBerry WebWorks SDK v2.0 introduces a new command line interface designed to help you complete tasks with ease.
If you’re already familiar with Apache Cordova or PhoneGap CLI, you will find the commands nearly identical. If you’re new to Cordova or just want a refresher, read on for a full tutorial. You might be surprised at how easy it is to use.
The first thing you’ll need to do is create a project. In the past, you had to manually create a folder with a config.xml file and web assets. This is now done automatically by the create command. Simply provide it a path along with an id and name for your app.
In most cases, you will want to access some of the device APIs. In WebWorks 2.0, not only can you access the full set of BB10 APIs, but also all of the Apache Cordova core plugins and many others developed by third parties.
The plugin command allows you to add, remove and list the plugins for your app.
The next thing you’ll likely want to do is test your app on a simulator or a device. If you go the simulator route, follow these instructions to get a BB10 simulator up and running, then use the emulate command.
To test on a device, use the run command. You no longer need to remember the IP address or manually generate a debug token. Make sure your machine is set up for signing and use the run command. You will be prompted for your device and keystore passwords.
Once you’re happy with your app, it’s time to post it to BlackBerry World. You will need to use the build command to generate a signed BAR file. See this page for more information on signing your app.
And there you have it – just a few simple commands to create, debug and package your app for distribution!
There are some additional commands and options available for more advanced scenarios. See here for full documentation of the WebWorks CLI.
Our usual channels are standing by to process your feedback on the new framework and tools we are delivering in this Beta, so we can ensure the Gold release is rock solid. Contact us in the forums, in the public issue tracker, and on Twitter at @BlackBerryDev.