@maccesar/titools 2.2.4 → 2.2.8

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 (96) hide show
  1. package/README.md +23 -23
  2. package/lib/commands/update.js +4 -12
  3. package/package.json +1 -1
  4. package/skills/alloy-guides/SKILL.md +31 -31
  5. package/skills/alloy-guides/references/CONCEPTS.md +3 -3
  6. package/skills/alloy-guides/references/CONTROLLERS.md +1 -1
  7. package/skills/alloy-guides/references/MODELS.md +6 -6
  8. package/skills/alloy-guides/references/VIEWS_WITHOUT_CONTROLLERS.md +1 -1
  9. package/skills/alloy-guides/references/VIEWS_XML.md +1 -1
  10. package/skills/alloy-guides/references/WIDGETS.md +1 -1
  11. package/skills/alloy-howtos/SKILL.md +27 -27
  12. package/skills/alloy-howtos/references/best_practices.md +9 -9
  13. package/skills/alloy-howtos/references/cli_reference.md +14 -14
  14. package/skills/alloy-howtos/references/config_files.md +16 -16
  15. package/skills/alloy-howtos/references/custom_tags.md +16 -16
  16. package/skills/alloy-howtos/references/debugging_troubleshooting.md +11 -15
  17. package/skills/alloy-howtos/references/samples.md +19 -19
  18. package/skills/purgetss/SKILL.md +11 -1
  19. package/skills/purgetss/references/animation-system.md +1 -1
  20. package/skills/purgetss/references/cli-commands.md +3 -3
  21. package/skills/purgetss/references/customization-deep-dive.md +1 -1
  22. package/skills/purgetss/references/dynamic-component-creation.md +1 -1
  23. package/skills/purgetss/references/icon-fonts.md +4 -0
  24. package/skills/purgetss/references/installation-setup.md +8 -1
  25. package/skills/purgetss/references/migration-guide.md +4 -0
  26. package/skills/purgetss/references/tikit-components.md +193 -204
  27. package/skills/purgetss/references/ui-ux-design.md +1 -1
  28. package/skills/ti-expert/SKILL.md +78 -118
  29. package/skills/ti-expert/references/alloy-builtins.md +18 -18
  30. package/skills/ti-expert/references/alloy-structure.md +21 -21
  31. package/skills/ti-expert/references/anti-patterns.md +15 -15
  32. package/skills/ti-expert/references/cli-expert.md +15 -15
  33. package/skills/ti-expert/references/code-conventions.md +38 -38
  34. package/skills/ti-expert/references/contracts.md +8 -8
  35. package/skills/ti-expert/references/controller-patterns.md +14 -14
  36. package/skills/ti-expert/references/error-handling.md +11 -11
  37. package/skills/ti-expert/references/examples.md +12 -12
  38. package/skills/ti-expert/references/migration-patterns.md +24 -24
  39. package/skills/ti-expert/references/patterns.md +10 -10
  40. package/skills/ti-expert/references/performance-listview.md +16 -16
  41. package/skills/ti-expert/references/performance-optimization.md +41 -41
  42. package/skills/ti-expert/references/security-device.md +22 -22
  43. package/skills/ti-expert/references/security-fundamentals.md +19 -19
  44. package/skills/ti-expert/references/state-management.md +33 -33
  45. package/skills/ti-expert/references/testing-e2e-ci.md +25 -25
  46. package/skills/ti-expert/references/testing-unit.md +24 -24
  47. package/skills/ti-expert/references/theming.md +15 -15
  48. package/skills/ti-guides/SKILL.md +58 -60
  49. package/skills/ti-guides/references/advanced-data-and-images.md +33 -33
  50. package/skills/ti-guides/references/android-manifest.md +15 -15
  51. package/skills/ti-guides/references/app-distribution.md +70 -166
  52. package/skills/ti-guides/references/application-frameworks.md +96 -114
  53. package/skills/ti-guides/references/cli-reference.md +294 -294
  54. package/skills/ti-guides/references/coding-best-practices.md +42 -33
  55. package/skills/ti-guides/references/commonjs-advanced.md +57 -51
  56. package/skills/ti-guides/references/hello-world.md +36 -36
  57. package/skills/ti-guides/references/hyperloop-native-access.md +66 -66
  58. package/skills/ti-guides/references/javascript-primer.md +83 -101
  59. package/skills/ti-guides/references/reserved-words.md +9 -9
  60. package/skills/ti-guides/references/resources.md +75 -83
  61. package/skills/ti-guides/references/style-and-conventions.md +35 -28
  62. package/skills/ti-guides/references/tiapp-config.md +110 -74
  63. package/skills/ti-howtos/SKILL.md +88 -92
  64. package/skills/ti-howtos/references/android-platform-deep-dives.md +104 -104
  65. package/skills/ti-howtos/references/automation-fastlane-appium.md +39 -39
  66. package/skills/ti-howtos/references/buffer-codec-streams.md +60 -60
  67. package/skills/ti-howtos/references/cross-platform-development.md +115 -136
  68. package/skills/ti-howtos/references/debugging-profiling.md +167 -181
  69. package/skills/ti-howtos/references/extending-titanium.md +121 -121
  70. package/skills/ti-howtos/references/google-maps-v2.md +84 -82
  71. package/skills/ti-howtos/references/ios-map-kit.md +65 -60
  72. package/skills/ti-howtos/references/ios-platform-deep-dives.md +123 -123
  73. package/skills/ti-howtos/references/local-data-sources.md +79 -78
  74. package/skills/ti-howtos/references/location-and-maps.md +116 -120
  75. package/skills/ti-howtos/references/media-apis.md +87 -86
  76. package/skills/ti-howtos/references/notification-services.md +250 -260
  77. package/skills/ti-howtos/references/remote-data-sources.md +98 -93
  78. package/skills/ti-howtos/references/tutorials.md +226 -216
  79. package/skills/ti-howtos/references/using-modules.md +73 -102
  80. package/skills/ti-howtos/references/web-content-integration.md +101 -103
  81. package/skills/ti-howtos/references/webpack-build-pipeline.md +52 -44
  82. package/skills/ti-ui/SKILL.md +85 -85
  83. package/skills/ti-ui/references/accessibility-deep-dive.md +57 -57
  84. package/skills/ti-ui/references/animation-and-matrices.md +79 -79
  85. package/skills/ti-ui/references/application-structures.md +96 -99
  86. package/skills/ti-ui/references/custom-fonts-styling.md +99 -99
  87. package/skills/ti-ui/references/event-handling.md +58 -58
  88. package/skills/ti-ui/references/gestures.md +62 -64
  89. package/skills/ti-ui/references/icons-and-splash-screens.md +88 -88
  90. package/skills/ti-ui/references/layouts-and-positioning.md +87 -97
  91. package/skills/ti-ui/references/listviews-and-performance.md +107 -107
  92. package/skills/ti-ui/references/orientation.md +87 -88
  93. package/skills/ti-ui/references/platform-ui-android.md +87 -81
  94. package/skills/ti-ui/references/platform-ui-ios.md +63 -61
  95. package/skills/ti-ui/references/scrolling-views.md +29 -29
  96. package/skills/ti-ui/references/tableviews.md +56 -56
