百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
T

TiShadow

> 编程语言
开源

Quick Titanium 在各设备上进行预览

385 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

Quick Titanium 在各设备上进行预览

TiShadow

TiShadow provides Titanium developers the ability to deploy apps, run tests or execute code snippets live across all running iOS and Android devices.

There are three parts to TiShadow: the TiShadow server, TiShadow app and TiShadow CLI which are all need.

Have a look at this presentation (July 2012) given at the TiLondon meetup for a look at most of what you can do with TiShadow. (Outdated)

Go to the new project website

Join the discussion on the Google Group. You can also find some TiShadow related blog posts here

Getting Started

TiShadow Install

TiShadow NPM Package

TiShadow is built on node.js and is required.

TiShadow can be installed via npm using the following command:

$  npm install -g tishadow

PLEASE NOTE: The package installs titanium hooks in the post install. If you install with sudo and get the error Unable to write config file... use the following command:

$ sudo npm install -g tishadow --unsafe-perm

Or if you want to use the master version directly from GitHub:

bash
  npm install -g dbankier/TiShadow

Using the Appcelerator CLI

By default TiShadow uses the (free) titanium and alloy cli's under the hood. If you are using the (paid) appc cli then use the following command after installation:

$ ts config --use-appc-CLI

NEW DUMMY'S PATH: TiShadow Express

You can do a lot with TiShadow. Keep reading this README to find out more. But if it is all too much at the moment and you just want to use it for live reload you can do the following.

During install a titanium cli plugin/hook was installed for you. From your project you can just use the following command:

  titanium build -p android -T device --shadow

This will launch your app in the simulator and reload with any code/style/localisation changes.

Under the hood it:

  1. starts the tishadow server - tishadow server
  2. creates and launches an appified version of your app - tishadow appify (with extra flags)
  3. watches your code and push on any changes - tishadow @ run --update

MAC: If you get the error EMFILE: Too many opened files., this is because of your system's max opened file limit. For OSX the default is very low (256). Increase your limit temporarily with ulimit -n 8192, the number being the new max limit.

TiShadow App

To create a new titanium project use the following command:

  tishadow app -d [destination folder]

e.g.

  mkdir ~/tishadowapp
  tishadow app -d ~/tishadowapp

NOTE: In general upgrade the server side and app at the same time (using the tishadow app command).

You can upgrade an existing tishadow app using the --upgrade flag.

Start the TiShadow Server

The server can be started by typing the following command:

  tishadow server

The following options are available:

    -h, --help             output usage information
    -p, --port       server port
    -l, --long-polling     force long polling
    -i, --internal-ip   internal ip to bind to
    -s, --screenshot-path   path to save screenshot (defaults to /tmp)
    -z, --manage-versions  manage and automatically update bundles

If --manage-versions is enabled, then bundle versions are tracked and devices that connect with an older version will automatically be updated. When using this mode, you can use the tishadow deploy command to send a new bundle to the server without pushing it to connected devices.

Remote Server Mode and Private Rooms

The TiShadow Server supports remote hosting with configurable http ports. It also allow for private "rooms" (much like chat rooms) so that the TiShadow server can be shared.

The tishadow log command is available to tail remote server logs (in the default or selected room).

The tishadow config command is available to set the default host, port and room for all the relevant command below.

Start the TiShadow App

Once the server is running launch the app. For example, to launch the app in the iPhone simulator using the Titanium CLI:

  cd ~/tishadowapp
  titanium build -p iphone

From the app just enter the ip address or hostname of the computer running the server and hit connect. (There are also more advanced connection settings that can be used for remote server connections.)

What you can do with TiShadow

Full Application Deployment

Go to the root folder of your project and enter the following command to deploy an app:

  tishadow run

If the app has been deployed and you want to push minor updates, use the following command:

  tishadow run --update

Here are full list of options:

…

The app is then cached on the device. If you need to clear the cache, use the following command:

  tishadow clear

