Last Friday I released a new version of TiShadow – 2.3.0. If you don’t know what TiShadow is, click on the link above, have a read and come back to this post.
The motivation behind TiShadow has always been to remove the pain points in the Titanium development lifecyle and in particular, speed things up. For example just type tishadow run
and your app is instantly running on all connected devices.
What’s Changed?
Till now, using TiShadow with Alloy meant doing something like this:
$ alloy compile --config platform=ios && tishadow run
As of the latest version, TiShadow detects Alloy projects and will compile them for you, so you can just do this:
$ tishadow run --platform ios
Or to push only the files that were changed since the last push:
$ tishadow run --platform ios --update
Okay, what else?
This isn’t just about saving characters. (Yes you can make this even shorter with ts run
or other custom aliases.) What it means is that Alloy has become a first class citizen. You can now use some of TiShadow’s other features to really speed up your Alloy development (e.g. spec
, appify
, etc).
One example is the in-built live reloads. In the past if you wanted to get live reloads working on code changes when using Alloy you needed to use grunt or supervisor. (If you haven’t seen JALT yet I strongly suggest you do.) But there are many tidevs that don’t use any of the Alloy preprocessor and for them adding a task runner to their work flow was a little much.
For some time TiShadow has support the @
operator that executes a TiShadow command on code changes. Now that TiShadow fully supports Alloy you can just do this:
$ tishadow @ run --platform ios --update
Or if you prefer to save keystrokes:
$ ts @ run -P ios -u
Here is a demo:
Comments
Mohamed Shaban
I really like Tishadow and use it in daily manner with all of my titanium applications.
But I want to ask if I use appify command for my application will it automatically upgrade itself if it found a new version uploaded to the server?
David Bankier Post author
Thanks Mohamed. If you start the tishadow server with the `–manage-versions` flag it will track versions and automatically upgrade an appified app when it connects, if it need it. You can use `deploy` instead of `run` to simply send a new version to the server without forcing a live upgrade. (Checkout ticaster.io which is a service that takes this concept to the next level.)
For any other TiShadow questions you can always post them on the TiShadow Google Group or on the Q&A tagged with `tishadow`.
LM
When I run
$ tishadow @ run –platform ios –update
I get
[INFO] Beginning Build Process
Bus error: 10
Any ideas?
Nidal
I couldn’t use this new functionality, ca you make a tutorial with a concrete app? Thanks
Nidal
I never get the message “Bundle Sent” in the terminal :/
David Bankier Post author
Have a look this first: http://tishadow.yydigital.com/getting%20started
For any other TiShadow questions you can always post them on the TiShadow Google Group or on the Q&A tagged with `tishadow`.
David Bankier Post author
Probably relates to this: https://github.com/gruntjs/grunt-contrib-watch/issues/204
I’m running node 0.10.22 and have no problems.
Andy Greenstreet
When trying this with a simple Alloy app (Hello World)
tishadow run
I get:
[Info] Compiling Alloy
[ERROR] Alloy Compile Error
object is not a function
Does this work with Alloy 1.3 / SDK 3.2?
If I create a simple classic app, I don’t get any issues at all.
Any thoughts?
Andy Greenstreet
Please ignore. I couldn’t get exec-sync to work correctly with Windows so i swapped tiShadow over to execSync. This requires a slightly different syntax for execution in compile.js. Anyone interested in a version that “seems” to work on Windows can take my fork out for a spin @ https://github.com/gstreetmedia/TiShadow.
David Bankier Post author
Hi Andy,
Thanks for the comment. You’re not the only one that had issues and there was already an issue raised on the repo to replace exec-sync with execSync.
For your interest, it needed a bit more than your commits. Here is the link that fixes the error: https://github.com/dbankier/TiShadow/commit/73c1da93a586175248d064831f08d67852160df8
I just push a new version to npm (2.3.1) with the fix in it.
David