@maccesar/titools 3.3.0 → 4.0.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.
Files changed (101) hide show
  1. package/README.md +27 -61
  2. package/lib/cleanup.js +29 -0
  3. package/lib/commands/agents.js +8 -7
  4. package/lib/commands/skills.js +118 -23
  5. package/lib/config.js +13 -15
  6. package/lib/installer.js +5 -3
  7. package/lib/utils.js +36 -0
  8. package/package.json +1 -1
  9. package/skills/alloy-guides/SKILL.md +188 -0
  10. package/skills/alloy-guides/references/CLI_TASKS.md +233 -0
  11. package/skills/alloy-guides/references/CONCEPTS.md +171 -0
  12. package/skills/alloy-guides/references/CONTROLLERS.md +279 -0
  13. package/skills/alloy-guides/references/MODELS.md +742 -0
  14. package/skills/alloy-guides/references/MODELS_ADVANCED.md +482 -0
  15. package/skills/alloy-guides/references/PURGETSS.md +57 -0
  16. package/skills/alloy-guides/references/VIEWS_DYNAMIC.md +235 -0
  17. package/skills/alloy-guides/references/VIEWS_STYLES.md +375 -0
  18. package/skills/alloy-guides/references/VIEWS_WITHOUT_CONTROLLERS.md +102 -0
  19. package/skills/alloy-guides/references/VIEWS_XML.md +581 -0
  20. package/skills/alloy-guides/references/WIDGETS.md +160 -0
  21. package/skills/alloy-howtos/SKILL.md +179 -0
  22. package/skills/alloy-howtos/references/best_practices.md +121 -0
  23. package/skills/alloy-howtos/references/cli_reference.md +230 -0
  24. package/skills/alloy-howtos/references/config_files.md +158 -0
  25. package/skills/alloy-howtos/references/custom_tags.md +148 -0
  26. package/skills/alloy-howtos/references/debugging_troubleshooting.md +78 -0
  27. package/skills/alloy-howtos/references/samples.md +156 -0
  28. package/skills/purgetss/SKILL.md +6 -3
  29. package/skills/purgetss/references/EXAMPLES.md +8 -6
  30. package/skills/purgetss/references/app-branding.md +5 -0
  31. package/skills/purgetss/references/apply-directive.md +1 -1
  32. package/skills/purgetss/references/class-categories.md +1 -1
  33. package/skills/purgetss/references/class-index-properties.md +618 -0
  34. package/skills/purgetss/references/class-index.md +4 -610
  35. package/skills/purgetss/references/cli-commands.md +15 -0
  36. package/skills/purgetss/references/custom-fonts.md +39 -36
  37. package/skills/purgetss/references/custom-rules.md +1 -1
  38. package/skills/purgetss/references/customization-deep-dive.md +64 -1
  39. package/skills/purgetss/references/icon-fonts.md +2 -0
  40. package/skills/purgetss/references/migration-guide.md +53 -1
  41. package/skills/purgetss/references/multi-density-images.md +53 -2
  42. package/skills/purgetss/references/svg-pipeline.md +249 -0
  43. package/skills/purgetss/references/tikit-components.md +2 -2
  44. package/skills/purgetss/references/titanium-resets.md +2 -2
  45. package/skills/purgetss/references/ui-ux-design.md +7 -5
  46. package/skills/purgetss/references/version-history.md +12 -0
  47. package/skills/ti-api/SKILL.md +128 -0
  48. package/skills/ti-api/references/api-android.md +675 -0
  49. package/skills/ti-api/references/api-app-platform.md +636 -0
  50. package/skills/ti-api/references/api-core.md +764 -0
  51. package/skills/ti-api/references/api-data-network.md +641 -0
  52. package/skills/ti-api/references/api-media.md +655 -0
  53. package/skills/ti-api/references/api-modules-ble-bluetooth.md +657 -0
  54. package/skills/ti-api/references/api-modules-coremotion-urlsession.md +411 -0
  55. package/skills/ti-api/references/api-modules-map.md +632 -0
  56. package/skills/ti-api/references/api-modules-nfc.md +725 -0
  57. package/skills/ti-api/references/api-modules-social-misc.md +526 -0
  58. package/skills/ti-api/references/api-services.md +700 -0
  59. package/skills/ti-api/references/api-ui-android.md +499 -0
  60. package/skills/ti-api/references/api-ui-extras.md +702 -0
  61. package/skills/ti-api/references/api-ui-ios-animator.md +378 -0
  62. package/skills/ti-api/references/api-ui-ios.md +756 -0
  63. package/skills/ti-api/references/api-ui-lists.md +581 -0
  64. package/skills/ti-api/references/api-ui-text-input.md +607 -0
  65. package/skills/ti-api/references/api-ui-views.md +572 -0
  66. package/skills/ti-api/references/api-ui-windows-navigation.md +676 -0
  67. package/skills/ti-api/references/api-xml-global.md +743 -0
  68. package/skills/ti-guides/SKILL.md +82 -0
  69. package/skills/ti-guides/references/advanced-data-and-images.md +155 -0
  70. package/skills/ti-guides/references/android-manifest.md +97 -0
  71. package/skills/ti-guides/references/app-distribution.md +373 -0
  72. package/skills/ti-guides/references/application-frameworks.md +366 -0
  73. package/skills/ti-guides/references/cli-reference.md +700 -0
  74. package/skills/ti-guides/references/coding-best-practices.md +150 -0
  75. package/skills/ti-guides/references/commonjs-advanced.md +279 -0
  76. package/skills/ti-guides/references/hello-world.md +99 -0
  77. package/skills/ti-guides/references/hyperloop-native-access.md +458 -0
  78. package/skills/ti-guides/references/javascript-primer.md +402 -0
  79. package/skills/ti-guides/references/reserved-words.md +36 -0
  80. package/skills/ti-guides/references/resources.md +172 -0
  81. package/skills/ti-guides/references/style-and-conventions.md +104 -0
  82. package/skills/ti-guides/references/tiapp-config.md +655 -0
  83. package/skills/ti-howtos/SKILL.md +131 -0
  84. package/skills/ti-howtos/references/android-platform-deep-dives.md +609 -0
  85. package/skills/ti-howtos/references/automation-fastlane-appium.md +96 -0
  86. package/skills/ti-howtos/references/buffer-codec-streams.md +162 -0
  87. package/skills/ti-howtos/references/cross-platform-development.md +358 -0
  88. package/skills/ti-howtos/references/debugging-profiling.md +473 -0
  89. package/skills/ti-howtos/references/extending-titanium.md +684 -0
  90. package/skills/ti-howtos/references/google-maps-v2.md +172 -0
  91. package/skills/ti-howtos/references/ios-map-kit.md +149 -0
  92. package/skills/ti-howtos/references/ios-platform-deep-dives.md +595 -0
  93. package/skills/ti-howtos/references/local-data-sources.md +310 -0
  94. package/skills/ti-howtos/references/location-and-maps.md +267 -0
  95. package/skills/ti-howtos/references/media-apis.md +268 -0
  96. package/skills/ti-howtos/references/notification-services.md +539 -0
  97. package/skills/ti-howtos/references/remote-data-sources.md +339 -0
  98. package/skills/ti-howtos/references/tutorials.md +552 -0
  99. package/skills/ti-howtos/references/using-modules.md +182 -0
  100. package/skills/ti-howtos/references/web-content-integration.md +288 -0
  101. package/skills/ti-howtos/references/webpack-build-pipeline.md +125 -0
