Titanium command line

titanium的環境都安裝好之後,就可以找到~/.titanium這路徑,然後在.bashrc加上以下配置。

1
alias titanium.py=$HOME/.titanium/mobilesdk/linux/3.0.0.GA/titanium.py

接著執行:

1
source .bashrc

然後建立一個project:

1
titanium.py create --platform=android --android=/path/to/android-sdk --id=com.mycompany.myApp --name=myApp

會建立出以下檔案:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
.
|-- build
| `-- android
| |-- AndroidManifest.xml
| |-- assets
| |-- bin
| |-- default.properties
| |-- gen
| |-- lib
| |-- res
| `-- src
|-- LICENSE
|-- manifest
|-- README
|-- Resources
| |-- android
| | |-- appicon.png
| | |-- default.png
| | `-- images
| |-- app.js
| |-- KS_nav_ui.png
| `-- KS_nav_views.png
`-- tiapp.xml

啟動android的模擬器:

1
titanium.py emulator --platform=android --android=/path/to/android-sdk

如果需要使用到google api,可等待建立後,至avd調整。

最後在把project run在模擬器上:

1
titanium.py run --platform=android --android=/path/to/android-sdk

可參考官方文件