How to clean build for Titanium Studio
In this post I will explain how to Clean all builds when working with Titanium Studio via the command line. As I have been only working to date with iphone specific, mobile apps. It should be noted this possibly wont work so well for clean builds on android, nor for desktop.
Clean build Titanium Mobile Projects
A warning.
This is very much a hammer approach, it removes all build projects. Not one.
This was created on a Mac.
This I am sure will ONLY work for iphone development.
You will delete all builds.
Understand the commands before you run them. If you delete code that is not backed up somewhere. That is your fault!
Follow the steps:
Lookup
find ~/Library/Application\ Support/iPhone\ Simulator/*/Applications/* -maxdepth 1 -type d -prune
If it looks good procced, if your nervous, cp the whole lot somewhere so you can put them back.
Lookup + delete
find ~/Library/Application\ Support/iPhone\ Simulator/*/Applications/* -maxdepth 1 -type d -prune | xargs -I{} rm -rfv {}
*Copy the whole line as the theme cuts off the last little bit
Clean the build for the site you want to rebuild
Now we clean within our projects.
cd INTO_YOUR_PROJECT rm -rf build/ mkdir -p build/iphone/
I added the "mkdir" part, as the first time I did a rebuild, it complained it was unable to find the tiapp.xml, yet when I hit "run" again, it just worked, so I concluded it was missing the directory.
Unanswered Question
How does the magic iphone number get displayed.
In the "Lookup" there were magic iphone numbers created, as hash of sorts. I searched my projects and couldnt find reference to them other than in the directory. Im guessing its an apple thing.
Equally, when you clean build, you will see you get a new id, so I think the hash involves the timestamp.









