@maccesar/titools 2.10.1 → 3.2.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 (95) hide show
  1. package/AGENTS-VERCEL-RESEARCH.md +23 -12
  2. package/README.md +81 -182
  3. package/agents/ti-pro.md +8 -14
  4. package/lib/cleanup.js +13 -0
  5. package/lib/commands/skills.js +2 -1
  6. package/lib/config.js +9 -11
  7. package/lib/platform.js +1 -1
  8. package/package.json +2 -3
  9. package/skills/purgetss/SKILL.md +44 -57
  10. package/skills/purgetss/references/EXAMPLES.md +8 -1
  11. package/skills/purgetss/references/app-branding.md +96 -16
  12. package/skills/purgetss/references/apply-directive.md +26 -1
  13. package/skills/purgetss/references/arbitrary-values.md +72 -2
  14. package/skills/purgetss/references/class-categories.md +1 -1
  15. package/skills/purgetss/references/cli-commands.md +37 -13
  16. package/skills/purgetss/references/customization-deep-dive.md +18 -11
  17. package/skills/purgetss/references/dynamic-component-creation.md +0 -1
  18. package/skills/purgetss/references/migration-guide.md +162 -1
  19. package/skills/purgetss/references/multi-density-images.md +69 -0
  20. package/skills/purgetss/references/version-history.md +82 -0
  21. package/skills/ti-expert/SKILL.md +1 -1
  22. package/skills/ti-ui/SKILL.md +1 -1
  23. package/skills/alloy-guides/SKILL.md +0 -190
  24. package/skills/alloy-guides/references/CLI_TASKS.md +0 -233
  25. package/skills/alloy-guides/references/CONCEPTS.md +0 -171
  26. package/skills/alloy-guides/references/CONTROLLERS.md +0 -279
  27. package/skills/alloy-guides/references/MODELS.md +0 -1214
  28. package/skills/alloy-guides/references/PURGETSS.md +0 -46
  29. package/skills/alloy-guides/references/VIEWS_DYNAMIC.md +0 -235
  30. package/skills/alloy-guides/references/VIEWS_STYLES.md +0 -375
  31. package/skills/alloy-guides/references/VIEWS_WITHOUT_CONTROLLERS.md +0 -102
  32. package/skills/alloy-guides/references/VIEWS_XML.md +0 -581
  33. package/skills/alloy-guides/references/WIDGETS.md +0 -160
  34. package/skills/alloy-howtos/SKILL.md +0 -181
  35. package/skills/alloy-howtos/references/best_practices.md +0 -121
  36. package/skills/alloy-howtos/references/cli_reference.md +0 -230
  37. package/skills/alloy-howtos/references/config_files.md +0 -158
  38. package/skills/alloy-howtos/references/custom_tags.md +0 -148
  39. package/skills/alloy-howtos/references/debugging_troubleshooting.md +0 -78
  40. package/skills/alloy-howtos/references/samples.md +0 -156
  41. package/skills/ti-api/SKILL.md +0 -109
  42. package/skills/ti-api/references/api-android.md +0 -675
  43. package/skills/ti-api/references/api-app-platform.md +0 -636
  44. package/skills/ti-api/references/api-core.md +0 -764
  45. package/skills/ti-api/references/api-data-network.md +0 -641
  46. package/skills/ti-api/references/api-media.md +0 -655
  47. package/skills/ti-api/references/api-modules-ble-bluetooth.md +0 -657
  48. package/skills/ti-api/references/api-modules-coremotion-urlsession.md +0 -411
  49. package/skills/ti-api/references/api-modules-map.md +0 -632
  50. package/skills/ti-api/references/api-modules-nfc.md +0 -725
  51. package/skills/ti-api/references/api-modules-social-misc.md +0 -526
  52. package/skills/ti-api/references/api-services.md +0 -700
  53. package/skills/ti-api/references/api-ui-android.md +0 -499
  54. package/skills/ti-api/references/api-ui-extras.md +0 -702
  55. package/skills/ti-api/references/api-ui-ios-animator.md +0 -378
  56. package/skills/ti-api/references/api-ui-ios.md +0 -756
  57. package/skills/ti-api/references/api-ui-lists.md +0 -581
  58. package/skills/ti-api/references/api-ui-text-input.md +0 -607
  59. package/skills/ti-api/references/api-ui-views.md +0 -572
  60. package/skills/ti-api/references/api-ui-windows-navigation.md +0 -676
  61. package/skills/ti-api/references/api-xml-global.md +0 -743
  62. package/skills/ti-guides/SKILL.md +0 -75
  63. package/skills/ti-guides/references/advanced-data-and-images.md +0 -155
  64. package/skills/ti-guides/references/android-manifest.md +0 -97
  65. package/skills/ti-guides/references/app-distribution.md +0 -373
  66. package/skills/ti-guides/references/application-frameworks.md +0 -366
  67. package/skills/ti-guides/references/cli-reference.md +0 -700
  68. package/skills/ti-guides/references/coding-best-practices.md +0 -150
  69. package/skills/ti-guides/references/commonjs-advanced.md +0 -279
  70. package/skills/ti-guides/references/hello-world.md +0 -99
  71. package/skills/ti-guides/references/hyperloop-native-access.md +0 -458
  72. package/skills/ti-guides/references/javascript-primer.md +0 -402
  73. package/skills/ti-guides/references/reserved-words.md +0 -36
  74. package/skills/ti-guides/references/resources.md +0 -172
  75. package/skills/ti-guides/references/style-and-conventions.md +0 -104
  76. package/skills/ti-guides/references/tiapp-config.md +0 -655
  77. package/skills/ti-howtos/SKILL.md +0 -143
  78. package/skills/ti-howtos/references/android-platform-deep-dives.md +0 -609
  79. package/skills/ti-howtos/references/automation-fastlane-appium.md +0 -96
  80. package/skills/ti-howtos/references/buffer-codec-streams.md +0 -162
  81. package/skills/ti-howtos/references/cross-platform-development.md +0 -358
  82. package/skills/ti-howtos/references/debugging-profiling.md +0 -473
  83. package/skills/ti-howtos/references/extending-titanium.md +0 -684
  84. package/skills/ti-howtos/references/google-maps-v2.md +0 -172
  85. package/skills/ti-howtos/references/ios-map-kit.md +0 -149
  86. package/skills/ti-howtos/references/ios-platform-deep-dives.md +0 -595
  87. package/skills/ti-howtos/references/local-data-sources.md +0 -310
  88. package/skills/ti-howtos/references/location-and-maps.md +0 -267
  89. package/skills/ti-howtos/references/media-apis.md +0 -268
  90. package/skills/ti-howtos/references/notification-services.md +0 -539
  91. package/skills/ti-howtos/references/remote-data-sources.md +0 -339
  92. package/skills/ti-howtos/references/tutorials.md +0 -552
  93. package/skills/ti-howtos/references/using-modules.md +0 -182
  94. package/skills/ti-howtos/references/web-content-integration.md +0 -288
  95. package/skills/ti-howtos/references/webpack-build-pipeline.md +0 -125
