@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,99 +1,124 @@
|
|
|
1
|
-
# Hello world: project creation
|
|
1
|
+
# Hello world: setup, project creation and first run
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Prepare the toolchain
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Android builds work on macOS, Windows and Linux; iOS and Catalyst require macOS with Xcode. See [compatibility](compatibility-matrix.md) for the released SDK 13.4.1 baseline. The current CLI requires Node 22.19+ or 24; Node 24 avoids the SDK's Node 26 native-binding problem. Install Node with a version manager or an official installer, reopen the shell, and verify `node -v`. On Homebrew `node@24` is keg-only: add its `bin` directory to PATH. Windows LTS installers follow the current LTS, so check the installed version.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Install a JDK, for example Temurin 21, and set `JAVA_HOME` to its installation directory. On macOS `/usr/libexec/java_home -v 21` locates it; on Linux derive it from the resolved `javac` executable; on Windows set a user environment variable and reopen PowerShell. Verify both `javac -version` and the `javac` under `JAVA_HOME`; a shell and Gradle can otherwise use different JDKs.
|
|
8
8
|
|
|
9
|
-
```
|
|
10
|
-
|
|
9
|
+
```sh
|
|
10
|
+
npm install -g titanium
|
|
11
|
+
ti -v
|
|
12
|
+
ti sdk install 13.4.1.GA
|
|
13
|
+
ti sdk list
|
|
11
14
|
```
|
|
12
15
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
`titanium` and `ti` are the same command. `pnpm add -g titanium` is an alternative. Use a writable Node/npm installation or the appropriate permissions for its global directory. No SDK version installs the newest stable; an explicit version makes this walkthrough reproducible.
|
|
17
|
+
|
|
18
|
+
Install Android SDK Platform 36, Build Tools 35.0.0, Platform Tools and Emulator through Android Studio's SDK Manager or command-line tools. Extract command-line tools to `<sdk>/cmdline-tools/latest`, not directly into the SDK root:
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
sdkmanager "platforms;android-36" "build-tools;35.0.0" "platform-tools" "emulator"
|
|
22
|
+
ti setup android
|
|
16
23
|
```
|
|
17
24
|
|
|
18
|
-
|
|
25
|
+
The wizard records `android.sdkPath`. `ANDROID_SDK_ROOT` or `ANDROID_SDK` also work; `ANDROID_HOME` alone is not read by the app builder. Conventional SDK locations are `~/Library/Android/sdk` on macOS, `~/Android/Sdk` on Linux and `%LOCALAPPDATA%\Android\Sdk` on Windows. Keep SDK paths free of spaces/ampersands on Windows and writable by your user on Linux. Pin newer Build Tools with `ti config android.buildTools.selectedVersion 35.0.0` if an unsupported version causes failures.
|
|
19
26
|
|
|
20
|
-
|
|
27
|
+
Create an emulator through Android Studio Device Manager or `avdmanager`. Apple silicon uses an `arm64-v8a` image; Linux needs KVM and membership of its group (log out/in after changing it); Windows needs supported hardware acceleration such as Windows Hypervisor Platform. Physical Android devices need USB debugging/authorization, a vendor driver on Windows and suitable udev rules on Linux. A CPU virtualization flag alone does not prove working KVM access; check `/dev/kvm` permissions.
|
|
21
28
|
|
|
22
|
-
|
|
29
|
+
For iOS install a supported Xcode, open it once to complete setup, install command-line tools, and select the intended installation:
|
|
23
30
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
| SDK Version | Titanium SDK to use | Use latest |
|
|
30
|
-
| Deployment Targets | Platforms to support | android, ios, ipad, iphone |
|
|
31
|
+
```sh
|
|
32
|
+
xcode-select --install
|
|
33
|
+
sudo xcode-select -s /Applications/Xcode.app
|
|
34
|
+
xcode-select -p
|
|
35
|
+
```
|
|
31
36
|
|
|
32
|
-
|
|
37
|
+
Install additional runtimes through Xcode Settings → Components. SDK 13.4.1 needs iOS 15+ devices/runtimes. Development devices need an Apple Development certificate plus a matching provisioning profile: add your Apple ID in Xcode Settings → Accounts, create the certificate in Manage Certificates, connect/register the device, and let Xcode create a profile. The private key must be in the keychain, not just a downloaded certificate. Distribution needs a paid account; simulator builds do not need signing.
|
|
33
38
|
|
|
34
|
-
-
|
|
35
|
-
- No spaces or special characters
|
|
36
|
-
- All lowercase (Android issues with uppercase)
|
|
37
|
-
- No Java keywords (`case`, `package`, etc.)
|
|
38
|
-
- Cannot change after publishing
|
|
39
|
-
- On iOS, the App ID must match the Bundle Identifier. On Android, it becomes the Application Package Name.
|
|
39
|
+
Run `ti info` and fix actual errors before creating a project. `ti info -t ios` or `-t android` narrows detection. Newer-tool and unused-NDK warnings can be harmless. If `ti` is missing, reopen the terminal and check npm's global prefix is on PATH. Antivirus file locking on Windows may require excluding generated `build/`; do not disable protection for the whole machine.
|
|
40
40
|
|
|
41
|
-
##
|
|
41
|
+
## Create Classic or Alloy
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
MyApp/
|
|
45
|
-
├── app/ # Alloy app source
|
|
46
|
-
│ ├── assets/ # Images, fonts
|
|
47
|
-
│ ├── controllers/ # JS controllers
|
|
48
|
-
│ ├── models/ # Backbone models
|
|
49
|
-
│ ├── views/ # XML views
|
|
50
|
-
│ └── styles/ # TSS styles
|
|
51
|
-
├── platform/ # Platform-specific files
|
|
52
|
-
│ ├── android/
|
|
53
|
-
│ └── ios/
|
|
54
|
-
├── Resources/ # Code files and graphics with platform-specific subdirectories
|
|
55
|
-
│ ├── android/ # Android-specific assets
|
|
56
|
-
│ └── iphone/ # iOS-specific assets
|
|
57
|
-
├── i18n/ # Internationalization
|
|
58
|
-
├── tiapp.xml # App configuration
|
|
59
|
-
├── config.json # Alloy config
|
|
60
|
-
└── app.js # Bootstrap file loaded first when app launches
|
|
61
|
-
```
|
|
43
|
+
Classic uses JavaScript directly. Alloy adds XML views, TSS styles, controllers, models and reusable widgets; it compiles to the same runtime API. Choose Alloy for a growing app and Classic for a small tool or prototype.
|
|
62
44
|
|
|
63
|
-
|
|
45
|
+
```sh
|
|
46
|
+
# Classic
|
|
47
|
+
ti create --type app --name Hello --id com.example.hello --platforms android,ios --workspace-dir .
|
|
64
48
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
ti
|
|
49
|
+
# Alloy: install once, then create
|
|
50
|
+
npm install -g alloy
|
|
51
|
+
ti create --type app --alloy --name Hello --id com.example.hello --platforms android,ios --workspace-dir .
|
|
68
52
|
```
|
|
69
53
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
54
|
+
`--alloy` runs `alloy new` after creation and requires Alloy on PATH; without it the created project remains Classic. Existing Classic projects can be converted with `alloy new` after backing up source. Interactive creation prompts for values. In scripts add `--no-prompt` and explicitly provide `--type` and `--workspace-dir`.
|
|
55
|
+
|
|
56
|
+
Use a lower-case reverse-DNS app ID whose domain you control; it becomes the Android package and iOS bundle identifier. Avoid spaces, special characters and Java keywords. Changing it after publication creates a new listing. `--name` sets the project directory and display name. `--platforms ios` targets iPhone and iPad; `iphone` targets iPhone only. Pin `<sdk-version>13.4.1.GA</sdk-version>` in `tiapp.xml`; `--sdk` overrides it for one build.
|
|
57
|
+
|
|
58
|
+
## Source and generated files
|
|
59
|
+
|
|
60
|
+
| Purpose | Classic | Alloy |
|
|
61
|
+
| --- | --- | --- |
|
|
62
|
+
| Entry source | `Resources/app.js` | `app/alloy.js` for bootstrap; `app/controllers/index.js` for first controller |
|
|
63
|
+
| UI | JavaScript in `Resources/` | `app/views/`, `app/styles/`, `app/controllers/` |
|
|
64
|
+
| Libraries | `Resources/` CommonJS modules | `app/lib/` |
|
|
65
|
+
| Assets | `Resources/`, platform subdirectories | `app/assets/`, platform subdirectories |
|
|
66
|
+
| Native platform files | `platform/android/`, `platform/ios/` | `app/platform/android/`, `app/platform/ios/` |
|
|
67
|
+
| Alloy settings | Not applicable | `app/config.json` |
|
|
68
|
+
|
|
69
|
+
`tiapp.xml`, `i18n/`, `modules/`, `plugins/` and `hooks/` live at the project root. Alloy generates `Resources/`; editing that output is lost on the next compilation. `build/` is generated for both. Commit source and reproducible dependency declarations, not generated output or signing credentials. Asset paths are runtime-relative: `app/assets/images/logo.png` becomes `images/logo.png`.
|
|
70
|
+
|
|
71
|
+
## Run and change the app
|
|
72
|
+
|
|
73
|
+
```sh
|
|
74
|
+
cd Hello
|
|
75
|
+
ti build --platform android
|
|
76
|
+
ti build --platform ios
|
|
73
77
|
```
|
|
74
78
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
+
Defaults are Android emulator and iOS simulator. Multiple targets prompt for selection; get IDs from `ti info` and pass `--device-id`. `--build-only` compiles without installing/launching; `--liveview` reloads changes on save; Ctrl-C stops the command/log session. First builds are slower because subsequent builds reuse generated work.
|
|
80
|
+
|
|
81
|
+
For Classic put this in `Resources/app.js`:
|
|
82
|
+
|
|
83
|
+
```javascript
|
|
84
|
+
const win = Ti.UI.createWindow({ backgroundColor: 'white' });
|
|
85
|
+
const label = Ti.UI.createLabel({ text: 'Tap the button', top: 80 });
|
|
86
|
+
const button = Ti.UI.createButton({ title: 'Say hello', top: 140 });
|
|
87
|
+
button.addEventListener('click', () => {
|
|
88
|
+
label.text = 'Hello from Titanium';
|
|
89
|
+
});
|
|
90
|
+
win.add(label);
|
|
91
|
+
win.add(button);
|
|
92
|
+
win.open();
|
|
79
93
|
```
|
|
80
94
|
|
|
81
|
-
|
|
95
|
+
For Alloy use a named root window so the controller route is explicit:
|
|
82
96
|
|
|
83
|
-
|
|
84
|
-
|
|
97
|
+
```xml
|
|
98
|
+
<Alloy>
|
|
99
|
+
<Window id="index" backgroundColor="white">
|
|
100
|
+
<Label id="label" top="80">Tap the button</Label>
|
|
101
|
+
<Button top="140" onClick="sayHello">Say hello</Button>
|
|
102
|
+
</Window>
|
|
103
|
+
</Alloy>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
```javascript
|
|
107
|
+
function sayHello() {
|
|
108
|
+
$.label.text = 'Hello from Titanium';
|
|
109
|
+
}
|
|
110
|
+
$.index.open();
|
|
111
|
+
```
|
|
85
112
|
|
|
86
|
-
|
|
113
|
+
A view `id` becomes `$.id` in the controller and `#id` in TSS. Template semantic colors come from `Resources/semantic.colors.json` or `app/assets/semantic.colors.json`; they resolve differently in light/dark mode, unlike arbitrary color names.
|
|
87
114
|
|
|
88
|
-
##
|
|
115
|
+
## Real devices and distribution
|
|
89
116
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
117
|
+
```sh
|
|
118
|
+
ti build -p android -T device --device-id <android-id>
|
|
119
|
+
ti build -p ios -T device --device-id <ios-udid>
|
|
120
|
+
```
|
|
94
121
|
|
|
95
|
-
|
|
122
|
+
Android: enable Developer options (usually tap Build number seven times), enable USB debugging, connect and accept authorization. Debug signing is generated automatically. iOS: unlock the phone, trust the computer, and use a profile/certificate matching the app ID and device; selection prompts if several match. Free provisioning expires quickly (typically seven days), paid profiles commonly last a year; inspect the actual profile expiry. Simulators/emulators do not reproduce camera, GPS, notifications, hardware or real network conditions. Test physical hardware before release.
|
|
96
123
|
|
|
97
|
-
|
|
98
|
-
2. Use Alloy for new projects for better structure and maintainability.
|
|
99
|
-
3. Keep the App ID consistent. Match Bundle ID (iOS) and Package ID (Android).
|
|
124
|
+
Titanium analyzes/transpiles JavaScript, generates native projects, then invokes Gradle or `xcodebuild`. It still executes JavaScript through a runtime; it does not translate every JavaScript statement to native machine code. Test/production JavaScript encryption raises the cost of inspection and does not protect secrets. See [distribution](app-distribution.md), [frameworks](application-frameworks.md), and [official first app](https://titaniumsdk.com/docs/build/first-app.md).
|