Problem Description
The argument --deploy-type or -D is ignored if the target is android, always generating 'development' for emulator and 'test' for device, even if specified the other way. iOS works fine. I didn't test all the others platforms.
Steps to reproduce
Since we use these settings to trigger our testing scripts, figured I'd give it a test. Ti.App.deployType seems to work fine here. But your settings from the config.json file do not.
added the following to my alloy.js to test faster:
console.log('Ti.App.deployType: ', Ti.App.deployType);
console.log('Alloy.CFG: ', Alloy.CFG);
Results:
Genymotion Google Nexus 5 - 5.0.0 - API 21 - 1080x1920 (5.0.0)
[INFO] Ti.App.deployType: test
[INFO] Alloy.CFG: {"dependencies":{},"TEST_STRING":"TEST ENV"}
[INFO] Ti.App.deployType: development
[INFO] Alloy.CFG: {"dependencies":{},"TEST_STRING":"TEST ENV"}
Genymotion Samsung Galaxy S5 - 4.4.4 - API 19 - 1080x1920 (4.4.4)
[INFO] Ti.App.deployType: test
[INFO] Alloy.CFG: {"dependencies":{},"TEST_STRING":"TEST ENV"}
[INFO] Ti.App.deployType: development
[INFO] Alloy.CFG: {"dependencies":{},"TEST_STRING":"TEST ENV"}
Device Samsung S4
12-22 20:32:56.028: I/TiAPI(17077): Ti.App.deployType: development
12-22 20:32:56.028: I/TiAPI(17077): Alloy.CFG: {"dependencies":{},"TEST_STRING":"TEST ENV"}
12-22 20:34:35.465: I/TiAPI(18183): Ti.App.deployType: test
12-22 20:34:35.475: I/TiAPI(18183): Alloy.CFG: {"dependencies":{},"TEST_STRING":"TEST ENV"}
Steps to reproduce
I used these commands for testing:
ti build -p android -D development --device-id ?
ti build -p android -D test --device-id ?
ti build -p android -D development -T device
ti build -p android -D test -T device
Extra info
Seems like CFG.js doesn't get updated under resources once you switch the deployType flag. Deleting the content of Resources (aka forcing regeneration of CFG.js) will go and use the right config.
Since we use these settings to trigger our testing scripts, figured I'd give it a test. Ti.App.deployType seems to work fine here. But your settings from the config.json file do not. added the following to my alloy.js to test faster:
Results: Genymotion Google Nexus 5 - 5.0.0 - API 21 - 1080x1920 (5.0.0)
Genymotion Samsung Galaxy S5 - 4.4.4 - API 19 - 1080x1920 (4.4.4)
Device Samsung S4
My 2 cents here: Seems like CFG.js doesn't get updated under resources once you switch the deployType flag. Deleting the content of Resources (aka forcing regeneration of CFG.js) will go and use the right config.
[~pablog178] is the original reporter for this ticket.
I think this is solved by the change in ALOY-1206. [~mpmiranda] could you test and confirm with the customer that this would resolve their issue?
PR: https://github.com/appcelerator/alloy/pull/665 Functional Test: Follow the steps to reproduce stated above, and confirm that
Resources/alloy/CFG.js
has the correctTEST_STRING
value for each android build.FR & CR pass, merged to master, cherry-picked to 1_6_X
Verified fixed using: Titanium SDK 4.0.0.v20150323131014 Studio 4.0.0.201503231407 Appc NPM: 0.3.34 Appc CLI 0.2.187 Alloy 1.6.0-alpha The correct
TEST_STRING
is printed when using-D development
and-D test
.