You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/watchos-integration.md
+63-6Lines changed: 63 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,14 +8,17 @@ The NativeScript CLI now supports advanced watchOS integration beyond basic sour
8
8
9
9
1. Add Swift Package Manager (SPM) dependencies to watch app targets
10
10
2. Integrate xcframework modules (like "Data" modules) that can be imported in your WatchApp
11
-
3. Reuse existing targets from your xcworkspace (bonus feature)
11
+
3. Integrate folder-based modules (non-compiled modules with Info.plist)
12
+
4. Reuse existing targets from your xcworkspace (bonus feature)
13
+
5. Support Xcode 14+ single target mode (watchapp without extension)
12
14
13
15
## Configuration
14
16
15
17
### Basic Watch App Structure
16
18
17
19
Place your watch app files in the following structure within your App_Resources:
18
20
21
+
#### Traditional Structure (Pre-Xcode 14)
19
22
```
20
23
App_Resources/
21
24
iOS/ (or visionOS/)
@@ -29,6 +32,18 @@ App_Resources/
29
32
... (watch extension sources)
30
33
```
31
34
35
+
#### Xcode 14+ Single Target Structure
36
+
```
37
+
App_Resources/
38
+
iOS/ (or visionOS/)
39
+
watchapp/
40
+
YourWatchApp/
41
+
watchapp.json
42
+
... (watch app sources and resources)
43
+
```
44
+
45
+
**Note**: From Xcode 14+, the `watchextension` folder is optional. If only `watchapp` exists, the CLI will create a single target configuration suitable for modern watchOS development.
46
+
32
47
### Enhanced Configuration
33
48
34
49
#### 1. SPM Packages for Watch App
@@ -57,9 +72,13 @@ export default {
57
72
}
58
73
```
59
74
60
-
#### 2. Module Dependencies (xcframework modules)
75
+
#### 2. Module Dependencies
76
+
77
+
The CLI supports two types of modules:
78
+
79
+
##### A. Compiled Frameworks (xcframework, framework)
61
80
62
-
If your watch app needs to import modules from xcframeworks (e.g., `import Data`), configure them in your watch app's `watchapp.json` or `extension.json`:
81
+
If your watch app needs to import modules from compiled frameworks (e.g., `import Data`), configure them in your watch app's `watchapp.json` or `extension.json`:
63
82
64
83
**watchapp.json example:**
65
84
```json
@@ -72,22 +91,60 @@ If your watch app needs to import modules from xcframeworks (e.g., `import Data`
For folder-based modules that contain an Info.plist (non-compiled modules), the CLI will automatically detect them and configure them as Xcode modules:
0 commit comments