{"id":13570148,"url":"https://github.com/dbankier/TiShadow","last_synced_at":"2025-04-04T06:32:05.152Z","repository":{"id":2723791,"uuid":"3718579","full_name":"dbankier/TiShadow","owner":"dbankier","description":"Quick Titanium previews across devices","archived":false,"fork":false,"pushed_at":"2023-01-07T04:10:17.000Z","size":116998,"stargazers_count":385,"open_issues_count":41,"forks_count":122,"subscribers_count":38,"default_branch":"master","last_synced_at":"2024-04-09T18:02:48.554Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://tishadow.yydigital.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dbankier.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-03-14T14:46:24.000Z","updated_at":"2024-03-04T02:55:53.000Z","dependencies_parsed_at":"2023-01-11T16:12:02.343Z","dependency_job_id":null,"html_url":"https://github.com/dbankier/TiShadow","commit_stats":null,"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbankier%2FTiShadow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbankier%2FTiShadow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbankier%2FTiShadow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbankier%2FTiShadow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dbankier","download_url":"https://codeload.github.com/dbankier/TiShadow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247123100,"owners_count":20887261,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T14:00:48.862Z","updated_at":"2025-04-04T06:32:05.123Z","avatar_url":"https://github.com/dbankier.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"TiShadow\n========\n\nTiShadow provides Titanium developers the ability to deploy apps, run tests or execute code snippets live across all running iOS and Android devices.\n\nThere are three parts to TiShadow: the TiShadow server, TiShadow app and TiShadow CLI\nwhich are all need.\n\n~~Have a look at this [presentation](http://www.slideshare.net/londontitanium/titanium-london-tishadow-july-2012) (July 2012) given at the TiLondon meetup for a look at most of what you can do with TiShadow.~~ (Outdated)\n\nGo to the new [project website](http://tishadow.yydigital.com)\n\nJoin the discussion on the [Google Group](https://groups.google.com/forum/?fromgroups=#!forum/tishadow).\nYou can also find some TiShadow related blog posts\n[here](http://www.yydigital.com/blog)\n\n\nGetting Started\n===============\n\nTiShadow Install\n----------------\n\n### TiShadow NPM Package\n\nTiShadow is built on [node.js](http://nodejs.org/) and is required.\n\nTiShadow can be installed via npm using the following command:\n\n```\n$  npm install -g tishadow\n```\n\n**PLEASE NOTE:** The package installs titanium hooks in the post install.\nIf you install with `sudo` and get the error `Unable to write config file...` use the following command:\n\n```\n$ sudo npm install -g tishadow --unsafe-perm\n```\n\nOr if you want to use the master version directly from GitHub:\n\n```\n  npm install -g dbankier/TiShadow\n```\n\n### Using the Appcelerator CLI\n\nBy default TiShadow uses the (free) `titanium` and `alloy` cli's under the hood. If you are using the (paid) `appc` cli then\nuse the following command after installation:\n\n```\n$ ts config --use-appc-CLI\n```\n\n### _NEW_ DUMMY'S PATH: TiShadow Express\n\nYou can do _a lot_ with TiShadow. Keep reading this README to find out more.\nBut if it is all too much at the moment and you just want to use it for\nlive reload you can do the following.\n\nDuring install a titanium cli plugin/hook was installed for you. From your project you can just use the following command:\n\n```\n  titanium build -p android -T device --shadow\n```\n\nThis will launch your app in the simulator and reload with any code/style/localisation changes.\n\nUnder the hood it:\n 1. starts the tishadow server - `tishadow server`\n 2. creates and launches an appified version of your app - `tishadow appify` (with extra flags)\n 3. watches your code and push on any changes - `tishadow @ run --update`\n\n**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.\n\n### TiShadow App\n\nTo create a new titanium project use the following command:\n\n```\n  tishadow app -d [destination folder]\n```\n\ne.g.\n\n```\n  mkdir ~/tishadowapp\n  tishadow app -d ~/tishadowapp\n```\n\n**NOTE**: In general upgrade the server side and app at\nthe same time (using the `tishadow app` command).\n\nYou can upgrade an existing tishadow app using the `--upgrade` flag.\n\nStart the TiShadow Server\n---------------------\n\nThe server can be started by typing the following command:\n\n```\n  tishadow server\n```\n\nThe following options are available:\n\n```\n    -h, --help             output usage information\n    -p, --port \u003cport\u003e      server port\n    -l, --long-polling     force long polling\n    -i, --internal-ip \u003cinternal-ip\u003e  internal ip to bind to\n    -s, --screenshot-path \u003cscreenshot-path\u003e  path to save screenshot (defaults to /tmp)\n    -z, --manage-versions  manage and automatically update bundles\n```\n\nIf `--manage-versions` is enabled, then bundle versions are tracked and\ndevices that connect with an older version will automatically be\nupdated. When using this mode, you can use the `tishadow deploy` command\nto send a new bundle to the server without pushing it to connected\ndevices.\n\n### Remote Server Mode and Private Rooms\n\nThe TiShadow Server supports remote hosting with configurable http\nports. It also allow for private \"rooms\" (much like chat rooms) so that\nthe TiShadow server can be shared.\n\nThe `tishadow log` command is\navailable to tail remote server logs (in the default or selected room).\n\nThe `tishadow config` command is available to set the default host, port\nand room for all the relevant command below.\n\n\nStart the TiShadow App\n----------------------\n\nOnce the server is running launch the app. For example, to launch the\napp in the iPhone simulator using the Titanium CLI:\n\n```\n  cd ~/tishadowapp\n  titanium build -p iphone\n```\n\nFrom the app just enter the ip address or hostname of the computer running the\nserver and hit connect. (There are also more advanced connection settings\nthat can be used for remote server connections.)\n\n\nWhat you can do with TiShadow\n=============================\n\nFull Application Deployment\n---------------------------\n\nGo to the root folder of your project and enter the following command to deploy an app:\n\n```\n  tishadow run\n```\n\nIf the app has been deployed and you want to push minor updates, use the following command:\n\n```\n  tishadow run --update\n```\n\nHere are full list of options:\n\n```\n    -h, --help                           output usage information\n    -u, --update                         only send recently changed files\n    -a, --patch                          patch updated files without causing app restart\n    -i, --inspector                      enable automatic inspection and spies\n    -l, --locale \u003clocale\u003e                set the locale in in the TiShadow app\n    -j, --jshint                         analyse code with JSHint\n    -t, --tail-logs                      tail server logs on deploy\n    -o, --host \u003chost\u003e                    server host name / ip address\n    -p, --port \u003cport\u003e                    server port\n    -r, --room \u003croom\u003e                    server room\n    -s, --skip-alloy-compile             skip automatic alloy compilation\n    -f, --alloy-compile-file \u003cfilename\u003e  compile only one alloy file\n    -P, --platform \u003cplatform\u003e            target platform\n    -D, --include-dot-files              includes dot files in the bundle (defaults to false)\n    -T, --target \u003capp_name\u003e              target TiShadow app (defaults to name on tiapp.xml or moduleid on manifest)\n    -c, --ticommonjs                     support for applications using the ti-commonjs library\n```\n\nThe app is then cached on the device. If you need to clear the cache, use\nthe following command:\n\n```\n  tishadow clear\n```\n\n__Some notes and limitations__\n\n * Only files in the Resources directory will be sent to the device\n   using TiShadow. That said, localisation files **are** supported. (see\n   options above).\n * Native modules _can_ be supported if built into the TiShadow app\n   first. (I.e., add them to the tiapp.xml of the TiShadow app.)\n * Custom fonts will be loaded if placed in the `Resources/fonts`\n   directory for iOS only.\n * If there any errors about a Titanium SDK command not being found, add\n   them to the Includes.js files and clean and build the TiShadow app. (I\n   will gradually be adding commands.)\n * Any Ti.API logs will be redirected to the server logs and webpage.\n\n\nTesting / Assertions\n--------------------\n\nTiShadow supports [Jasmine](http://pivotal.github.com/jasmine/) BDD tests.\n(Insipration taken from these two projects: [titanium-jasmine](https://github.com/guilhermechapiewski/titanium-jasmine/) and [jasmine-titanium](https://github.com/akahigeg/jasmine-titanium))\n\nInclude your specs in the `spec` path of your project. Ensure\nthe files are ending in `_spec.js`. (Note: simply write the spec without any including/requiring the jasmine library.)\n\nTo execute the tests enter the following command:\n\n```bash\n  tishadow spec\n```\n\nHere are a full list of options:\n\n```\n    -h, --help                           output usage information\n    -u, --update                         only send recently changed files\n    -l, --locale \u003clocale\u003e                set the locale in in the TiShadow app\n    -o, --host \u003chost\u003e                    server host name / ip address\n    -p, --port \u003cport\u003e                    server port\n    -r, --room \u003croom\u003e                    server room\n    -t, --type \u003ctype\u003e                    testing library\n    -j, --jshint                         analyse code with JSHint\n    -x, --junit-xml                      output report as JUnit XML\n    -P, --platform \u003cplatform\u003e            target platform\n    -s, --skip-alloy-compile             skip automatic alloy compilation\n    -f, --alloy-compile-file \u003cfilename\u003e  compile only one alloy file\n    -D, --include-dot-files              includes dot files in the bundle (defaults to false)\n    -T, --target \u003capp_name\u003e              target TiShadow app (defaults to name on tiapp.xml or moduleid on manifest)\n    -C, --clear-spec-files               clears only the spec files from the cache\n    -c, --coverage \u003creport_types\u003e        runs code coverage, for available report_types see https://github.com/gotwarlost/istanbul#the-report-command```\n```\n\n**NEW**: You can now select the testing library to use `jasmine`, `mocha-should` or `mocha-chai`.\nThe default library is `jasmine` to change that use, e.g. `tishadow config -t mocha-should`.\n\n**NEW**: test coverage reports using instanbul is also available using the `--coverage \u003creport_types\u003e` flag.\n\nThe test results will be returned to the server/cli output:\n![Spec Output](http://github.com/dbankier/TiShadow/raw/master/example/spec.png)\n\nSee the included example project or this [blog post](http://www.yydigital.com/blog/2013/2/14/Testing_Alloy_With_Jasmine_And_TiShadow).\n\n\n_Alternatively (yet not preferred/depcrecated)_\n\nTiShadow also supports the use of assertions and the results are\nreturned either to the browser or server logs.\n\nFor example:\n\n```javascript\n    assert.isNumber(6, \"Testing if 6 is a number\");\n    assert.isArray([1,2,3,4], \"Testing if it is an array\");\n```\n\nThe following assertion are supported:\n'equal', 'strictEqual', 'deepEqual', 'isTrue', 'isFalse',\n'isEmpty', 'isElement', 'isArray','isObject', 'isArguments', 'isFunction',\n'isString', 'isNumber', 'isFinite', 'isBoolean', 'isDate', 'isRegExp', 'isNaN', 'isNull',\n'isUndefined', 'lengthOf', 'match', 'has'\n\nAlso the equivalent not assertions are available as well, e.g.\n'notEqual', 'isNotString', 'isNotNumber', etc.\n\n\nConfigurable Localisation\n-------------------------\nTiShadow supports dynamic localisation. You can also chose the locale\nyou wish to use when launching your app/tests. Simply add the\ntwo-letter language code to your command. For example:\n\n```\n  tishadow run --locale es\n  tishadow spec --locale nl\n```\n\nTiShadow REPL\n-------------\n\nThe TiShadow REPL is available and evaluates commands in a\npersistent sand-boxed context.\n\nTo Launch the REPL enter the following command:\n\n```bash\n  tishadow repl\n```\nWith the following options:\n\n```\n    -h, --help         output usage information\n    -o, --host \u003chost\u003e  server host name / ip address\n    -p, --port \u003cport\u003e  server port\n    -r, --room \u003croom\u003e  server room\n```\n\n\n`launchApp(appName)`, `closeApp()` and `clearCache()` methods available\nto interact with apps cached in the TiShadow app.\n\n`require()`, `Ti.include()` and assets are relative the running app\ninside the TiShadow app.\n\n**note**: you can now also pipe to the tishadow repl using the `--pipe` flag. have a look\nat this [screencast](http://www.youtube.com/watch?v=f9ZLAtzJdGY)\n\n### Spies\n\nYou can add **spies** on objects so that you can modify them from\nthe repl at run time. In your code add the following command:\n`addSpy(name, object)`. This can be included as a comment, eg:\n`//addSpy(\"mywindow\",win)` which will be uncommented when pushed.\nTo get the object, simply use, e.g. `getSpy(\"mywindow\")` from the repl.\n\nIf you want to use the web-browser based inspector and/or automatic spy insertion,\nthen use the `--inspector` flag with `run` or `config`.\n\nScreenshots\n-----------\n\nYou can capture screenshots of all connected devices using the following command:\n\n```\n  $ tishadow screenshot\n```\n\nThe screenshots will be saved in `png` format in the `/tmp` directory or the path\nconfigured using the `--screenshot-path` flag when starting the server.\n\n### Screencast mode\n\nInstead of saving the screenshots you can stream them to the browser. Use the following command:\n\n```\n  $ tishadow screenshot --screencast 1000 --scale 0.1\n```\n\nIn the above example a screenshot is sent every 1000ms and scales the images to 10% of their height/width.\nGo to: `http://localhost:3000/screencast` to view the screencast.\n\n\nCode Snippets Via Webpage\n-------------------------\n\nEnter the following address in a browser window:\n\n```\n    http://localhost:3000/\n```\n\nIn the editor you can enter code and press Command+s to deploy the code\nsnippet to all connected devices. Have a look at the demo [video](http://www.youtube.com/watch?v=xUggUXQArUM).\n\nCoding from the webpage works much like the REPL and variables\nare stored in a sand-boxed context. See the next section.\n\n\nTiShadow Appify\n---------------\n\nThe `tishadow appify` command can be used to create a\nstand-alone app that is integrated with TiShadow. It automatically\nlaunches the contained tishadow bundle and connects to a pre-configured\nserver. The allows connecting to the deployed app via the repl and/or\npush upgrades.\n\n```\n  Usage: appify [options]\n\n  Options:\n\n    -h, --help                output usage information\n    -d, --destination \u003cpath\u003e  target path for generated project\n    -o, --host \u003chost\u003e         set server host name / ip address\n    -p, --port \u003cport\u003e         set server port\n    -r, --room \u003croom\u003e         set server room\n```\n\nSee the following [blog post](http://www.yydigital.com/blog/2013/2/19/TiShadow_Appify).\n\n**NEW**: if you want to quickly create and launch/deploy and appified app you can use\nthe tishadow titanium hook. For example\n\n~~~\n$ ti build -p ios -F ipad -T device --appify\n~~~\n\nTiShadow CLI defaults\n---------------------\n\nYou can use the `tishadow config` command to set some tishadow cli defaults.\n\nThe following are some of the options you can set:\n\n~~~\n    -h, --help                           output usage information\n    -o, --host \u003chost\u003e                    set default server host name / ip address\n    -p, --port \u003cport\u003e                    set default server port\n    -r, --room \u003croom\u003e                    set default server room\n    -i, --inspector                      enable automatic inspection and spies\n    -b, --boost                          use super fast selective alloy compilation\n    -t, --type \u003ctype\u003e                    default testing library\n    -w, --watch-delay \u003cmillis\u003e           time to wait before responding to for changes (default: 0)\n    -i, --watch-interval \u003cmillis\u003e        time to wait between checking files for changes (default: 100)\n    -x, --watch-exclude \u003cglob\u003e           files to exclude from watch\n    -n, --network-interface \u003cinterface\u003e  set default network interface (used in express mode)\n    -e, --error-notification             enable error notification on macOS, Windows, Linux\n~~~\n\n\nLaunch From Web\n---------------\n\n_Currently only working on iOS_\n\nYou can also use TiShadow to bundle an app and launch it from a web\npage. Use the command `tishadow bundle` to bundle the app for a\nTiShadow distribution. Then include a link to the bundle in your webpage\nusing the following format, e.g. : `tishadow://mydomain.com/bundle.zip`.\nTapping on the link from your browser should launch the app in TiShadow.\n\n\nVIM Shortcuts\n-------------\nThose using vim/gvim/mvim for development might want to add these\nshortcuts (or similar) to the .vimrc/.gvimrc files. It add the shortcuts, F6\nto save and do a tishadow update, and Shift+F6 to save and perform a full\ntishadow deploy:\n\n```\n    :map \u003cF6\u003e \u003cEsc\u003e:w\u003cCR\u003e:!tishadow run --update\u003cCR\u003ea\n    :imap \u003cF6\u003e \u003cEsc\u003e:w\u003cCR\u003e:!tishadow run --update\u003cCR\u003ea\n    :map \u003cS-F6\u003e \u003cEsc\u003e:w\u003cCR\u003e:!tishadow run\u003cCR\u003ea\n    :imap \u003cS-F6\u003e \u003cEsc\u003e:w\u003cCR\u003e:!tishadow run\u003cCR\u003ea\n```\n\n\nCredits\n=======\n\nThe server code uses the following and are included:\n\n * [node.js](http://nodejs.org/)\n * [express](http://expressjs.com/)\n * [socket.io](http://socket.io)\n * [Twitter Bootstrap](http://twitter.github.com/bootstrap/)\n * [Ace](https://github.com/ajaxorg/ace)\n\nThe app is built using [Appcelerator](http://www.appcelerator.com/)'s\nTitanium.\n\nThird Party Modules\n-------------------\n\n### Websockets/Socket.IO\n#### iPhone/Android\nCopyright 2012 jordi domenech jordi@iamyellow.net Apache License, Version 2.0\n\n[Github Repo](https://github.com/iamyellow/tiws)\n\n\n### ZIP Modules\n#### iPhone/Android\n\nNow using ti.compression:\n[titanium_modules](https://github.com/appcelerator/titanium_modules)\n\nContributing \u0026\u0026 Contributors\n----------------------------\n\nGoing forward, please use [Prettier](https://github.com/prettier/prettier) for code formatting with the `--single-quote` option\n\n```\n project  : TiShadow\n repo age : 4 years, 8 months\n active   : 376 days\n commits  : 873\n files    : 240\n authors  :\n   643\tDavid Bankier           73.7%\n    72\tFokke Zandbergen        8.2%\n    42\tdbankier                4.8%\n    28\tJong Eun Lee            3.2%\n    12\tGuillermo Zunino        1.4%\n     8\tJaven Wang              0.9%\n     8\tInGrowth                0.9%\n     7\tIsmael Viamontes Marrero 0.8%\n     4\tDenny Biasiolli         0.5%\n     3\tJoshua Ogle             0.3%\n     3\tEric Boehs              0.3%\n     3\tm1ga                    0.3%\n     3\tMichael                 0.3%\n     2\tJordan                  0.2%\n     2\tkopiro                  0.2%\n     2\tnoughts                 0.2%\n     2\tMatt Apperson           0.2%\n     2\tChris Barber            0.2%\n     2\tFlavio De Stefano       0.2%\n     1\tclairecoloma            0.1%\n     1\tdanghy                  0.1%\n     1\tfalkolab                0.1%\n     1\tCarlos Henrique Zinato  0.1%\n     1\tjsjant                  0.1%\n     1\tkatangagonzalez         0.1%\n     1\tiskugor                 0.1%\n     1\tClément Blanco         0.1%\n     1\tDan Kronholm, Bitfabrikken 0.1%\n     1\tDonggu Lee              0.1%\n     1\tErlan                   0.1%\n     1\tGilberto Avalos         0.1%\n     1\tHazem Khaled            0.1%\n     1\tHugh Cannon             0.1%\n     1\tHy Dang                 0.1%\n     1\tIvan Skugor             0.1%\n     1\tJeff Bonnes             0.1%\n     1\tJongeun Lee             0.1%\n     1\tLee, Jong Eun           0.1%\n     1\tLee, JongEun            0.1%\n     1\tLuis Cruz               0.1%\n     1\tPedro Palmero           0.1%\n     1\tTerry Morgan            0.1%\n     1\tTiman Rebel             0.1%\n     1\tastronaughts            0.1%\n```\n\nFeedback appreciated.\n\n@davidbankier\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbankier%2FTiShadow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdbankier%2FTiShadow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbankier%2FTiShadow/lists"}