@@ -1,214 +1,210 @@
1
- # Debugging and Profiling
1
+ # Debugging and profiling
2
2
 
3
- Comprehensive guide for debugging Titanium apps, managing memory, finding leaks, and using native debugging tools.
3
+ Guide to debugging Titanium apps, managing memory, finding leaks, and using native tools.
4
4
 
5
- ## Debugging Overview
5
+ ## Debugging overview
6
6
 
7
- ### Essential Elements of Debugging
7
+ ### Essential elements of debugging
8
8
 
9
- 1. **Gather Information** - Clear, accurate description of the problem
10
- 2. **Reproduce** - Consistent steps to recreate the issue
11
- 3. **Deduce** - Logical reasoning to isolate the cause
12
- 4. **Experiment** - Try fixes iteratively, track what works
13
- 5. **Be Tenacious** - Methodical persistence wins
14
- 6. **Track Work** - Document bugs and solutions
9
+ 1. Gather information: clear, accurate description of the problem
10
+ 2. Reproduce: consistent steps to recreate the issue
11
+ 3. Deduce: logical reasoning to isolate the cause
12
+ 4. Experiment: try fixes iteratively, track what works
13
+ 5. Be tenacious: methodical persistence wins
14
+ 6. Track work: document bugs and solutions
15
15
 
