After installing Titanium from appcelerator, I successfully built the "KitchenSink" example application.
Now, I'm curious about where the javascript code ends up in a built app.
I searched through the Xcode project and the resulting application located at
Library/Application Support/iPhone Simulator/....KitchenSink.app
, but couldn't find any function names or string texts from the .js
files.
The closest information I came across was an answer on How Does Appcelerator Titanium Mobile Work?, although it didn't completely clarify the process for me.
My question is: Is the javascript code compiled into binary code (and if so, what compiler is used?), or is it transformed into a special data format and interpreted during runtime?
Update:
In the build/android directory of KitchenSink, I found:
michal:bin mac$ find . -name table_view_layout\*
./assets/Resources/examples/table_view_layout.js
./assets/Resources/examples/table_view_layout_2.js
./assets/Resources/examples/table_view_layout_3.js
./assets/Resources/examples/table_view_layout_4.js
./assets/Resources/examples/table_view_layout_5.js
./classes/org/appcelerator/generated/examples/table_view_layout.class
./classes/org/appcelerator/generated/examples/table_view_layout_2.class
./classes/org/appcelerator/generated/examples/table_view_layout_3.class
./classes/org/appcelerator/generated/examples/table_view_layout_4.class
./classes/org/appcelerator/generated/examples/table_view_layout_5.class
michal:bin mac$ unzip -t app.apk | grep table_view_layout
testing: assets/Resources/examples/table_view_layout.js OK
testing: assets/Resources/examples/table_view_layout_2.js OK
...
In my exploration of app.apk, all I could find were class files corresponding to each javascript file. This led me to believe that on Android, javascript is compiled for JVM. But then why can't these be found in app.apk?