Skip to content

Instantly share code, notes, and snippets.

@billdawson
Created January 11, 2012 21:41
Show Gist options
  • Save billdawson/1596914 to your computer and use it in GitHub Desktop.
Save billdawson/1596914 to your computer and use it in GitHub Desktop.
Speeding up Titanium Build

Speeding up Titanium Mobile Build

(The command examples assume OS X).

Just about everything that happens when you enter scons is for Android. So anything you can do to speed up the Android part of our build will be useful.

  • Android NDK r7 can use ccache. We get huge improvements in build time with it. So install it (if you have HomeBrew, brew install ccache) then set a shell variable NDK_CCACHE to point to it. I.e., for me, having installed it with brew, it would be export NDK_CCACHE=/usr/local/bin/ccache.

  • NDK can also parallelize while compiling. Set a shell variable NUM_CPUS to (according to Opie) 2x the number of cores in your machine. A quick way to get the # cores on your machine in OS X is system_profiler | grep "Number Of Cores" in terminal. I have 2 cores, so my shell var setting is export NUM_CPUS=4.

  • Skip building the JSCA files (the files used by Titanium Studio's code assist feature). You don't need them if you're just making a build for yourself for testing. To skip, run scons like this: scons build_jsca=0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment