Running bleeding-edge Spaz Desktop builds, or building from source

Notes on xAuth

Spaz uses xAuth to authenticate with Twitter. We do not distribute our consumer key and secret per Twitter's request. You will need to:

  1. Register an app at Twitter, and get your own consumer key and secret
  2. Request xAuth access by emailing api@twitter.com (more info)
  3. When you get your keys, rename app/auth_config_sample.js to app/auth_config.js and fill in the correct values

If you don't want to go through these steps, you'll need to use end-user test builds, and won't be able to run from source.

Running Spaz in the AIR debugger

If you're interested in contributing to Spaz, or just to play with the bleeding edge version, you'll need to at least be able to run it in the AIR debugger app. Here's the very short version:

  1. Get the source code. You can either download a zip file or tarball, or use git to clone the repo:

    git clone git://github.com/funkatron/spaz-desktop-air

  2. Download the AIR 2 SDK from Adobe

  3. Use the adl program to launch Spaz:

    <path to AIRSDK>/bin/adl <path to source folder>/application.xml

On Windows, you'll use adl.exe, and change the forward slashes into backslashes, but otherwise it's the same. Either way, you might consider putting this into a shell script or batch file to make it a bit easier to launch. You might want to use adl -nodebug to get somewhat better performance if you plan on using your local version a lot.

Packaging Spaz

Note: packaging yourself is not recommended – it's much more complex and error-prone

You can also package Spaz for distribution, but that's not hugely advantageous over just running it via the debugger. You also have to make your own signing cert, and the AIR installer will treat your version of Spaz as a different app because of the change in signing cert. Still, if you want to build it yourself, here's how:

To build Spaz Desktop you need:

Getting the source code and AIR SDK are described above. You can get the AIR 2 beta runtime

Now, to the build!

There are two main CLI tools for working with AIR HTML apps:

  • adl: the debugger
  • adt: the packager

Each of these is in the /bin directory of the SDK.

adl is for debugging. It gets the app running very fast, and you can watch the console for errors and debugging info. My command to test Spaz is like this:

~/airsdk/bin/adl ~/Sites/spaz/application.xml

So all you really do is run adl and give it the location of the application descriptor XML file.

For adt, the packager, it's much more complex. First you have to generate a self-signed certificate. To do so, use something like the following (all one line!):

/path/adt -certificate -cn '<name>' -o '<organization>' -c US 2048-RSA /outputpath/certname.pfx <password>

So you'll have a cert file now. Next, you need to package everything. For Spaz, it looks something like this (all one line):

/path/adt -package -storetype pkcs12 -keystore /outpath/certname.pfx  /path/to/place/installer/<filename>.air application.xml app/ bootstrap.html css/ html/ images/ index.html sounds/ spazcore/ themes/ vendors/

So you give it the type of cert, where it is, where to make the .air package, the location of the app.xml file, and a list of all the folders and directories to include. In the case above, we also cd'ed to the root of the app before this was run.

Since Spaz is in a git repo, if we just package it up from the filesystem, we'll get an extra .git folder with a lot of crap we don't need. So what I do is build with a shell script that takes care of copying the source code to a temp folder, and then deleting the .git folder within.

Here's a paste of the build script (with some info redacted): http://www.friendpaste.com/6wIIdIpEx4drM4HgitBt2M

Questions? Problems? Visit the Spaz Google Group for help: http://groups.google.com/group/spaz-users/