BlackBerry WebWorks Deploy Bash Scripts

Things you should know: I am inherently a lazy coder and forgetful to make things worse.

This means every time I needed to build and deploy an app for debug or submission I have to remember what the heck I needed to do again. On top of that I had to figure out what the last buildID I used was.

That often led to a lot of annoyance on my part. To solve this problem I used my very basic Bash scripting knowledge from my day job to automate building (debug, signing and signing with debug) and versioning.

I hadn’t thought these scripts would be of interest to anyone but me, but it seems as though they might be.

You can modify either of those to do Smartphone builds, I just haven’t updated mine yet with the automatic buildID when signing so I am not including it yet (might add that over the weekend.)

Once you have these scripts just run:

./build_pb.sh <appname> <buildtype>
or
./build_bb10.sh <appname> <buildtype>

<appname> is the directory name where the app src is store
<buildtype> can be debug, sign or sign_debug

What the script does:

  • deletes the current build src
  • deletes current zip file
  • deletes current bar file (make a copy of the versions you want)
  • copies your new src to the build directory
  • strips .DS_store files (you can add other files/folders if you want)
  • creates a zip file
  • compiles with the proper SDK  and flags
  • deploys it to your specified device.

The finer points:
To make these work you need to have a fairly specific directory setup so they script properly does things for you (although you could customize this for yourself)

Source location (in my case: /Users/rory/Sites/<appname>/pb)
The important part here is ‘<appname>/pb’ you can tell the script the first bit, but all your app source needs to be structured like this or the script will fail.

Build location (in my case: /Users/rory/Sites/builds/<appname>/pb
Again the important part is ‘<appname>/pb’ you can tell it where to look for this but it will always be built in the same place. This directory needs to exist before the script is run.

That is it.

If you have any questions or feedback on these (or if you make improvements to them) I would love to hear about it. I am still learning the ropes of Bash scripting and would love to improve my skills.

BBM Hackathon – the sequel

Apparently my last entry worked!!!! I am one of the 10 (maybe 20) winners in the contest. I will be jetting off to NYC for 3 days in the middle of August for an intensive couple days of application development and instruction.

Now I must get all my ducks in a row, better map out the flow & feel of the BBM features I can add to my app. I have been doing more reading about the actual capability of BBM6 within an app, it has a lot of potential and really will fill out the more social aspects of my app that I was going to leave until v2. The more I read the more excited I get and the more possibilities that come to mind.

Let the plotting begin…