16
- ### Debugging Techniques
16
+ ### Debugging techniques
17
17
 
18
- **1. Print Tracing (Logging)**
18
+ 1. Print tracing (logging)
19
19
  ```javascript
20
20
  Ti.API.info(`Variable value: ${myVar}`);
21
21
  Ti.API.warn('Warning message');
22
22
  Ti.API.error('Error occurred');
23
23
  Ti.API.log('info', 'Custom level message');
24
- Ti.API.debug('Debug info'); // Only in dev mode
24
+ Ti.API.debug('Debug info'); // Only in dev mode
25
25
  ```
26
26
 
27
- **2. Crash Log Evaluation**
27
+ 2. Crash log evaluation
28
28
  - Build logs (compilation errors)
29
29
  - Runtime logs (app crashes)
30
30
  - Simulator/Emulator logs
31
31
  - Device logs
32
32
 
33
- **3. Interactive Debugging**
33
+ 3. Interactive debugging
34
34
  - Breakpoints in Studio/IDE
35
35
  - Variable inspection
36
36
  - Step-through execution
37
37
 
38
- ---
38
+ ## Memory management
39
39
 
40
- ## Memory Management
40
+ ### How JavaScript manages memory
41
41
 
42
- ### How JavaScript Manages Memory
43
-
44
- **Garbage Collection:** JavaScript uses automatic "mark and sweep" garbage collection.
42
+ Garbage collection: JavaScript uses automatic mark-and-sweep.
45
43
 
46
44
  1. Interpreter scans memory periodically
47
45
  2. Marks objects with active references
48
46
  3. Destroys unmarked objects
49
47
  4. Frees their memory
50
48
 
51
- **Implication:** Objects with no references are automatically cleaned up.
49
+ Implication: objects with no references are cleaned up automatically.
52
50
 
53
- ### How Titanium Manages Memory
51
+ ### How Titanium manages memory
54
52
 
55
- Titanium is a **bridge** between JavaScript and native OS:
53
+ Titanium bridges JavaScript and native OS objects:
56
54
 
57
55
  ```javascript
58
56
  // JavaScript object + Native proxy
59
- const button = Ti.UI.createButton({title: 'Click me'});
57
+ const button = Ti.UI.createButton({ title: 'Click me' });
60
58
  ```
61
59
 
62
- **Key Rule:** Setting JavaScript object to `null` destroys BOTH the JavaScript object AND the native proxy.
60
+ Key rule: setting a JavaScript object to `null` destroys both the JavaScript object and the native proxy.
63
61
 
64
- ### Releasing Memory Properly
62
+ ### Releasing memory properly
65
63
 
66
- **Complete cleanup:**
64
+ Complete cleanup:
67
65
  ```javascript
68
- let view = Ti.UI.createView({backgroundColor: 'white'});
66
+ let view = Ti.UI.createView({ backgroundColor: 'white' });
69
67
  win.add(view);
70
68
 
71
- // Later: remove AND nullify
69
+ // Later: remove and nullify
72
70
  win.remove(view);
73
- view = null; // Critical: destroys native proxy
71
+ view = null; // Destroys native proxy
74
72
  ```
75
73
 
76
- **Incomplete cleanup (MEMORY LEAK):**
74
+ Incomplete cleanup (memory leak):
77
75
  ```javascript
78
- let view = Ti.UI.createView({backgroundColor: 'white'});
76
+ let view = Ti.UI.createView({ backgroundColor: 'white' });
79
77
  win.add(view);
80
78
 
81
79
  // Later: only remove
82
- win.remove(view); // view object STILL EXISTS in memory!
80
+ win.remove(view); // view object still exists in memory
83
81
  ```
84
82
 
85
- ### Parent-Child Relationships
83
+ ### Parent-child relationships
86
84
 