@@ -0,0 +1,373 @@
1
+ # App distribution guide
2
+
3
+ Guide for distributing Titanium apps to Google Play (Android) and the App Store (iOS).
4
+
5
+ ## Android distribution
6
+
7
+ ### 1. Generate keystore and certificate
8
+
9
+ Create a keystore for signing your app:
10
+
11
+ ```bash
12
+ keytool -genkeypair -v -keystore android.keystore -alias helloworld -keyalg RSA -sigalg SHA1withRSA -validity 10000
13
+ ```
14
+
15
+ Requirements:
16
+ - `keyalg`: RSA (required by Google Play)
17
+ - `sigalg`: SHA1withRSA (Android 4.3-) or SHA256withRSA (Android 4.4+)
18
+ - `validity`: 10000 days minimum (~25 years)
19
+
20
+ Save your keystore password securely. If it is lost, you cannot release updates.
21
+
22
+ ### 2. Verify keystore
23
+
24
+ ```bash
25
+ keytool -list -v -keystore android.keystore
26
+ ```
27
+
28
+ ### 3. Build for Google Play
29
+
30
+ CLI command:
31
+ ```bash
32
+ ti build -p android -T dist-playstore [-K <KEYSTORE_FILE> -P <KEYSTORE_PASSWORD> -L <KEYSTORE_ALIAS> -O <OUTPUT_DIRECTORY>]
33
+ ```
34
+
35
+ Example:
36
+ ```bash
37
+ ti build -p android -T dist-playstore -K ~/android.keystore -P secret -L foo -O ./dist/
38
+ ```
39
+
40
+ Output files:
41
+ - `.apk`: legacy format (still supported)
42
+ - `.aab`: Android App Bundle (preferred, smaller downloads). Requires Titanium 9.0.0+. An AAB file cannot be installed directly on a device. After upload, Google Play generates device-specific APKs split by CPU architecture and image density.
43
+
44
+ ### 4. Verify APK signing
45
+
46
+ ```bash
47
+ jarsigner -verify -verbose path/yourapp.apk
48
+ ```
49
+
50
+ ### 5. Deploy to device for testing
51
+
52
+ Using CLI:
53
+ ```bash
54
+ ti build -p android -T device --device-id "<DEVICE_ID>"
55
+ ```
56
+
57
+ Using adb:
58
+ ```bash
59
+ adb install -r your_project/build/android/bin/app.apk
60
+ adb uninstall com.your.appid
61
+ ```
62
+
63
+ Remote testing:
64
+ - Host the APK on a web server or Dropbox and email a link
65
+ - Use HockeyKit/HockeyApp for beta distribution
66
+
67
+ ### 6. Google Play submission requirements
68
+
69
+ Required assets:
70
+ - At least 2 screenshots (320x480, 480x800, or 480x854)
71
+ - High-res icon (512x512)
72
+ - Title, description (4000 chars max)
73
+ - Promo text (80 chars max)
74
+ - Category and content rating
75
+ - Contact information
76
+
77
+ Versioning in `tiapp.xml`:
78
+ ```xml
79
+ <android xmlns:android="http://schemas.android.com/apk/res/android">
80
+ <manifest android:versionCode="2" android:versionName="1.0.1"/>
81
+ </android>
82
+ ```
83
+
84
+ - `versionCode`: must be a 32-bit integer and increment for each update. No floating point values.
85
+ - `versionName`: string in any format you choose
86
+
87
+ ### 7. SD card installation
88
+
89
+ ```xml
90
+ <android xmlns:android="http://schemas.android.com/apk/res/android">
91
+ <manifest android:installLocation="preferExternal"/>
92
+ </android>
93
+ ```
94
+
95
+ Values: `preferExternal`, `auto`, `internalOnly`
96
+
97
+ ---
98
+
99
+ ## iOS distribution
100
+
101
+ ### 1. Distribution types
102
+
103
+ - App Store: public distribution via App Store (formerly iTunes Connect, now App Store Connect)
104
+ - Ad Hoc: limited testing (max 100 devices per year; devices cannot be removed once registered, so use care when registering)
105
+ - In House: enterprise distribution for employees (Enterprise program only)
106
+
107
+ ### 2. Create distribution certificate
108
+
109
+ Certificate types:
110
+ - Development certificate: each developer can have their own, used for test builds.
111
+ - Distribution certificate: a single certificate for the entire team. Only the Team Agent (account owner) can create it.
112
+
113
+ Steps:
114
+ 1. Log in to Apple Developer Member Center as Team Agent or Admin.
115
+ 2. Go to Certificates, Identifiers & Profiles, then Certificates.
116
+ 3. Click +, then choose App Store and Ad Hoc.
117
+ 4. Create a CSR (Certificate Signing Request) in Keychain Access.
118
+ 5. Upload the CSR and generate the certificate.
119
+ 6. Download and install the `.cer` file.
120
+ 7. Export the private key as a `.p12` file (File > Export Items).
121
+
122
+ ### 3. Create distribution provisioning profile
123
+
124
+ 1. In Member Center, go to Provisioning Profiles.
125
+ 2. Click + and select the distribution type.
126
+ 3. Select an App ID.
127
+ 4. Select the distribution certificate.
128
+ 5. For Ad Hoc, select test devices.
129
+ 6. Name the profile (include "distribution" or "ad hoc").
130
+ 7. Download the `.mobileprovision` file and install it (drag to Xcode).
131
+
132
+ ### 4. Create App ID on App Store Connect
133
+
134
+ App Store Connect is the portal for app distribution management.
135
+
136
+ 1. Log in to App Store Connect.
137
+ 2. Go to Manage Your Apps, then Add New App.
138
+ 3. Provide:
139
+ - App name
140
+ - SKU number (unique ID)
141
+ - Bundle ID (must match App ID from Developer Portal)
142
+ 4. Configure:
143
+ - Availability date
144
+ - Price tier
145
+ - Version number
146
+ - Description (4000 chars max)
147
+ - Category, keywords (100 chars max)
148
+ - Copyright
149
+ - Support URL
150
+ - Rating info
151
+ - High-res icon: 1024x1024, 72 DPI, RGB, flat artwork
152
+ - Screenshots:
153
+ - iPhone (3.5"): 960x640, 960x600, 640x960, or 640x920
154
+ - iPhone (4"): 1136x640, 1136x600, 640x1136, or 640x1096
155
+ - iPad: 1024x768, 1024x748, 768x1024, 768x1004, 2048x1536, 2048x1496, 1536x2048, or 1536x2008
156
+ 5. Click Ready to Upload Binary.
157
+
158
+ ### 5. Build and package
159
+
160
+ CLI command - Ad Hoc:
161
+ ```bash
162
+ ti build -p ios -T dist-adhoc [-R <DISTRIBUTION_CERTIFICATE_NAME> -P <PROVISIONING_PROFILE_UUID> -O <OUTPUT_DIRECTORY>]
163
+ ```
164
+
165
+ Example:
166
+ ```bash
167
+ ti build -p ios -T dist-adhoc -R "Pseudo, Inc." -P "FFFFFFFF-EEEE-DDDD-CCCC-BBBBBBBBBBBB" -O ./dist/
168
+ ```
169
+
170
+ CLI command - App Store:
171
+ ```bash
172
+ ti build -p ios -T dist-appstore [-R <DISTRIBUTION_CERTIFICATE_NAME> -P <PROVISIONING_PROFILE_UUID>]
173
+ ```
174
+
175
+ Example:
176
+ ```bash
177
+ ti build -p ios -T dist-appstore -R "Pseudo, Inc." -P "AAAAAAAA-0000-9999-8888-777777777777"
178
+ ```
179
+
180
+ The CLI installs the package to Xcode's Organizer.
181
+
182
+ ### 6. Upload to App Store Connect
183
+
184
+ 1. Open Xcode, then Window, then Organizer.
185
+ 2. Select your app archive.
186
+ 3. Click Verify to validate against the App Store Connect app definition.
187
+ 4. Click Submit to upload.
188
+ 5. Status changes to Waiting for Review.
189
+
190
+ ### 7. Ad Hoc distribution
191
+
192
+ Testers need:
193
+ - The `.mobileprovision` file installed on their device
194
+ - The `.ipa` package file
195
+
196
+ Installation method:
197
+ 1. Connect the device to a Mac.
198
+ 2. Open Xcode, then Window, then Devices.
199
+ 3. Select the device, then Installed Apps, then +.
200
+ 4. Select the IPA file.
201
+
202
+ ---
203
+
204
+ ## Mac Catalyst distribution (Mac App Store)
205
+
206
+ Mac Catalyst allows you to run your iPad app on macOS. Titanium SDK 13.1.1.GA and later supports building for Mac Catalyst.
207
+
208
+ ### 1. Enable Mac Catalyst for your App ID
209
+
210
+ 1. Go to [Apple Developer → Identifiers](https://developer.apple.com/account/resources/identifiers/list)
211
+ 2. Select your App ID or create a new one
212
+ 3. Enable **Mac Catalyst** capability
213
+ 4. Save the changes
214
+
215
+ ### 2. Create Mac App Store Distribution Certificate
216
+
217
+ 1. Go to [Apple Developer → Certificates](https://developer.apple.com/account/resources/certificates/list)
218
+ 2. Click **+** to create a new certificate
219
+ 3. Select **Mac App Store Distribution**
220
+ 4. Upload your CSR (Certificate Signing Request)
221
+ 5. Download and install the certificate
222
+
223
+ ### 3. Mac Catalyst build targets
224
+
225
+ Titanium provides two targets for Mac Catalyst:
226
+
227
+ | Target | Description | Configuration |
228
+ |--------|-------------|---------------|
229
+ | `macos` | Development builds for testing on Mac | Debug-maccatalyst |
230
+ | `dist-macappstore` | Production builds for Mac App Store | Release-maccatalyst |
231
+
232
+ ### 4. Build for Mac Catalyst (Development)
233
+
234
+ ```bash
235
+ ti build -p ios -T macos
236
+ ```
237
+
238
+ The `.app` bundle will be created at:
239
+ ```
240
+ build/iphone/build/Products/Debug-maccatalyst/AppName.app
241
+ ```
242
+
243
+ For a production-ready build:
244
+ ```bash
245
+ ti build -p ios -T macos --deploy-type production
246
+ ```
247
+
248
+ The `.app` bundle will be at:
249
+ ```
250
+ build/iphone/build/Products/Release-maccatalyst/AppName.app
251
+ ```
252
+
253
+ ### 5. Build for Mac App Store (Distribution)
254
+
255
+ ```bash
256
+ ti build -p ios -T dist-macappstore [-R <CERTIFICATE_NAME>]
257
+ ```
258
+
259
+ Example:
260
+ ```bash
261
+ ti build -p ios -T dist-macappstore -R "Apple Distribution: Your Team Name (TEAM_ID)"
262
+ ```
263
+
264
+ If you omit the `-R` flag, Titanium will prompt you to select a certificate.
265
+
266
+ **What happens during the build:**
267
+ - Uses `Release-maccatalyst` configuration
268
+ - Sets code signing to Manual with identity `-`
269
+ - Creates a `.xcarchive` for Mac App Store
270
+ - Installs the archive in Xcode's Organizer
271
+ - Destination: `generic/platform=macOS`
272
+
273
+ ### 6. Upload to Mac App Store Connect
274
+
275
+ 1. Open Xcode → Window → Organizer
276
+ 2. Select your Mac Catalyst archive
277
+ 3. Click **Validate App** to check for issues
278
+ 4. Click **Distribute App**
279
+ 5. Select **Mac App Store**
280
+ 6. Follow the prompts to upload
281
+
282
+ ### 7. Create app listing in App Store Connect
283
+
284
+ 1. Go to [App Store Connect](https://appstoreconnect.apple.com)
285
+ 2. **My Apps → + → New App**
286
+ 3. Select **Mac** as platform
287
+ 4. Enter app details:
288
+ - Name
289
+ - Primary Language
290
+ - Bundle ID (must match your App ID with Mac Catalyst enabled)
291
+ - SKU
292
+ 5. Complete required metadata:
293
+ - Description
294
+ - Keywords
295
+ - Screenshots (Mac-specific sizes)
296
+ - Category
297
+ - Age rating
298
+
299
+ ### 8. Mac Catalyst entitlements
300
+
301
+ Add Mac-specific entitlements in `tiapp.xml`:
302
+
303
+ ```xml
304
+ <ios>
305
+ <entitlements>
306
+ <dict>
307
+ <!-- File access for saving to Downloads -->
308
+ <key>com.apple.security.files.user-selected.read-write</key>
309
+ <true/>
310
+ <key>com.apple.security.files.downloads.read-write</key>
311
+ <true/>
312
+
313
+ <!-- App sandbox (required for Mac App Store) -->
314
+ <key>com.apple.security.app-sandbox</key>
315
+ <true/>
316
+
317
+ <!-- Network access -->
318
+ <key>com.apple.security.network.client</key>
319
+ <true/>
320
+
321
+ <!-- Additional entitlements as needed -->
322
+ <key>com.apple.security.print</key>
323
+ <true/>
324
+ </dict>
325
+ </entitlements>
326
+ </ios>
327
+ ```
328
+
329
+ ### 9. Common issues
330
+
331
+ **Issue**: "No suitable signing certificate found"
332
+ - Ensure you have a **Mac App Store Distribution Certificate** (not iOS Distribution)
333
+ - The certificate must be installed in your Keychain
334
+
335
+ **Issue**: Build fails with code signing errors
336
+ - Verify your App ID has Mac Catalyst enabled
337
+ - Check that the certificate matches the App ID
338
+ - Try cleaning the build: `ti clean -p ios`
339
+
340
+ **Issue**: App crashes on launch
341
+ - Verify entitlements are correctly configured
342
+ - Check Console.app for crash logs
343
+ - Ensure all required capabilities are enabled
344
+
345
+ ### 10. Versioning
346
+
347
+ Update version numbers in `tiapp.xml`:
348
+
349
+ ```xml
350
+ <ti:app xmlns:ti="http://ti.tidev.io">
351
+ <id>com.yourcompany.yourapp</id>
352
+ <name>Your App Name</name>
353
+ <version>1.0.0</version>
354
+ <publisher>Your Company</publisher>
355
+ ...
356
+ </ti:app>
357
+ ```
358
+
359
+ - `version`: Display version (e.g., "1.0.0")
360
+ - For iOS, use `pv-version-code` in `<ios>` section for build number
361
+ - For Mac, the build number can be set in Xcode or via `CFBundleVersion`
362
+
363
+ ### 11. Testing on Mac
364
+
365
+ Before submitting to Mac App Store:
366
+
367
+ 1. Build with `macos` target for testing
368
+ 2. Run the app on different Mac architectures (Intel and Apple Silicon)
369
+ 3. Test all features that use file system, network, and other sandboxed resources
370
+ 4. Verify entitlements are working correctly
371
+ 5. Test on macOS versions you plan to support
372
+
373
+ ---