When building for a different target environment (development, test or production) conditional code in app/alloy.js is not updated in Resources/[platform]/app.js. This can cause serious errors when relying on the conditions for particular behaviour in ad-hoc and app store builds.
1. Create a project: ti create -t app -p ios -n conditions --id test.conditions -d .
2. Make it Alloy: cd conditions && alloy new
3. Insert the following snippet in both app/alloy.js and app/controllers/index.js:
4. Build the production for Simulator: ti build -p ios -b
5. Confirm that both Resources/iphone/app.js and Resources/iphone/alloy/controllers/index.js only have console.debug("if (ENV_DEVELOPMENT)"); which is correct
6. Build for ad-hoc or to device: ti build -p ios --target dist-adhoc
7. Confirm that Resources/iphone/app.js still has console.debug("if (ENV_DEVELOPMENT)"); while Resources/iphone/alloy/controllers/index.js is correctly updated to have console.debug("if (ENV_PRODUCTION)");