87
85
  ```javascript
88
86
  // Good: children not referenced elsewhere
89
87
  let view = Ti.UI.createView({
90
- backgroundColor: 'white'
88
+ backgroundColor: 'white'
91
89
  });
92
- view.add(Ti.UI.createButton({title: 'Click'})); // Anonymous child
90
+ view.add(Ti.UI.createButton({ title: 'Click' })); // Anonymous child
93
91
 
94
92
  win.remove(view);
95
- view = null; // Destroys view AND button
93
+ view = null; // Destroys view and button
96
94
 
97
95
  // Bad: children referenced separately
98
- const button = Ti.UI.createButton({title: 'Click'});
99
- let view = Ti.UI.createView({backgroundColor: 'white'});
96
+ const button = Ti.UI.createButton({ title: 'Click' });
97
+ let view = Ti.UI.createView({ backgroundColor: 'white' });
100
98
  view.add(button);
101
99
 
102
100
  win.remove(view);
103
- view = null; // Destroys view, BUT button still exists!
104
- button = null; // Now button is destroyed
101
+ view = null; // Destroys view, but button still exists
102
+ button = null; // Now button is destroyed
105
103
  ```
106
104
 
107
- ### Platform Memory Limits
105
+ ### Platform memory limits
108
106
 
109
- | Platform | Memory Limit |
107
+ | Platform | Memory limit |
110
108
  | -------- | -------------------------------------- |
111
109
  | iPhone | ~10% of system memory |
112
110
  | iPad | 30-50 MB (smaller is better) |
113
111
  | Android | 24-32 MB heap (128 MB with large heap) |
114
112
 
115
- **iOS Notes:**
116
- - Apple doesn't publish exact limits
117
- - "Jetsam" process can terminate your app
118
- - "Jetsam" in crash logs = memory issue
119
-
120
- > **Important**: Memory ≠ storage. A 16GB device doesn't mean 16GB for your app. These limits may be higher on newer devices but always optimize for the lowest common denominator.
113
+ Notes for iOS:
114
+ - Apple does not publish exact limits
115
+ - The jetsam process can terminate your app
116
+ - "Jetsam" in crash logs often means a memory issue
121
117
 
122
- ---
118
+ Important: memory is not storage. A 16GB device does not mean 16GB for your app. Limits may be higher on newer devices, but optimize for the lowest common denominator.
123
119
 
124
- ## Memory Leak Detection
120
+ ## Memory leak detection
125
121
 
126
- ### Common Leak Sources
122
+ ### Common leak sources
127
123
 
128
- **1. Global Event Listeners**
124
+ 1. Global event listeners
129
125
  ```javascript
130
- // LEAK: Listener keeps reference to window
126
+ // Leak: listener keeps reference to window
131
127
  Ti.App.addEventListener('custom:event', (e) => {
132
- // Uses window variables
128
+ // Uses window variables
133
129
  });
134
130
  ```
135
131
 
136
- **Fix: Remove listeners when closing window**
132
+ Fix: remove listeners when closing window
137
133
  ```javascript
138
134
  const myHandler = (e) => {
139
- // Handle event
135
+ // Handle event
140
136
  };
141
137
 
142
138
  Ti.App.addEventListener('custom:event', myHandler);
143
139
 
144
140
  win.addEventListener('close', () => {
145
- Ti.App.removeEventListener('custom:event', myHandler);
141
+ Ti.App.removeEventListener('custom:event', myHandler);
146
142
  });
147
143
  ```
148
144
 
149
- **2. Objects in Closures**
145
+ 2. Objects in closures
150
146
  ```javascript
151
- // LEAK: Closure retains object reference
147
+ // Leak: closure retains object reference
152
148
  function createWindow() {
153
- const data = []; // Large array
154
- return Ti.UI.createWindow({
155
- listener: () => {
156
- data.push('more'); // Closure reference
157
- }
158
- });
149
+ const data = []; // Large array
150
+ return Ti.UI.createWindow({
151
+ listener: () => {
152
+ data.push('more'); // Closure reference
153
+ }
154
+ });
159
155
  }
160
156
  ```
