Quick Titanium previews across devices
Switch branches/tags
Nothing to show
Pull request Compare This branch is 896 commits behind dbankier:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
build
ruble
server
LICENSE
README.md
mobilesdk-tishadow-osx.zip

README.md

TiShadow

TiShadow provides Titanium developers the ability to write code snippets in a browser and render the code across all iOS and Android devices. NEW TiShadow now also allows the deployment of apps to devices. There are three parts to TiShadow, the TiShadow server, TiShadow app and build scripts for deploying full applications.

Have look at the following video to get any idea of how to use TiShadow and what it can do.

TiShadow Server

The server side uses the following and are required:

The server code also uses the following and are included:

After cloning the server code, make sure you run the following to install dependancies:

    npm install -d

The server can then be started like any nodejs app:

    node app.js

TiShadow App

The app is built using Appcelerator's Titanium.

NEW

TiShadow App now requires the following:

  • Some native zip modules what are included in the app/modules directory. Install these as you would any native module. Please see the README file there.
  • A custom build of the Titanium SDK. These can be retrieved from the tishadow branch of my fork of the titanium mobile sdk.

Clone the code and run/install as you would any Titanium project.

How To

Common Tasks

Fire up the server and launch the app. From the app just enter the ip address of the computer running the node server and hit connect.

Code Snippets Via Webpage

Enter the following address in a browser window:

    http://localhost:3000/

In the editor you can enter code and press Command+s to deploy the code snippet to all connected devices.

Have a look at the demo video.

If you want to include setup and clean up code, make sure you wrap your code in an anonymous function that returns open and close functions.

For example, a window could be one such object:

    (function() {
      var win = Ti.UI.createWindow();

      return win;
    }());

Full Application Deployment

Recently added to TiShadow is the ability to deploy full application. It is still in beta, but can be used for simple application.

Simply go the project root of your folder and run the tishadow script included in the build folder. You may want to include the script in your environment path.

If the app has been deployed and you want to push minor updates enter tishadow update in the command line.

Some notes:

  • Only works with applications that use the CommonJS structure. The use of Ti.include will not work.
  • Only files in the Resources directory will will be sent to the device using TiShadow. Localisation and custom changes to the Android Manifest are not supported.
  • Native modules can be supported if built into the TiShadow app first. (I.e., add them to the tiapp.xml of the TiShadow app.)
  • If there any errors about a Titanium SDK command not being found, add them to the Includes.js files and clean and build the TiShadow app. I will gradually be adding commands.)
  • Any Ti.API logs will be redirected to the tishadow webpage.

If you want to make sure the previous app deployed is closed prior to launching the new one, include the following code snippet in your app.js file:

    try {
      exports.close = function() {
        // Your code to close, e.g, main_window.close();
      };
      Ti.API.info("Running in TiShadow");
    } catch (e) {
      Ti.API.info("Running stand-alone");
    }

VIM Shortcuts

Those using vim/gvim/mvim for development might what to add these shortcuts (or similar) to the .vimrc/.gvimrc files. It adds the shortcuts, F6 to save and do a tishadow update, and Shift+F6 to save and perform a full tishadow deploy:

    :map <F6> <Esc>:w<CR>:!tishadow update<CR>a
    :imap <F6> <Esc>:w<CR>:!tishadow update<CR>a
    :map <S-F6> <Esc>:w<CR>:!tishadow<CR>a
    :imap <S-F6> <Esc>:w<CR>:!tishadow<CR>a 

Feedback appreciated.