mobiletitaniumappceleratortishadow

Using TiShadow can I delete the cache on EVERY file change?


I'm running this command titanium build -p ios -T simulator --shadow in my Appcelerator Studio project dir and as a result the iOS simulator launches and my app is up and running.

The thing though, is that I have a SQLite db and a few other files which I wish to debug. As a result, I want ALL my app data to be deleted whenever I relaunch the app. (that is on every file save)

How can I do that?

Thank you.


Solution

  • migas answer was good but I finally ended up doing that:

    if(Alloy.Globals.debugMode){    //if we are debugging
        //find the file
        var f = Ti.Filesystem.getFile(Ti.Filesystem.applicationSupportDirectory, "myDb.sql");
    
        if(f.exists() == true){     //If it's there
             f.deleteFile();        //just delete it
        }
    }