161
157
 
162
- **Fix:** Pass data as argument instead of closure reference.
158
+ Fix: pass data as an argument instead of keeping it in a closure.
163
159
 
164
- **3. Hidden Views**
160
+ 3. Hidden views
165
161
  ```javascript
166
- // LEAK: Hidden view still consumes memory
167
- view.visible = false; // Not enough!
162
+ // Leak: hidden view still consumes memory
163
+ view.visible = false; // Not enough
168
164
  ```
169
165
 
170
- **Fix:** Remove and nullify when not needed
166
+ Fix: remove and nullify when not needed
171
167
  ```javascript
172
168
  view.visible = false;
173
169
  parent.remove(view);
174
170
  view = null;
175
171
  ```
176
172
 
177
- ### Debugging Memory on iOS (Instruments)
173
+ ### Debugging memory on iOS (Instruments)
178
174
 
179
- **Setup:**
175
+ Setup:
180
176
  1. Open app in iOS Simulator
181
177
  2. Xcode → Open Developer Tool → Instruments
182
- 3. Choose **Allocations** template
178
+ 3. Choose Allocations template
183
179
  4. Choose Target → Your App
184
180
  5. Click Record
185
181
 
186
- **Key Columns:**
187
- | Column | What it Shows |
188
- | --------------------------------- | ------------------------ |
189
- | **Persistent Bytes** (Live Bytes) | Memory currently in use |
190
- | **#Persistent** (#Living) | Active object count |
191
- | **#Transient** (#Transitory) | Ready to garbage collect |
182
+ Key columns:
183
+ | Column | What it shows |
184
+ | --------------------------------- | ----------------------- |
185
+ | Persistent Bytes (Live Bytes) | Memory currently in use |
186
+ | #Persistent (#Living) | Active object count |
187
+ | #Transient (#Transitory) | Ready to garbage collect |
192
188
 
193
- **Identifying Leaks:**
189
+ Identifying leaks:
194
190
  1. Filter for `Ti` prefix (Titanium objects)
195
- 2. Watch **#Living** as you use app
196
- 3. If it grows continuously = leak
197
- 4. **#Transitory** growing is OK (will be GC'd)
191
+ 2. Watch #Living as you use the app
192
+ 3. If it grows continuously, you have a leak
193
+ 4. #Transitory growing is fine (will be GC'd)
198
194
 
199
- **Example Workflow:**
195
+ Example workflow:
200
196
  ```
201
197
  1. Filter: "TiUITableView" (table views)
202
198
  2. Open/close a table view screen
203
199
  3. Click "Cause GC" (garbage collection)
204
200
  4. Check if #Living returns to previous value
205
- 5. If not = leak in that screen
201
+ 5. If not, the leak is in that screen
206
202
  ```
207
203
 
208
- ### Debugging Memory on Android (DDMS)
204
+ ### Debugging memory on Android (DDMS)
209
205
 