Some notes and limitations

  • Only files in the Resources directory will be sent to the device using TiShadow. That said, localisation files are supported. (see options above).
  • Native modules can be supported if built into the TiShadow app first. (I.e., add them to the tiapp.xml of the TiShadow app.)
  • Custom fonts will be loaded if placed in the Resources/fonts directory for iOS only.
  • 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 server logs and webpage.

Testing / Assertions

TiShadow supports Jasmine BDD tests. (Insipration taken from these two projects: titanium-jasmine and jasmine-titanium)

Include your specs in the spec path of your project. Ensure the files are ending in _spec.js. (Note: simply write the spec without any including/requiring the jasmine library.)

To execute the tests enter the following command:

bash
  tishadow spec

Here are a full list of options:

…
…

javascript assert.isNumber(6, "Testing if 6 is a number"); assert.isArray([1,2,3,4], "Testing if it is an array");

…

tishadow run --locale es tishadow spec --locale nl


TiShadow REPL
-------------

The TiShadow REPL is available and evaluates commands in a
persistent sand-boxed context.

To Launch the REPL enter the following command:

```bash
  tishadow repl

With the following options:

    -h, --help         output usage information
    -o, --host   server host name / ip address
    -p, --port   server port
    -r, --room   server room

…


  $ tishadow screenshot

The screenshots will be saved in png format in the /tmp directory or the path configured using the --screenshot-path flag when starting the server.

Screencast mode

Instead of saving the screenshots you can stream them to the browser. Use the following command:

  $ tishadow screenshot --screencast 1000 --scale 0.1

In the above example a screenshot is sent every 1000ms and scales the images to 10% of their height/width. Go to: http://localhost:3000/screencast to view the screencast.

Code Snippets Via Webpage

Enter the following address in a browser window:

    http://localhost:3000/

…


  Usage: appify [options]

  Options:

    -h, --help                output usage information
    -d, --destination   target path for generated project
    -o, --host          set server host name / ip address
    -p, --port          set server port
    -r, --room          set server room

…


    :map  :w:!tishadow run --updatea
    :imap  :w:!tishadow run --updatea
    :map  :w:!tishadow runa
    :imap  :w:!tishadow runa

…


 project  : TiShadow
 repo age : 4 years, 8 months
 active   : 376 days
 commits  : 873
 files    : 240
 authors  :
   643	David Bankier           73.7%
    72	Fokke Zandbergen        8.2%
    42	dbankier                4.8%
    28	Jong Eun Lee            3.2%
    12	Guillermo Zunino        1.4%
     8	Javen Wang              0.9%
     8	InGrowth                0.9%
     7	Ismael Viamontes Marrero 0.8%
     4	Denny Biasiolli         0.5%
     3	Joshua Ogle             0.3%
     3	Eric Boehs              0.3%
     3	m1ga                    0.3%
     3	Michael                 0.3%
     2	Jordan                  0.2%
     2	kopiro                  0.2%
     2	noughts                 0.2%
     2	Matt Apperson           0.2%
     2	Chris Barber            0.2%
     2	Flavio De Stefano       0.2%
     1	clairecoloma            0.1%
     1	danghy                  0.1%
     1	falkolab                0.1%
     1	Carlos Henrique Zinato  0.1%
     1	jsjant                  0.1%
     1	katangagonzalez         0.1%
     1	iskugor                 0.1%
     1	Clément Blanco         0.1%
     1	Dan Kronholm, Bitfabrikken 0.1%
     1	Donggu Lee              0.1%
     1	Erlan                   0.1%
     1	Gilberto Avalos         0.1%
     1	Hazem Khaled            0.1%
     1	Hugh Cannon             0.1%
     1	Hy Dang                 0.1%
     1	Ivan Skugor             0.1%
     1	Jeff Bonnes             0.1%
     1	Jongeun Lee             0.1%
     1	Lee, Jong Eun           0.1%
     1	Lee, JongEun            0.1%
     1	Luis Cruz               0.1%
     1	Pedro Palmero           0.1%
     1	Terry Morgan            0.1%
     1	Timan Rebel             0.1%
     1	astronaughts            0.1%

Feedback appreciated.

@davidbankier

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

JavaScript

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言