@@ -1,75 +0,0 @@
1
- ---
2
- name: ti-guides
3
- description: "Titanium SDK official fundamentals and configuration guide. Use when working with, reviewing, analyzing, or examining Titanium projects, Hyperloop native access, app distribution (App Store/Google Play), tiapp.xml configuration, CLI commands, memory management, bridge optimization, CommonJS modules, SQLite transactions, or coding standards. AUTO-DETECT: If tiapp.xml exists, invoke this skill for any project configuration, build, or deployment question. Covers SDK versions, platform compatibility, and tiapp.xml settings that are unique to Titanium."
4
- argument-hint: "[topic]"
5
- allowed-tools: Read, Grep, Glob, Edit, Write, Bash(node *)
6
- ---
7
-
8
- # Titanium SDK guide expert
9
-
10
- Use this skill to keep Titanium projects aligned with TiDev standards for stability, performance, and cross-platform behavior.
11
-
12
- ## Project detection
13
-
14
- > **️ℹ️ Auto-detects Titanium projects**
15
- > This skill auto-detects Titanium projects. No manual command is needed.
16
- >
17
- > Titanium project indicator:
18
- > - `tiapp.xml` file (definitive indicator)
19
- >
20
- > Applies to both:
21
- > - Alloy projects (`app/` folder)
22
- > - Classic projects (`Resources/` folder)
23
- >
24
- > Behavior:
25
- > - If a Titanium project is detected, provide official Titanium SDK guidance, memory management best practices, and app distribution help.
26
- > - If not detected, say this skill is only for Titanium projects.
27
-
28
- ## Core workflow
29
-
30
- 1. Validate the project follows a modular pattern (CommonJS or Alloy).
31
- 2. Ensure global listeners are removed and heavy objects are nulled during cleanup.
32
- 3. Cache frequently accessed native properties to reduce bridge crossings.
33
- 4. Use Hyperloop for specialized native functionality and handle casting and threading correctly.
34
- 5. Use transactions for database work and manage image memory footprints.
35
-
36
- ## Procedural rules
37
-
38
- - Always remove `Ti.App` and `Ti.Geolocation` listeners during controller cleanup.
39
- - Do not access `Ti.Platform` or `Ti.DisplayCaps` inside loops. Store values in local variables.
40
- - Concatenate Hyperloop selectors accurately (for example, `addAttribute:value:range:` -> `addAttributeValueRange`).
41
- - Close resultsets and database handles after every transaction block.
42
-
43
- ## Reference guides
44
-
45
- - Hello World (references/hello-world.md): project creation, structure, and getting started with Alloy or Classic Titanium.
46
- - JavaScript Primer (references/javascript-primer.md): JavaScript fundamentals, learning resources, best practices, and ES6+ features.
47
- - Application Frameworks (references/application-frameworks.md): Alloy vs Classic Titanium, architectural patterns, and framework selection.
48
- - Coding Best Practices (references/coding-best-practices.md): memory leaks, bridge efficiency, event naming, security, and lazy loading.
49
- - CommonJS Advanced (references/commonjs-advanced.md): stateful modules, caching, ES6+ support, and antipatterns.
50
- - Advanced Data & Images (references/advanced-data-and-images.md): SQLite transactions and image memory optimization.
51
- - Hyperloop Native Access (references/hyperloop-native-access.md): Objective-C/Swift/Java syntax, casting, debugging, XIB/Storyboards.
52
- - Style & Conventions (references/style-and-conventions.md): naming standards and formatting rules.
53
- - Reserved Words (references/reserved-words.md): ECMAScript, iOS, and Alloy reserved keywords to avoid.
54
- - Android Manifest (references/android-manifest.md): custom AndroidManifest.xml, permissions, and manifest merge.
55
- - App Distribution (references/app-distribution.md): Google Play (APK/AAB), App Store (IPA), certificates, provisioning, and deployment.
56
- - tiapp.xml Configuration (references/tiapp-config.md): complete reference for tiapp.xml and timodule.xml, including all elements, properties, and platform-specific settings.
57
- - CLI Reference (references/cli-reference.md): Titanium CLI commands, options, tasks, configuration, and build processes.
58
- - Resources (references/resources.md): community support, modules, sample code, Slack, and learning materials.
59
-
60
- ## Related skills
61
-
62
- For tasks beyond SDK fundamentals, use these complementary skills:
63
-
64
- | Task | Use this skill |
65
- | --- | --- |
66
- | Project architecture, services, patterns | `ti-expert` |
67
- | Native features (location, push, media) | `ti-howtos` |
68
- | Alloy CLI, configuration, debugging | `alloy-howtos` |
69
- | UI layouts, ListViews, gestures | `ti-ui` |
70
-
71
- ## Response format
72
-
73
- 1. Technical recommendation: cite the specific TiDev best practice.
74
- 2. Optimized implementation: provide modern ES6+ code without semicolons.
75
- 3. Rationale: briefly explain the performance or memory impact.
@@ -1,155 +0,0 @@
1
- # Advanced database and image best practices
2
-
3
- ## 1. SQLite optimization
4
-
5
- - Close result sets and the database after each operation to avoid locks and memory growth. SQLite allows one writer at a time, and leaving a connection open after `INSERT` or `UPDATE` can trigger `DatabaseObjectNotClosed` on the next write.
6
- - Use transactions for batch inserts. If any statement fails, SQLite rolls back the entire batch.
7
- ```javascript
8
- const db = Ti.Database.open('myDatabase');
9
- db.execute('BEGIN');
10
- for (const item of playlist) {
11
- db.execute('INSERT INTO albums (disc, artist, rating) VALUES (?, ?, ?)', item.disc, item.artist, item.rating);
12
- }
13
- db.execute('COMMIT');
14
- db.close();
15
- ```
16
- - Do not ship large pre-populated databases. Ship a small skeleton and download data on first boot to reduce IPA/APK size. The `Resources` directory is read-only, so installing a database copies it to `applicationDataDirectory`, which creates two copies on the device.
17
- - Android note: in Android 2.2 and earlier, the installer could not uncompress assets over 1 MB. One workaround was to rename the file with a `.mp3` extension to prevent `aapt` compression.
18
- - Pattern for downloading a replacement database on first boot:
19
- ```javascript
20
- const updateDatabase = (newData) => {
21
- // delete existing content and rehydrate from downloaded JSON
22
- }
23
- downloadButton.addEventListener('click', () => {
24
- const client = Ti.Network.createHTTPClient({
25
- timeout: 10000,
26
- onload() {
27
- updateDatabase(this.responseData)
28
- Ti.UI.createAlertDialog({ title: 'Info', message: 'Database installed' }).show()
29
- },
30
- onerror(e) {
31
- Ti.UI.createAlertDialog({ title: 'Error', message: e.error }).show()
32
- }
33
- })
34
- client.open('GET', 'https://example.com/data.json')
35
- client.send()
36
- })
37
- ```
38
-
39
- ### Database version management
40
-
41
- Store a version number in your database so you can detect upgrades and run migrations. If you do not have a version table, use `PRAGMA TABLE_INFO` to detect column presence:
42
-
43
- ```javascript
44
- const addColumn = (dbname, tblName, newFieldName, colSpec) => {
45
- const db = Ti.Database.open(dbname);
46
- let fieldExists = false;
47
- const resultSet = db.execute(`PRAGMA TABLE_INFO(${tblName})`);
48
- while (resultSet.isValidRow()) {
49
- if (resultSet.field(1) === newFieldName) {
50
- fieldExists = true;
51
- }
52
- resultSet.next();
53
- }
54
- resultSet.close();
55
- if (!fieldExists) {
56
- db.execute(`ALTER TABLE ${tblName} ADD COLUMN ${newFieldName} ${colSpec}`);
57
- }
58
- db.close();
59
- };
60
- ```
61
-
62
- ---
63
-
64
- ## 2. Image format selection
65
-
66
- Choose the right format for each use case:
67
-
68
- | Format | Compression | Best for | Avoid for |
69
- | ------ | --------------------- | ------------------------------ | ------------------------------------------------------------------ |
70
- | PNG | Lossless | Icons, text, line art, buttons | Photos (large files) |
71
- | JPG | Lossy | Photographs | Text, icons, line drawings (artifacts) |
72
- | GIF | Lossless (256 colors) | Rare cases | Most cases (limited colors, animated GIF not supported everywhere) |
73
-
74
- For flip-book animations, use `ImageView.images` with an array of PNG or optimized JPG files instead of animated GIFs.
75
-
76
- ---
77
-
78
- ## 3. Image memory management
79
-
80
- - A JPG is small on disk but expands to `width * height * 3 bytes` in RAM. Each pixel uses 24 bits (8 bits per R/G/B channel).
81
- - Example: `(640 × 480 × 3) / 1024 = 900 KB` in memory for a single image
82
- - Device RAM available to your app can be as low as 12 MB, shared with your code and the Titanium framework
83
- - Unloading:
84
- - `view.remove(imageView)` removes it from the view hierarchy and lets the OS free memory
85
- - `imageView = null` releases the native proxy object
86
- - Resizing: resize images to their display dimensions using `imageAsResized` or `imageAsCropped` (both on `Ti.Blob`) before setting the `image` property. Do not display a 1024×768 image on a 640×480 screen.
87
- - Placeholder: set `defaultImage` on ImageView to show a local placeholder while a remote image downloads:
88
- ```javascript
89
- const imageView = Ti.UI.createImageView({
90
- image: 'https://example.com/photo.jpg',
91
- defaultImage: '/images/placeholder.png',
92
- width: 300,
93
- height: 200
94
- });
95
- ```
96
-
97
- ---
98
-
99
- ## 4. Image optimization tools
100
-
101
- Resize and compress images before including them in your app to reduce IPA/APK size and network usage.
102
-
103
- | Platform | File types | Tool |
104
- | ------------------- | ------------- | ----------- |
105
- | Mac | PNG, JPG, GIF | ImageOptim |
106
- | Mac, Windows, Linux | PNG, JPG, GIF | ImageMagick |
107
- | Windows/DOS | PNG | PNGCrush |
108
- | Windows | JPG | Nikkho |
109
-
110
- ---
111
-
112
- ## 5. Caching remote images
113
-
114
- Remote images are cached automatically on iOS, Android, and Windows.
115
-
116
- Platform differences:
117
- - Android: cache limited to 25 MB, persists for the lifetime of the app (while installed)
118
- - iOS: cache size not fixed, cleared by iOS when the device needs storage
119
-
120
- To manually clean the cache, delete files in `applicationCacheDirectory`.
121
-
122
- Android 6+ requirement: call `Ti.Filesystem.requestStoragePermissions()` before loading remote images.
123
-
124
- ### Manual caching utility
125
-
126
- For critical assets, cache manually in `applicationDataDirectory` for more predictable behavior:
127
-
128
- ```javascript
129
- const CacheUtils = {
130
- getExtension: (fn) => {
131
- const match = /(?:\.([^.]+))?$/.exec(fn);
132
- return match[1] || '';
133
- },
134
-
135
- createCachedImageView: (options) => {
136
- const md5 = Ti.Utils.md5HexDigest(options.image) + CacheUtils.getExtension(options.image);
137
- const savedFile = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, md5);
138
-
139
- if (savedFile.exists()) {
140
- options.image = savedFile;
141
- return Ti.UI.createImageView(options);
142
- }
143
-
144
- const imageView = Ti.UI.createImageView(options);
145
- const saveImage = () => {
146
- imageView.removeEventListener('load', saveImage);
147
- savedFile.write(
148
- Ti.UI.createImageView({ image: imageView.image, width: Ti.UI.FILL, height: Ti.UI.FILL }).toImage()
149
- );
150
- };
151
- imageView.addEventListener('load', saveImage);
152
- return imageView;
153
- }
154
- };
155
- ```
@@ -1,97 +0,0 @@
1
- # Custom AndroidManifest.xml
2
-
3
- For most Android manifest settings, use `tiapp.xml`. Only create a custom manifest when you really need it.
4
-
5
- ## Preferred method: tiapp.xml
6
-
7
- Add manifest entries in `tiapp.xml` inside the `<android>` section:
8
-
9
- ```xml
10
- <android xmlns:android="http://schemas.android.com/apk/res/android">
11
- <manifest>
12
- <!-- SDK version -->
13
- <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="34" />
14
-
15
- <!-- Screen support -->
16
- <supports-screens
17
- android:smallScreens="false"
18
- android:normalScreens="true"
19
- android:largeScreens="true"
20
- android:xlargeScreens="true"
21
- />
22
-
23
- <!-- Permissions -->
24
- <uses-permission android:name="android.permission.CAMERA" />
25
- <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
26
-
27
- <!-- Application attributes (merged, not replaced) -->
28
- <application android:debuggable="true" />
29
- </manifest>
30
- </android>
31
- ```
32
-
33
- ## How merging works
34
-
35
- - Most elements are replaced by your entry.
36
- - The `<application>` element is merged additively by attribute.
37
- - Activities and services are added to existing ones.
38
-
39
- ## Custom manifest (rare cases)
40
-
41
- If you need full control, create `platform/android/AndroidManifest.xml`:
42
-
43
- ```
44
- MyApp/
45
- ├── app/
46
- ├── platform/
47
- │ └── android/
48
- │ └── AndroidManifest.xml # Custom manifest
49
- └── tiapp.xml
50
- ```
51
-
52
- Warning: you must maintain this file manually through SDK updates.
53
-
54
- ## Common use cases
55
-
56
- ### Camera permission
57
- ```xml
58
- <uses-permission android:name="android.permission.CAMERA" />
59
- ```
60
-
61
- ### Hardware requirements
62
- ```xml
63
- <uses-feature android:name="android.hardware.camera" android:required="false" />
64
- ```
65
-
66
- ### Launch mode
67
- ```xml
68
- <application android:launchMode="singleTask" />
69
- ```
70
-
71
- ### Deep links
72
- ```xml
73
- <intent-filter>
74
- <action android:name="android.intent.action.VIEW" />
75
- <category android:name="android.intent.category.DEFAULT" />
76
- <category android:name="android.intent.category.BROWSABLE" />
77
- <data android:scheme="myapp" android:host="path" />
78
- </intent-filter>
79
- ```
80
-
81
- ## Debugging
82
-
83
- To see the generated manifest:
84
- ```bash
85
- ti build -p android
86
- # Check: build/android/AndroidManifest.xml.gen
87
- ```
88
-
89
- ## Enable manifest merge (CLI 7.0+)
90
-
91
- If you use a custom manifest, enable merge in `tiapp.xml`:
92
-
93
- ```bash
94
- ti config android.mergeCustomAndroidManifest true
95
- ```
96
-
97
- This merges your custom manifest with the generated one instead of replacing it.
@@ -1,373 +0,0 @@
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
- ---