210
- **Setup:**
211
- 1. Add to tiapp.xml:
206
+ Setup:
207
+ 1. Add to `tiapp.xml`:
212
208
  ```xml
213
209
  <android xmlns:android="http://schemas.android.com/apk/res/android">
214
210
  <manifest>
@@ -221,25 +217,23 @@ view = null;
221
217
  2. Build app for emulator
222
218
  3. Open DDMS (Android Device Monitor)
223
219
 
224
- **Monitoring:**
220
+ Monitoring:
225
221
  1. Select your app process
226
- 2. Click **Update Heap** button
227
- 3. Click **Cause GC** to force garbage collection
228
- 4. Watch **Allocated** and **# Objects** values
222
+ 2. Click Update Heap
223
+ 3. Click Cause GC to force garbage collection
224
+ 4. Watch Allocated and # Objects values
229
225
 
230
- **Identifying Leaks:**
226
+ Identifying leaks:
231
227
  1. Note initial values after GC
232
228
  2. Exercise app (open/close screens)
233
- 3. Click **Cause GC** again
234
- 4. If values don't return to baseline = leak
229
+ 3. Click Cause GC again
230
+ 4. If values do not return to baseline, there is a leak
235
231
 
236
- ---
237
-
238
- ## Android Debugging Tools
232
+ ## Android debugging tools
239
233
 
240
234
  ### DDMS (Dalvik Debug Monitor Service)
241
235
 
242
- **Features:**
236
+ Features:
243
237
  - View log output
244
238
  - Explore file system
245
239
  - Simulate network conditions
@@ -247,49 +241,49 @@ view = null;
247
241
  - Set GPS coordinates
248
242
  - Monitor memory
249
243
 
250
- #### Log Output with DDMS
244
+ #### Log output with DDMS
251
245
 
252
246
  1. Open DDMS
253
247
  2. Select device/emulator
254
248
  3. View log in lower pane
255
249
  4. Add filter: Log Tag = `TiAPI`
256
250
 
257
- #### Simulate Network Conditions
251
+ #### Simulate network conditions
258
252
 
259
- **Emulator Control** panel:
253
+ Emulator Control panel:
260
254
  - Voice/Data state (home, roaming)
261
255
  - Data speed and latency
262
256
  - Test app behavior in poor conditions
263
257
 
264
- #### Simulate Calls/SMS
258
+ #### Simulate calls/SMS
265
259
 
266
- **Emulator Control** → Telephony Actions:
260
+ Emulator Control → Telephony Actions:
267
261
  - Incoming voice call
268
262
  - Incoming SMS message
269
263
  - Test app interruption handling
270
264
 
271
- #### Set GPS Coordinates
265
+ #### Set GPS coordinates
272
266
 
273
- **Emulator Control** → Location Controls:
267
+ Emulator Control → Location Controls:
274
268
  - Enter latitude/longitude
275
269
  - Click Send
276
- - Emulator uses these as "current location"
270
+ - Emulator uses these as current location
277
271
 
278
- #### File System Exploration
272
+ #### File system exploration
279
273
 
280
- **Device** → File Explorer:
274
+ Device → File Explorer:
281
275
  - Browse entire file system
282
276
  - Pull files (copy to computer)
283
277
  - Push files (copy to device)
284
278
  - Delete files
285
279
 
286
- #### Memory Monitoring
280
+ #### Memory monitoring
287
281
 
288
- Less useful for Titanium (JavaScript runs in one process), but can show overall memory trends.
282
+ Less useful for Titanium (JavaScript runs in one process), but it can show overall memory trends.
289
283
 
290
284
  ### ADB (Android Debug Bridge)
291
285
 
292
- #### Log Output
286
+ #### Log output
293
287
 
294
288
  ```bash
295
289
  # View all logs
@@ -310,7 +304,7 @@ adb logcat -s TiAPI
310
304
  adb logcat | grep TiAPI
311
305
  ```
312
306
 
313
- #### File System
307
+ #### File system
314
308
 
315
309
  ```bash
316
310
  # Open shell
@@ -324,7 +318,7 @@ cd /some/path
324
318
  exit
325
319
  ```
326
320
 
327
- #### Transfer Files
321
+ #### Transfer files
328
322
 
329
323
  ```bash
330
324
  # Copy file TO device
@@ -334,7 +328,7 @@ adb push local.txt /sdcard/local.txt
334
328
  adb pull /sdcard/remote.txt local.txt
335
329
  ```
336
330
 
337
- #### Access SQLite Databases
331
+ #### Access SQLite databases
338
332
 
339
333
  ```bash
340
334
  adb shell
@@ -352,9 +346,9 @@ SELECT * FROM tablename;
352
346
  .exit
353
347
  ```
354
348
 
355
- ### Creating Emulators
349
+ ### Creating emulators
356
350
 
357
- **Command Line:**
351
+ Command line:
358
352
  ```bash
359
353
  # List available targets
360
354
  android list targets
@@ -366,31 +360,31 @@ android create avd -n my_emulator -t 1 -s WVGA800 --abi x86
366
360
  emulator -avd my_emulator
367
361
  ```
368
362
 
369
- **AVD Manager (GUI):**
363
+ AVD Manager (GUI):
370
364
  ```bash
371
365
  android avd
