@maccesar/titools 5.2.5 → 5.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +1 -1
- package/README.md +58 -97
- package/agents/ti-pro.md +4 -2
- package/commands/ti-audit.md +7 -5
- package/docs/examples.md +24 -13
- package/docs/knowledge-index.md +2 -1
- package/lib/config.js +1 -0
- package/package.json +1 -1
- package/skills/alloy-guides/SKILL.md +18 -179
- package/skills/alloy-guides/references/CLI_TASKS.md +17 -216
- package/skills/alloy-guides/references/CONCEPTS.md +27 -162
- package/skills/alloy-guides/references/CONTROLLERS.md +38 -236
- package/skills/alloy-guides/references/MODELS.md +47 -723
- package/skills/alloy-guides/references/MODELS_ADVANCED.md +21 -482
- package/skills/alloy-guides/references/VIEWS_DYNAMIC.md +12 -222
- package/skills/alloy-guides/references/VIEWS_STYLES.md +39 -358
- package/skills/alloy-guides/references/VIEWS_XML.md +36 -552
- package/skills/alloy-guides/references/WIDGETS.md +49 -127
- package/skills/alloy-howtos/SKILL.md +14 -169
- package/skills/alloy-howtos/references/best_practices.md +9 -113
- package/skills/alloy-howtos/references/cli_reference.md +18 -223
- package/skills/alloy-howtos/references/config_files.md +50 -133
- package/skills/alloy-howtos/references/debugging_troubleshooting.md +19 -63
- package/skills/alloy-howtos/references/samples.md +21 -138
- package/skills/ti-api/SKILL.md +10 -2
- package/skills/ti-api/references/api-android.md +36 -2
- package/skills/ti-api/references/api-app-platform.md +39 -3
- package/skills/ti-api/references/api-core.md +50 -18
- package/skills/ti-api/references/api-data-network.md +49 -35
- package/skills/ti-api/references/api-media.md +45 -27
- package/skills/ti-api/references/api-services.md +39 -9
- package/skills/ti-api/references/api-ui-android.md +33 -13
- package/skills/ti-api/references/api-ui-extras.md +41 -15
- package/skills/ti-api/references/api-ui-ios-animator.md +42 -26
- package/skills/ti-api/references/api-ui-ios.md +74 -2
- package/skills/ti-api/references/api-ui-lists.md +32 -16
- package/skills/ti-api/references/api-ui-text-input.md +34 -17
- package/skills/ti-api/references/api-ui-views.md +27 -1
- package/skills/ti-api/references/api-ui-windows-navigation.md +32 -18
- package/skills/ti-api/references/api-xml-global.md +66 -16
- package/skills/ti-create-release/SKILL.md +98 -0
- package/skills/ti-create-release/references/module-discovery.md +69 -0
- package/skills/ti-expert/references/adaptive-layouts.md +1 -1
- package/skills/ti-guides/SKILL.md +37 -76
- package/skills/ti-guides/references/advanced-data-and-images.md +122 -126
- package/skills/ti-guides/references/android-manifest.md +24 -83
- package/skills/ti-guides/references/app-distribution.md +31 -377
- package/skills/ti-guides/references/application-frameworks.md +127 -335
- package/skills/ti-guides/references/cli-reference.md +184 -633
- package/skills/ti-guides/references/commonjs-advanced.md +81 -231
- package/skills/ti-guides/references/compatibility-matrix.md +36 -75
- package/skills/ti-guides/references/hello-world.md +95 -70
- package/skills/ti-guides/references/hyperloop-native-access.md +52 -448
- package/skills/ti-guides/references/resources.md +174 -142
- package/skills/ti-guides/references/sdk-release-notes.md +28 -71
- package/skills/ti-guides/references/tiapp-config.md +222 -598
- package/skills/ti-howtos/SKILL.md +23 -123
- package/skills/ti-howtos/references/cross-platform-development.md +119 -324
- package/skills/ti-howtos/references/debugging-profiling.md +77 -445
- package/skills/ti-howtos/references/extending-titanium.md +199 -673
- package/skills/ti-howtos/references/local-data-sources.md +87 -300
- package/skills/ti-howtos/references/location-and-maps.md +86 -213
- package/skills/ti-howtos/references/media-apis.md +103 -223
- package/skills/ti-howtos/references/notification-services.md +86 -506
- package/skills/ti-howtos/references/remote-data-sources.md +97 -316
- package/skills/ti-howtos/references/using-modules.md +77 -133
- package/skills/ti-synthengine/SKILL.md +62 -111
- package/skills/ti-synthengine/assets/example/README.md +50 -59
- package/skills/ti-synthengine/assets/example/app.js +67 -65
- package/skills/ti-synthengine/assets/example/lib/sequenceOwner.js +39 -40
- package/skills/ti-synthengine/assets/example/lib/soundPreset.js +34 -0
- package/skills/ti-synthengine/assets/index.d.ts +122 -2
- package/skills/ti-synthengine/references/advanced-examples.md +4 -4
- package/skills/ti-synthengine/references/api.md +40 -18
- package/skills/ti-synthengine/references/audio-engine.md +15 -57
- package/skills/ti-synthengine/references/examples.md +63 -6
- package/skills/ti-synthengine/references/guide.md +61 -57
- package/skills/ti-synthengine/references/instruments-and-effects.md +15 -15
- package/skills/ti-synthengine/references/native-variation.md +53 -14
- package/skills/ti-synthengine/references/recipes-interaction.md +25 -20
- package/skills/ti-synthengine/references/recipes.md +19 -16
- package/skills/ti-synthengine/references/recommendations.md +12 -12
- package/skills/ti-synthengine/references/sound-api.md +197 -0
- package/skills/ti-synthengine/references/sound-design.md +7 -7
- package/skills/ti-synthengine/references/source-notes.md +62 -172
- package/skills/ti-synthengine/references/troubleshooting.md +17 -19
- package/skills/ti-synthengine/references/upgrade-2.0.0.md +40 -0
- package/skills/ti-ui/SKILL.md +28 -143
- package/skills/ti-ui/references/icons-and-splash-screens.md +74 -403
- package/skills/ti-ui/references/layouts-and-positioning.md +175 -402
- package/skills/ti-ui/references/listviews-and-performance.md +100 -703
- package/skills/ti-ui/references/platform-conventions.md +180 -0
- package/skills/ti-ui/references/user-interface.md +43 -0
- package/skills/alloy-guides/references/VIEWS_WITHOUT_CONTROLLERS.md +0 -102
- package/skills/alloy-howtos/references/custom_tags.md +0 -148
- package/skills/ti-guides/references/coding-best-practices.md +0 -149
- package/skills/ti-guides/references/javascript-primer.md +0 -414
- package/skills/ti-guides/references/reserved-words.md +0 -36
- package/skills/ti-guides/references/style-and-conventions.md +0 -103
- package/skills/ti-howtos/references/android-platform-deep-dives.md +0 -624
- package/skills/ti-howtos/references/automation-fastlane-appium.md +0 -96
- package/skills/ti-howtos/references/buffer-codec-streams.md +0 -162
- package/skills/ti-howtos/references/google-maps-v2.md +0 -172
- package/skills/ti-howtos/references/ios-map-kit.md +0 -149
- package/skills/ti-howtos/references/ios-platform-deep-dives.md +0 -611
- package/skills/ti-howtos/references/tutorials.md +0 -565
- package/skills/ti-howtos/references/web-content-integration.md +0 -287
- package/skills/ti-howtos/references/webpack-build-pipeline.md +0 -124
- package/skills/ti-synthengine/references/android-sim80-correction-evidence.zip +0 -0
- package/skills/ti-synthengine/references/android-sim80-correction.json +0 -162
- package/skills/ti-synthengine/references/audio-pipeline-validation.md +0 -19
- package/skills/ti-synthengine/references/bypass-physical-recheck-evidence.zip +0 -0
- package/skills/ti-synthengine/references/frontier-android-evidence.zip +0 -0
- package/skills/ti-synthengine/references/frontier-ipad-evidence.zip +0 -0
- package/skills/ti-synthengine/references/frontier-physical-validation.json +0 -1918
- package/skills/ti-synthengine/references/native-tone-repetition-validation.md +0 -59
- package/skills/ti-synthengine/references/native-variation-proposal.md +0 -182
- package/skills/ti-synthengine/references/native-variation-validation.md +0 -63
- package/skills/ti-synthengine/references/performance-review-evidence.zip +0 -0
- package/skills/ti-synthengine/references/performance-review.json +0 -1146
- package/skills/ti-synthengine/references/physical-validation.json +0 -1457
- package/skills/ti-synthengine/references/source-snapshot.json +0 -542
- package/skills/ti-synthengine/references/stats-performance.json +0 -2992
- package/skills/ti-synthengine/references/stats-performance.md +0 -82
- package/skills/ti-synthengine/references/studio-validation.json +0 -6202
- package/skills/ti-synthengine/references/unified-bypass-performance.json +0 -22425
- package/skills/ti-synthengine/references/unified-validation.json +0 -314
- package/skills/ti-ui/references/accessibility-deep-dive.md +0 -288
- package/skills/ti-ui/references/animation-and-matrices.md +0 -569
- package/skills/ti-ui/references/application-structures.md +0 -626
- package/skills/ti-ui/references/custom-fonts-styling.md +0 -549
- package/skills/ti-ui/references/event-handling.md +0 -401
- package/skills/ti-ui/references/gestures.md +0 -448
- package/skills/ti-ui/references/orientation.md +0 -374
- package/skills/ti-ui/references/platform-ui-android.md +0 -727
- package/skills/ti-ui/references/platform-ui-ios.md +0 -576
- package/skills/ti-ui/references/scrolling-views.md +0 -288
- package/skills/ti-ui/references/tableviews.md +0 -542
|
@@ -1,230 +1,25 @@
|
|
|
1
|
-
# Alloy
|
|
1
|
+
# Alloy CLI workflow in the current guides
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Install Alloy separately with `npm install -g alloy`. The Titanium CLI and platform toolchain must already work; run `ti info` before creating or building the app.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
| Task | Command |
|
|
6
|
+
| --- | --- |
|
|
7
|
+
| Create an app and convert it to Alloy | `ti create --type app --alloy --name Hello --id com.example.hello --platforms android,ios --workspace-dir .` |
|
|
8
|
+
| Convert an existing Classic app | `alloy new` from its project root |
|
|
9
|
+
| Generate a reusable widget | `alloy generate widget com.example.rating` |
|
|
10
|
+
| Build and run on Android | `ti build --platform android` |
|
|
11
|
+
| Build and run on iOS | `ti build --platform ios` |
|
|
12
|
+
| Compile without installing/launching | Add `--build-only` |
|
|
13
|
+
| Reload JavaScript on save | Add `--liveview` |
|
|
14
|
+
| Select real hardware | Add `--target device` |
|
|
15
|
+
| Select one device | Add `--device-id <id>` |
|
|
6
16
|
|
|
7
|
-
|
|
17
|
+
Without Alloy on `PATH`, `ti create --alloy` leaves a Classic project and reports what to install. `ti create` without arguments prompts; noninteractive use needs the creation values shown above, including `--type` and `--workspace-dir`.
|
|
8
18
|
|
|
9
|
-
|
|
19
|
+
Use `ios` for iPhone and iPad; `iphone` selects iPhone only. A new app ID after publication creates a separate store listing. Default build targets are Android emulator and iOS simulator, with prompts when more than one device is available. iOS builds require macOS and Xcode.
|
|
10
20
|
|
|
11
|
-
|
|
21
|
+
The current guides do not provide a complete Alloy command/options catalog. Use the installed released CLI's `alloy --help` / `alloy <command> --help` when an unlisted operation is required, and verify its behavior rather than importing an archived recipe.
|
|
12
22
|
|
|
13
|
-
|
|
14
|
-
sudo npm install -g alloy
|
|
15
|
-
```
|
|
23
|
+
See [creating and running an app](../../alloy-guides/references/CLI_TASKS.md) for prerequisites and device signing, and [debugging](./debugging_troubleshooting.md) for LiveView limitations.
|
|
16
24
|
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
sudo npm install -g alloy@1.10.0
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
### Development install
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
git clone https://github.com/tidev/alloy.git
|
|
26
|
-
cd alloy
|
|
27
|
-
[sudo] npm install -g .
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## Commands
|
|
31
|
-
|
|
32
|
-
### new
|
|
33
|
-
|
|
34
|
-
Creates a new Alloy project on top of an existing Titanium project (create the classic Titanium project first, then run this command from inside the project directory).
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
alloy new [<project_path>] [<project_template>] [--force] [--no-colors]
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
| Option | Description |
|
|
41
|
-
| -------------------- | --------------------------------------------------------------------------------- |
|
|
42
|
-
| `<project_path>` | Path to skeleton Titanium project (default: current directory) |
|
|
43
|
-
| `<project_template>` | **default** (single pane) or **two_tabbed** (tabbed app) |
|
|
44
|
-
| `--testapp <path>` | Relative path to a test application in the Alloy GitHub repo (under `test/apps/`) |
|
|
45
|
-
| `-f, --force` | Force execution |
|
|
46
|
-
| `-n, --no-colors` | Disable color output |
|
|
47
|
-
|
|
48
|
-
### generate
|
|
49
|
-
|
|
50
|
-
Creates skeleton Alloy components.
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
alloy generate <component> [--widgetname <widget_name>] [--outputPath <output_path>] [--platform <platform>] [--force] [--no-colors]
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
| Component | Description |
|
|
57
|
-
| --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
58
|
-
| `controller <name>` | Create controller, view and style |
|
|
59
|
-
| `jmk` | Create `alloy.jmk` |
|
|
60
|
-
| `model <name> <adapter> [schema]` | Create model (see Model Format below) |
|
|
61
|
-
| `migration <model_name>` | Create migration file |
|
|
62
|
-
| `style <name>` or `--all` | Create style file (or all styles). If name matches a view-controller, it populates using IDs/classes from markup. Running again updates existing files with new attributes. |
|
|
63
|
-
| `view <name>` | Create view and style |
|
|
64
|
-
| `widget <name>` | Create widget |
|
|
65
|
-
|
|
66
|
-
| Option | Description |
|
|
67
|
-
| ------------------------- | ------------------------------------------------ |
|
|
68
|
-
| `--widgetname <name>` | Create component for specified widget |
|
|
69
|
-
| `-o, --outputPath <path>` | Output path (point to 'app' directory) |
|
|
70
|
-
| `--platform <platform>` | Create platform-specific component (android/ios) |
|
|
71
|
-
| `-f, --force` | Force execution |
|
|
72
|
-
| `-n, --no-colors` | Disable color output |
|
|
73
|
-
|
|
74
|
-
#### Model format
|
|
75
|
-
|
|
76
|
-
Select adapter type:
|
|
77
|
-
- `sql` - SQLite database for Android/iOS (also generates a migration file)
|
|
78
|
-
- `properties` - Local storage in Titanium SDK context
|
|
79
|
-
|
|
80
|
-
Schema format: space-delimited list of `field:type`
|
|
81
|
-
- Example: `name:string age:number sex:varchar dob:date`
|
|
82
|
-
|
|
83
|
-
SQLite type mapping:
|
|
84
|
-
|
|
85
|
-
| Datatype | SQLite Type |
|
|
86
|
-
| ---------------------------------------- | ----------- |
|
|
87
|
-
| string, varchar, text | TEXT |
|
|
88
|
-
| int, tinyint, smallint, bigint, integer | INTEGER |
|
|
89
|
-
| double, float, real | REAL |
|
|
90
|
-
| blob | BLOB |
|
|
91
|
-
| decimal, number, date, datetime, boolean | NUMERIC |
|
|
92
|
-
| null | NULL |
|
|
93
|
-
| unknown | TEXT |
|
|
94
|
-
|
|
95
|
-
### install
|
|
96
|
-
|
|
97
|
-
Installs special Alloy project components.
|
|
98
|
-
|
|
99
|
-
```bash
|
|
100
|
-
alloy install <module> [<project_path>]
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
| Module | Description |
|
|
104
|
-
| ---------------- | ----------------------------------------- |
|
|
105
|
-
| `plugin` | Install compiler plugin for Studio |
|
|
106
|
-
| `<project_path>` | Project path (default: current directory) |
|
|
107
|
-
|
|
108
|
-
### compile
|
|
109
|
-
|
|
110
|
-
Compiles Alloy code to Titanium SDK code.
|
|
111
|
-
|
|
112
|
-
```bash
|
|
113
|
-
alloy compile [<project_path>] [--config <compiler_options>] [--no-colors]
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
| Option | Description |
|
|
117
|
-
| ------------------------ | ------------------------------------------------------------------------- |
|
|
118
|
-
| `<project_path>` | Project path (default: current directory) |
|
|
119
|
-
| `-c, --config <options>` | Comma-delimited compiler options (e.g., `beautify=false,deploytype=test`) |
|
|
120
|
-
| `-n, --no-colors` | Disable color output |
|
|
121
|
-
|
|
122
|
-
Compiler options reference the `event.alloyConfig` object in [Build Configuration File (alloy.jmk)](config_files.md).
|
|
123
|
-
|
|
124
|
-
### run
|
|
125
|
-
|
|
126
|
-
Use `titanium build` command to run Alloy projects. See [Titanium Command-Line Interface Reference](https://titaniumsdk.com/docs/reference/cli).
|
|
127
|
-
|
|
128
|
-
> **💡 Common ti build pitfalls**
|
|
129
|
-
>
|
|
130
|
-
> Using `-C` flag without UDID:
|
|
131
|
-
> ```bash
|
|
132
|
-
> # Prompts for simulator selection interactively
|
|
133
|
-
> ti build -p ios -T simulator -C
|
|
134
|
-
> ```
|
|
135
|
-
>
|
|
136
|
-
> Correct approach for simulator:
|
|
137
|
-
> ```bash
|
|
138
|
-
> # Runs on default simulator
|
|
139
|
-
> ti build -p ios -T simulator
|
|
140
|
-
> ```
|
|
141
|
-
>
|
|
142
|
-
> Using `--no-prompt` incorrectly:
|
|
143
|
-
> ```bash
|
|
144
|
-
> # Still may prompt for device selection if not specific
|
|
145
|
-
> ti build -p ios --no-prompt
|
|
146
|
-
> ```
|
|
147
|
-
>
|
|
148
|
-
> Always specify target:
|
|
149
|
-
> ```bash
|
|
150
|
-
> # Clear target specification
|
|
151
|
-
> ti build -p ios -T simulator --no-prompt
|
|
152
|
-
> ```
|
|
153
|
-
>
|
|
154
|
-
> **Common patterns:**
|
|
155
|
-
> ```bash
|
|
156
|
-
> # iOS Simulator (most common during development)
|
|
157
|
-
> ti build -p ios -T simulator
|
|
158
|
-
>
|
|
159
|
-
> # iOS Device (requires UDID)
|
|
160
|
-
> ti build -p ios -T device -V <udid>
|
|
161
|
-
>
|
|
162
|
-
> # Android Emulator
|
|
163
|
-
> ti build -p android -T emulator
|
|
164
|
-
>
|
|
165
|
-
> # Build only (don't run)
|
|
166
|
-
> ti build -p ios -T simulator --build-only
|
|
167
|
-
> ```
|
|
168
|
-
|
|
169
|
-
### i18n-extract
|
|
170
|
-
|
|
171
|
-
Extracts i18n keys from TSS and JS files to strings.xml.
|
|
172
|
-
|
|
173
|
-
```bash
|
|
174
|
-
alloy extract-i18n [<language>] [--apply]
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
| Option | Description |
|
|
178
|
-
| ------------ | ------------------------------------------ |
|
|
179
|
-
| `<language>` | Two-letter language code (default: **en**) |
|
|
180
|
-
| `--apply` | Write to strings.xml (preview if absent) |
|
|
181
|
-
|
|
182
|
-
Supported functions:
|
|
183
|
-
- `Ti.Locale.getString()`
|
|
184
|
-
- `L()`
|
|
185
|
-
|
|
186
|
-
Usage examples:
|
|
187
|
-
```bash
|
|
188
|
-
# Preview changes for default (English)
|
|
189
|
-
alloy extract-i18n
|
|
190
|
-
|
|
191
|
-
# Write changes to "app/i18n/en/strings.xml"
|
|
192
|
-
alloy extract-i18n --apply
|
|
193
|
-
|
|
194
|
-
# Specify "es" as the language and write the changes to "app/i18n/es/strings.xml"
|
|
195
|
-
alloy extract-i18n es --apply
|
|
196
|
-
|
|
197
|
-
# Preview Spanish changes
|
|
198
|
-
alloy extract-i18n es
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
### copy
|
|
202
|
-
|
|
203
|
-
Copy a view-controller (controller, XML, TSS).
|
|
204
|
-
|
|
205
|
-
```bash
|
|
206
|
-
alloy copy <CONTROLLER_NAME> <COPIED_CONTROLLER_NAME>
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
### move
|
|
210
|
-
|
|
211
|
-
Rename a view-controller.
|
|
212
|
-
|
|
213
|
-
```bash
|
|
214
|
-
alloy move <CONTROLLER_NAME> <NEW_CONTROLLER_NAME>
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
### remove
|
|
218
|
-
|
|
219
|
-
Remove a view-controller.
|
|
220
|
-
|
|
221
|
-
```bash
|
|
222
|
-
alloy remove <CONTROLLER_NAME>
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
## Additional Options
|
|
226
|
-
|
|
227
|
-
| Option | Description |
|
|
228
|
-
| --------------- | --------------------- |
|
|
229
|
-
| `-h, --help` | Output command usage |
|
|
230
|
-
| `-v, --version` | Output version number |
|
|
25
|
+
Sources: [first app](https://titaniumsdk.com/docs/build/first-app.md), [Alloy](https://titaniumsdk.com/docs/alloy.md), [widgets](https://titaniumsdk.com/docs/alloy/widgets.md).
|
|
@@ -1,158 +1,75 @@
|
|
|
1
|
-
# Alloy configuration
|
|
1
|
+
# Alloy configuration
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`app/config.json` holds runtime settings and compiler configuration. A generated project uses these sections:
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
task('post:compile', (event, logger) => {
|
|
17
|
-
logger.info('compile finished!');
|
|
18
|
-
});
|
|
5
|
+
```json
|
|
6
|
+
{
|
|
7
|
+
"global": {},
|
|
8
|
+
"env:development": {},
|
|
9
|
+
"env:test": {},
|
|
10
|
+
"env:production": {},
|
|
11
|
+
"os:android": {},
|
|
12
|
+
"os:ios": {},
|
|
13
|
+
"dependencies": {},
|
|
14
|
+
"backbone": "1.4.0"
|
|
15
|
+
}
|
|
19
16
|
```
|
|
20
17
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
| Task | When Called |
|
|
24
|
-
| ---------------- | --------------------------------------------------------- |
|
|
25
|
-
| `pre:load` | After project clean, before copying assets to `Resources` |
|
|
26
|
-
| `pre:compile` | Before compiler starts |
|
|
27
|
-
| `post:compile` | After compiler finishes, before exit |
|
|
28
|
-
| `compile:app.js` | After compiling `app.js`, before writing to disk |
|
|
29
|
-
|
|
30
|
-
### Event object
|
|
31
|
-
|
|
32
|
-
| Property | Type | Description |
|
|
33
|
-
| -------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
34
|
-
| `adapters` | Array | List of adapters |
|
|
35
|
-
| `alloyConfig` | Object | Compiler config: `platform` (android/ios), `file` (selective compile), `deploytype` (development/test/production), `beautify` (Boolean) |
|
|
36
|
-
| `autoStyle` | Boolean | Autostyle enabled for project |
|
|
37
|
-
| `dependencies` | Object | Value of `dependencies` key in config.json |
|
|
38
|
-
| `dir` | Object | Directory paths: `home` (app path), `project` (root path), `resources`, `resourcesAlloy`, `assets`, `config`, `controllers`, `migrations`, `models`, `styles`, `themes`, `views`, `widgets`, `builtins`, `template` |
|
|
39
|
-
| `sourcemap` | Boolean | If `true`, generates mapping files to link generated Titanium files in `Resources` back to the source files in `app` for debugging. |
|
|
40
|
-
| `theme` | String | Theme name being used |
|
|
41
|
-
| `code` | String | *(compile:app.js only)* Contents of `app.js` |
|
|
42
|
-
| `appJSFile` | String | *(compile:app.js only)* Absolute path to `app.js` |
|
|
43
|
-
|
|
44
|
-
### Logger object
|
|
45
|
-
|
|
46
|
-
The `logger` object controls compilation log output.
|
|
47
|
-
|
|
48
|
-
#### Properties
|
|
49
|
-
|
|
50
|
-
| Property | Type | Description |
|
|
51
|
-
| --------------- | ------- | ----------------------------------------------- |
|
|
52
|
-
| `DEBUG` | Number | READONLY. Output all log messages. |
|
|
53
|
-
| `INFO` | Number | READONLY. Output all except debug messages. |
|
|
54
|
-
| `WARN` | Number | READONLY. Output only warning and error. |
|
|
55
|
-
| `ERROR` | Number | READONLY. Output only error messages. |
|
|
56
|
-
| `NONE` | Number | READONLY. Disable log messages. |
|
|
57
|
-
| `logLevel` | Number | Sets which log messages to output. |
|
|
58
|
-
| `showTimestamp` | Boolean | If `true`, outputs timestamp with log messages. |
|
|
59
|
-
| `stripColors` | Boolean | If `true`, suppresses color output. |
|
|
18
|
+
## Runtime values and overrides
|
|
60
19
|
|
|
61
|
-
|
|
20
|
+
```json
|
|
21
|
+
{
|
|
22
|
+
"global": { "apiRoot": "https://example.com/api", "pageSize": 20 },
|
|
23
|
+
"env:production": { "apiRoot": "https://api.example.com" },
|
|
24
|
+
"os:android": { "pageSize": 10 }
|
|
25
|
+
}
|
|
26
|
+
```
|
|
62
27
|
|
|
63
|
-
|
|
64
|
-
| -------------------- | ------------------------------ |
|
|
65
|
-
| `debug(msg: String)` | Outputs a debug log message. |
|
|
66
|
-
| `info(msg: String)` | Outputs an info log message. |
|
|
67
|
-
| `warn(msg: String)` | Outputs a warning log message. |
|
|
68
|
-
| `error(msg: String)` | Outputs an error log message. |
|
|
28
|
+
Read the resulting values with `Alloy.CFG.apiRoot`. The selected `env:` is the build deploy type, not its target. Simulator builds normally use `development`; `--deploy-type production` selects production.
|
|
69
29
|
|
|
70
|
-
|
|
30
|
+
For conflicting keys, released Alloy 3.0.1 merges `global`, then the matching `env:`, then `os:`: the OS value wins. The current published configuration page reverses the last two in its prose. Do not rely on that wording; verify the installed compiler when a collision matters.
|
|
71
31
|
|
|
72
|
-
|
|
32
|
+
The merged configuration ships in the app and can be extracted. API roots belong here; secrets belong on a server. Compiler settings can also appear in the generated configuration: do not treat it as a secret store or assume compiler-only keys are stripped.
|
|
73
33
|
|
|
74
|
-
|
|
34
|
+
## Compile-time constants
|
|
75
35
|
|
|
76
|
-
|
|
36
|
+
| Constant | True when |
|
|
37
|
+
| --- | --- |
|
|
38
|
+
| `OS_IOS`, `OS_ANDROID` | Building that platform |
|
|
39
|
+
| `ENV_DEV`, `ENV_DEVELOPMENT` | Development deploy type |
|
|
40
|
+
| `ENV_TEST` | Test deploy type |
|
|
41
|
+
| `ENV_PROD`, `ENV_PRODUCTION` | Production deploy type |
|
|
42
|
+
| `DIST_ADHOC` | Target `dist-adhoc` |
|
|
43
|
+
| `DIST_STORE` | Target `dist-appstore` or `dist-playstore` |
|
|
77
44
|
|
|
78
|
-
|
|
79
|
-
- Creating `Alloy.Collections` (e.g., `Alloy.Collections.myModel = Alloy.createCollection('myModel');`)
|
|
80
|
-
- Setting up `Alloy.Globals` (shared references, utility functions)
|
|
81
|
-
- Initializing singletons (analytics, logging, network managers)
|
|
82
|
-
- Configuring global event listeners
|
|
45
|
+
These are compiler-provided, not entries in `config.json`. Write the platform condition explicitly so the compiler can remove the other branch:
|
|
83
46
|
|
|
84
|
-
**Example:**
|
|
85
47
|
```javascript
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
// Global utility
|
|
91
|
-
Alloy.Globals.alert = (title, message) => {
|
|
92
|
-
Ti.UI.createAlertDialog({ title, message }).show();
|
|
93
|
-
};
|
|
48
|
+
if (OS_IOS) {
|
|
49
|
+
// iOS-specific implementation.
|
|
50
|
+
}
|
|
94
51
|
```
|
|
95
52
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
## Project configuration file (config.json)
|
|
53
|
+
Guard or remove logging before distribution; release logging can expose interpolated private data. Do not infer a target named `dist-store` from the constant.
|
|
99
54
|
|
|
100
|
-
|
|
55
|
+
## Themes, widgets and Backbone
|
|
101
56
|
|
|
102
|
-
|
|
103
|
-
### Objects
|
|
57
|
+
Set a build-time theme using `{ "global": { "theme": "dark" } }` and provide its directory under `app/themes/dark`. See [styles and themes](../../alloy-guides/references/VIEWS_STYLES.md#themes).
|
|
104
58
|
|
|
105
|
-
|
|
106
|
-
| ----------------- | ----------------------------------------------------------- |
|
|
107
|
-
| `global` | Key-value pairs for all environments and platforms |
|
|
108
|
-
| `env:development` | Development builds (simulator/emulator) |
|
|
109
|
-
| `env:test` | Test builds on device |
|
|
110
|
-
| `env:production` | Production builds (after package installation) |
|
|
111
|
-
| `os:android` | Android-specific values |
|
|
112
|
-
| `os:ios` | iOS-specific values |
|
|
113
|
-
| `dependencies` | Widget dependencies (name: version) |
|
|
114
|
-
| `autoStyle` | Enable autostyle for entire project |
|
|
115
|
-
| `backbone` | Backbone.js version: `0.9.2` (default), `1.1.2`, or `1.3.3` |
|
|
59
|
+
`dependencies` lists widget IDs and versions. Provide those widget directories under `app/widgets`; an undeclared widget is not compiled. See [widgets](../../alloy-guides/references/WIDGETS.md).
|
|
116
60
|
|
|
117
|
-
|
|
61
|
+
`backbone` pins the bundled Backbone version. The released Alloy 3.0.1 template already selects `1.4.0`; do not infer that the project needs unreleased Alloy 3.1.0 from the current model guide's attribution. Check the actual config and `alloy --version`.
|
|
118
62
|
|
|
119
|
-
|
|
63
|
+
## Build hooks
|
|
120
64
|
|
|
121
|
-
|
|
65
|
+
`app/alloy.jmk` runs around compilation and can copy inputs or adjust generated output:
|
|
122
66
|
|
|
123
|
-
```
|
|
124
|
-
{
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
"env:test": { "foo": 3 },
|
|
128
|
-
"env:production": { "foo": 4 },
|
|
129
|
-
"os:ios env:production": { "foo": 5 },
|
|
130
|
-
"os:ios env:development": { "foo": 6 },
|
|
131
|
-
"os:ios env:test": { "foo": 7 },
|
|
132
|
-
"os:android": { "foo": 8 },
|
|
133
|
-
"dependencies": {
|
|
134
|
-
"com.foo.widget": "1.0"
|
|
135
|
-
}
|
|
136
|
-
}
|
|
67
|
+
```javascript
|
|
68
|
+
task('post:compile', (event, logger) => {
|
|
69
|
+
logger.info(`compiled ${event.dir.project}`);
|
|
70
|
+
});
|
|
137
71
|
```
|
|
138
72
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
---
|
|
142
|
-
|
|
143
|
-
## Widget configuration file (widget.json)
|
|
144
|
-
|
|
145
|
-
**Location:** Root directory of the widget. Follows the npm `package.json` format with a few exceptions.
|
|
146
|
-
### Keys
|
|
147
|
-
|
|
148
|
-
| Key | Type | Required | Description |
|
|
149
|
-
| ---------------------- | ------ | -------- | ------------------------------------- |
|
|
150
|
-
| `id` | String | Yes | Must match widget root folder name |
|
|
151
|
-
| `copyright` | String | No | Copyright information |
|
|
152
|
-
| `license` | String | No | License information |
|
|
153
|
-
| `min-alloy-version` | Float | No* | Minimum Alloy version required |
|
|
154
|
-
| `min-titanium-version` | Float | No* | Minimum Titanium version required |
|
|
155
|
-
| `tags` | String | No | Comma-delimited keywords |
|
|
156
|
-
| `platforms` | String | No* | Supported platforms (comma-delimited) |
|
|
73
|
+
Keep hooks small: they execute on each build. The current guide names `pre:load`, `post:load`, `pre:compile` and `post:compile`; released Alloy 3.0.1 implements `pre:load`, `pre:compile` and `post:compile`, but not `post:load`. Do not write a `post:load` recipe without checking support in the version actually installed.
|
|
157
74
|
|
|
158
|
-
(
|
|
75
|
+
Sources: [configuration](https://titaniumsdk.com/docs/alloy/config.md), [models](https://titaniumsdk.com/docs/alloy/models.md). The precedence, Backbone and hook caveats are verified against released Alloy 3.0.1.
|
|
@@ -1,78 +1,34 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Debugging an Alloy application
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
First separate a compiler/native build failure from a failure in the running app.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Build failures
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
-
|
|
7
|
+
1. Run `ti info` and fix toolchain errors first.
|
|
8
|
+
2. If generated files are stale, run `ti clean` and rebuild.
|
|
9
|
+
3. Read upward to the first Gradle/Xcode error; later messages can be consequences.
|
|
10
|
+
4. For linker failures, inspect native-module compatibility with the SDK through `ti-guides`.
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
`Resources/` and `build/` are generated in an Alloy app. Do not repair generated output by editing it.
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
## Runtime diagnosis
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Use `Ti.API.trace`, `debug`, `info`, `warn`, `error` and `log`. `info` is the default build log level; add `--log-level warn` to reduce output or `--log-level trace` for build diagnostics. Logs ship with release builds and can expose tokens, email addresses or other interpolated private data; guard or remove them before distribution.
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
alloy compile --config platform=<platform>
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
### Android: images, HTML, and assets not displaying
|
|
24
|
-
|
|
25
|
-
**Problem:** Assets display on iOS and Mobile Web but not Android.
|
|
26
|
-
|
|
27
|
-
**Solution:** Android requires absolute paths. Precede asset paths with a slash ('/'). iOS and Mobile Web accept both relative and absolute paths.
|
|
18
|
+
The VS Code Titanium extension provides the `titanium` debug type for breakpoints. The JetBrains integration uses Chrome DevTools Protocol and also needs `ios-webkit-debug-proxy` for iOS. Without an editor integration, use logs rather than assuming breakpoints are available.
|
|
28
19
|
|
|
29
|
-
|
|
20
|
+
For native crashes, inspect Android `adb logcat`, or macOS Console with the iOS device selected and filtered by app name. Xcode also retains device crash reports.
|
|
30
21
|
|
|
31
|
-
|
|
22
|
+
## LiveView
|
|
32
23
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
2. Top-level UI component has an assigned ID. The controller cannot use `$.<controller_name>` to reference it; use the assigned ID instead.
|
|
36
|
-
|
|
37
|
-
### Android runtime error: Alloy is not defined
|
|
38
|
-
|
|
39
|
-
**Error:** `Uncaught ReferenceError: Alloy is not defined`
|
|
40
|
-
|
|
41
|
-
**Cause:** Non-controller JavaScript files are not automatically wrapped by Alloy. See [best_practices.md](best_practices.md) for the safe require pattern for non-controller files.
|
|
42
|
-
|
|
43
|
-
**Solution:** Require the 'alloy' module:
|
|
44
|
-
```javascript
|
|
45
|
-
const Alloy = require('alloy');
|
|
24
|
+
```bash
|
|
25
|
+
ti build --platform android --liveview
|
|
46
26
|
```
|
|
47
27
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
**Error:** `invalid method (xxx) passed to UIModule (unknown file)`
|
|
51
|
-
|
|
52
|
-
**Cause:** Trying to create an Android-only Titanium object.
|
|
53
|
-
|
|
54
|
-
**Solution:** Use the `platform` attribute in the view to enforce platform-specific objects.
|
|
55
|
-
|
|
56
|
-
### iOS application error: undefined is not an object
|
|
57
|
-
|
|
58
|
-
**Error:** `undefined is not an object (evaluating $.xxx.open) (unknown file)`
|
|
59
|
-
|
|
60
|
-
**Cause:** Top-level UI component has an assigned ID in XML markup.
|
|
61
|
-
|
|
62
|
-
**Solution:** The controller cannot use `$.<controller_name>` to reference it; use the assigned ID instead.
|
|
63
|
-
|
|
64
|
-
## Getting help
|
|
65
|
-
|
|
66
|
-
Use the [TiDev Community Slack](https://slack.tidev.io/) or [GitHub Discussions](https://github.com/tidev/titanium-sdk/discussions):
|
|
67
|
-
- Include 'alloy' as a tag
|
|
68
|
-
- Include the Alloy version (run `alloy --version`)
|
|
69
|
-
- Include platform information
|
|
28
|
+
LiveView re-runs JavaScript against the installed app. Changes to `tiapp.xml`, modules, native dependencies or `app/platform/` require a real build. Check this when a saved change appears ineffective.
|
|
70
29
|
|
|
71
|
-
##
|
|
30
|
+
## Profiling
|
|
72
31
|
|
|
73
|
-
|
|
74
|
-
- Select 'Alloy' as the component
|
|
75
|
-
- Include Alloy version (`alloy --version`)
|
|
76
|
-
- Include environment information
|
|
32
|
+
Use Android Studio Profiler on a debug build or Xcode Instruments on iOS. Allocations and Leaks help investigate memory growth. Native frames may show JavaScript work as bridge time rather than a precise source line. For list performance, inspect row/template work and use the current lists guidance through `ti-ui`.
|
|
77
33
|
|
|
78
|
-
|
|
34
|
+
Source: [debugging and profiling](https://titaniumsdk.com/docs/build/debugging.md).
|