One of the most frustrating things about development is the time wasted waiting for the compiler to build up your binary and then installing it either in a simulator (emulator if on Android) or on an actual device. It doesn’t matter if you are using Titanium, or xCode or Eclipse, it just takes time.
Now lets throw in that Apple locks up our devices and makes it difficult to actually push a binary to our devices.
In our shop, we use Titanium to build both iOS and Android applications from the same codebase. In over 2 years of development, only one app has gone our our doors that was single platform.
With that in mind, you can understand why I started looking for quicker ways to test code, either on my own devices, or on our developers’ devices.
iOS distribution was partially resolved with TestFlightApp, a (currently) free service that facilitates the distribution of apps built with ad-hoc provisioning profiles. The entire distribution process was a good bit faster overall, but we were still building and uploading a binary for each build. And it was only for iOS. If we wanted to test on Android, well, that was another build cycle and distribution through Dropbox.
I began to hear rumors and stories of black magic from Australia called ‘TiShadow’.
A Brief History of TiShadow
In March 2012, David Bankier, Director at YY Digital in Melbourne Australia, pushed a working copy of TiShadow to Github for the public to take a look at. He had allowed some folks to play with it early on.
In July 2012, David demonstrated TiShadow for the London Titanium Meetup from his offices in Melbourne over the Internet, a not so insignificant distance of 10,500 miles (16,800 km for those that haven’t rebelled yet).
In November 2012, David demonstrated his very latest modifications to his project at the Melbourne Titanium Meetup, features that we will look at in our second article on TiShadow.
So What Is It
TiShadow used to be a pretty big core hack. If you wanted to use it, had to download a custom modified Titanium Mobile SDK and build it yourself. Not an easy task for the majority of Titanium developers.
TiShadow essentially works by building and installing a single app on iOS and Android. This acts as a host or controller on the device. That client app connects to your TiShadow server which pushes your Titanium project source code and resources out to the device and runs it as if it was compiled into the client app.
How much time did it take? Well, how long does it take to zip up your project and push it OTA to a device? Thats it. Now think about this. You aren’t just pushing to a single device. You are pushing to all your test devices at the same time. Multiple savings.
How do I get Started
Those that know me, understand that I am brutally honest but not mean spirited. With that statement in mind, let me say: If you can’t follow the README.md in the GitHub Repo of TiShadow, you probably ought not to be thinking about using it.
David has done a very good job of making the installation as easy as possible and I am not going to take the time to duplicate his efforts.
- Install TiShadow from npm
- If you are using Android, you can find a client app already in Google Play. To build the binary yourself:
mkdir ~/tishadowapp tishadow app -d ~/tishadowapp
- Open up 2 terminals (osx) or a command prompts (winders).
- In one you start the server ’tishadow server’.
- Start your client app on the device and enter the ip address of the the system running the tishadow server.
- Now in the other command line interface, you cd on over to the root of a titanium project and type ’tishadow run’
- Your project, built properly and to good form using nice commonJS coding styles should pop up on your devices.
The prebuilt binary on Play may not have all the modules you will need in your project. It is enough to get you started, but be prepaired to build out your own custom client down the line.
Ti.include works partially. My belief is that you need to move away from this, so just updated your code and make your life so much easier already.
TiShadow – Taking it to the Cloud