372
366
  ```
373
367
 
374
- 1. Click **New**
368
+ 1. Click New
375
369
  2. Enter name, select device/target
376
370
  3. Choose x86 ABI if available
377
- 4. Click **OK**
371
+ 4. Click OK
378
372
 
379
- ### Modifying Emulators
373
+ ### Modifying emulators
380
374
 
381
- **Increase disk space:**
375
+ Increase disk space:
382
376
  Edit `~/.android/avd/<NAME>.avd/config.ini`:
383
377
  ```
384
378
  disk.dataPartition.size=1024m
385
379
  ```
386
380
 
387
- **Resize emulator:**
381
+ Resize emulator:
388
382
  1. Close emulator
389
383
  2. AVD Manager → Select emulator → Edit
390
384
  3. Change resolution
391
385
  4. Save
392
386
 
393
- **Scale on-the-fly:**
387
+ Scale on-the-fly:
394
388
  ```bash
395
389
  # Get emulator port
396
390
  adb devices
@@ -403,96 +397,88 @@ telnet localhost 5560
403
397
  window scale 0.75
404
398
  ```
405
399
 
406
- ---
407
-
408
- ## iOS Debugging Tools
400
+ ## iOS debugging tools
409
401
 
410
402
  ### Instruments
411
403
 
412
- **Key Templates for Titanium Debugging:**
413
- - **Allocations** Track object creation and live object counts. Look at "Persistent Bytes" (or "Live Bytes") and "#Persistent" (or "#Living") columns to track memory growth.
414
- - **Leaks** Detect memory leaks in real-time. Shows objects that are allocated but never released.
415
- - **Time Profiler** Identify CPU-intensive operations and bottlenecks.
416
- - **System Trace** — System-level events and thread activity.
417
- - **Zombies** Detect messages sent to deallocated objects (debug builds only). Useful for tracking over-released objects.
404
+ Key templates for Titanium debugging:
405
+ - Allocations: track object creation and live object counts. Look at Persistent Bytes (Live Bytes) and #Persistent (#Living).
406
+ - Leaks: detect memory leaks in real time. Shows objects that are allocated but never released.
407
+ - Time Profiler: identify CPU-intensive operations and bottlenecks.
408
+ - System Trace: system-level events and thread activity.
409
+ - Zombies: detect messages sent to deallocated objects (debug builds only). Useful for over-released objects.
418
410
 
419
- ### Xcode Build Debugging
411
+ ### Xcode build debugging
420
412
 
421
- For native debugging, open Xcode project in `build/iphone`:
413
+ For native debugging, open the Xcode project in `build/iphone`:
422
414
  1. Product → Profile
423
415
  2. Choose Instruments template
424
- 3. More accurate than attaching to running process
416
+ 3. More accurate than attaching to a running process
425
417
 
426
- ### Console Logs
418
+ ### Console logs
427
419
 
428
- **Viewing in Studio:**
420
+ Viewing in Studio:
429
421
  - Console panel shows build/run output
430
422
 
431
- **Viewing separately:**
423
+ Viewing separately:
432
424
  ```bash
433
425
  # For running apps
434
426
  tail -f ~/Library/Logs/CoreSimulator/<SIMULATOR_ID>/system.log
