Home

Awesome

#Titanium Profiler (iOS) This project provides a web interface for interacting with a custom extension to the Titanium Mobile framework allowing to profile Ti Mobile applications running in the iOS simulator.

The whole system is based on the following components:

  1. A custom version of the 2.1.0.GA Titanium SDK used to build and execute the Titanium Mobile application to be profiled (md5 hash of the zip file: 06c2133c753ba0cda62cac603552dbaa)
  2. A node.js server component (tiprofiler)
  3. A client web application providing a UI for interacting with the profiler and extracting profiling data

This video showcases the basic interaction between such three components.

Installation

Custom Ti SDK

The following two steps are mutually exclusive

Full SDK package (2.1.0.GA-profiler)

Download [this package](https://s3.amazonaws.com/titaniumninja/tiprofi ler/2.1.0.GA-profiler.zip) and install it in you Titanium SDK mobilesdk directory. Such directory should be one of the following:

* /Library/Application\ Support/Titanium/mobilesdk/osx/
* ${HOME}/Library/Application\ Support/Titanium/mobilesdk/osx/

There, you should find your standard Titanium SDK installs (e.g. 2.0.1.GA2, 2.1.0.GA, etc.). Extract the content of the above package there, so that the contents of the SDK directory would look like (depending on the actual versions of the sdk installed in your system):

$ ls /Library/Application\ Support/Titanium/mobilesdk/osx/

  2.0.1.GA
  2.0.1.GA2
  2.1.0.GA
  2.1.0.GA-profiler
 

The custom SDK package is essentially identical to the official 2.1.0.GA one, except that it contains a modified version of the TiJSCore library (libTicore.a), and the default Xcode application project has been modified in order to link the Security framework from iOS. For some hints on the modifications required by the TiJSCore library in order to enable the profiling of Titanium JavaScript applications you can check out this post.

At the moment, the custom libTicore.a library is distributed exclusively in binary form and the contained modifications are not released as open source, but they may well be in the future.

Installing the libTiCore.a binary alone, without the prebuilt package

Anybody wanting to follow all the steps, without using the prebuilt package, can download a custom build of the libTiCore.a library, copy it in the ${TI_SDK}/iphone directory of a 2.X.X version of the Ti SDK (where ${TI_SDK} for example is /Library/Application\ Support/Titanium/mobilesdk/osx/2.1.0.GA, open the ${TI_SDK}/iphone/iphone/Titanium.xcodeproj) and add there a reference to the Security framework.

Server component installation

You need to have node.js installed in your system and once you have cloned this repository you need to update its dependencies:

	npm install -d

you can then run the server as any node program with:

	node server.js

or create a global link with:

	sudo npm link

then you can start the the server from anywhere with:

	tiprofiler

The server only depends on socket.io.

Client app

Once the tiprofiler server is running, you can point your browser to:

http://localhost:9876/app/index.html

and a web-based GUI will be presented to you.

The client app is extremely simple at the moment, and when a Ti application built with the above custom SDK is running inside the iOS emulator, it allows to do the following:

Technologies

The client app is built on top of the following technologies:

Limitations

Currently TiProfiler suffers from the following limitations (and surely many others) :

Disclaimer

TiProfiler is not meant to be used in a production environment. The custom Ti SDK contains modifications that can affect both the performance and the overall security of your Titanium application, so it is meant to be used in a restricted development environment.

Do not distribute iOS applications built with such version of the SDK. Sending applications built with such version of the SDK to Apple for revision may cause a rejection of the app for distribution through the AppStore.

In particular, the following clause is to be retained valid for the use of this distribution of the Titanium SDK, containing closed source modifications to the JavaScriptCore library:

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.   

License