435
427
  ```
436
428
 
437
- ---
429
+ ## 6. Automation and UI testing
438
430
 
439
- ## 6. Automation and UI Testing
431
+ For CI/CD pipelines, automated deployment, and functional testing, see:
440
432
 
441
- For continuous integration (CI/CD) pipelines, automated deployment, and functional testing, see:
433
+ - Automation with Fastlane and Appium: `automation-fastlane-appium.md`
442
434
 
443
- - [Automation with Fastlane and Appium](./automation-fastlane-appium.md): Lane configuration, testing with Mocha/WebdriverIO, and store submission.
435
+ ## Best practices
444
436
 
445
- ## Best Practices
437
+ ### Memory management
446
438
 
447
- ### Memory Management
448
-
449
- 1. **Always nullify objects** after removing from view hierarchy
450
- 2. **Remove event listeners** when closing windows
451
- 3. **Avoid global variables** - use namespaces/CommonJS
452
- 4. **Use single execution context** - not multiple url-based windows
453
- 5. **Be careful with closures** - they retain references
454
- 6. **Hide vs Remove** - hide for temporary, remove/nullify for permanent
439
+ 1. Always nullify objects after removing them from the view hierarchy.
440
+ 2. Remove event listeners when closing windows.
441
+ 3. Avoid global variables; use namespaces or CommonJS.
442
+ 4. Use a single execution context, not multiple URL-based windows.
443
+ 5. Be careful with closures; they retain references.
444
+ 6. Hide vs remove: hide for temporary, remove/nullify for permanent.
455
445
 
456
446
  ### Debugging
457
447
 
458
- 1. **Log strategically** - remove sensitive logs before production
459
- 2. **Use descriptive log messages** - include variable values
460
- 3. **Test on real devices** - simulators can miss issues
461
- 4. **Profile early and often** - don't wait until crash
462
- 5. **Reproduce consistently** - can't fix what you can't reproduce
463
- 6. **Keep track of bugs** - use issue tracker
448
+ 1. Log strategically and remove sensitive logs before production.
449
+ 2. Use descriptive log messages and include variable values.
450
+ 3. Test on real devices; simulators miss issues.
451
+ 4. Profile early and often; do not wait for crashes.
452
+ 5. Reproduce consistently; you cannot fix what you cannot reproduce.
453
+ 6. Keep track of bugs; use an issue tracker.
464
454
 
465
455
  ### Performance
466
456
 
467
- 1. **Avoid excessive polling** - use events when possible
468
- 2. **Defer loading** - load data as needed, not all at once
469
- 3. **Optimize images** - compress and use appropriate sizes
470
- 4. **Minimize bridge crossings** - cache platform checks
471
- 5. **Test on slow networks** - simulate poor conditions
472
- 6. **Profile before optimizing** - measure first, then fix hotspots
473
-
474
- ---
457
+ 1. Avoid excessive polling; use events when possible.
458
+ 2. Defer loading; load data as needed.
459
+ 3. Optimize images; compress and use appropriate sizes.
460
+ 4. Minimize bridge crossings; cache platform checks.
461
+ 5. Test on slow networks; simulate poor conditions.
462
+ 6. Profile before optimizing; measure first, then fix hotspots.
475
463
 
476
- ## Platform-Specific Notes
464
+ ## Platform-specific notes
477
465
 
478
466
  ### Android
479
467
 
480
- - **debuggable flag** - Required for native debugging
481
- - **Large heap** - Enable in tiapp.xml if needed
482
- - **ProGuard** - Can obfuscate and optimize code
483
- - **Multidex** - May be needed for very large apps
468
+ - Debuggable flag: required for native debugging
469
+ - Large heap: enable in `tiapp.xml` if needed
470
+ - ProGuard: can obfuscate and optimize code
471
+ - Multidex: may be needed for very large apps
484
472
 
485
473
  ### iOS
486
474
 
487
- - **Instruments** - Most powerful tool for iOS profiling
488
- - **Zombies** - Instruments tool to find over-released objects
489
- - **Allocation tracker** - Shows object creation/lifecycle
490
- - **Time Profiler** - Identifies CPU bottlenecks
491
-
492
- ---
475
+ - Instruments: most powerful tool for iOS profiling
476
+ - Zombies: Instruments tool to find over-released objects
477
+ - Allocation tracker: shows object creation and lifecycle
478
+ - Time Profiler: identifies CPU bottlenecks
493
479
 
494
480
  ## Resources
495
481
 
496
- - **Video:** Your Apps are Leaking (Codestrong 2011)
497
- - **Android DDMS Docs** - https://minimum-viable-product.github.io/marshmallow-docs/tools/debugging/ddms.html
498
- - **iOS Instruments Guide** - Apple Developer Documentation
482
+ - Video: Your Apps are Leaking (Codestrong 2011)
483
+ - Android DDMS docs: https://minimum-viable-product.github.io/marshmallow-docs/tools/debugging/ddms.html
484
+ - iOS Instruments guide: Apple Developer Documentation