Skip to content

Commit 00eae51

Browse files
committed
docs: environment setup
1 parent a4f66fb commit 00eae51

File tree

1 file changed

+70
-7
lines changed

1 file changed

+70
-7
lines changed

environment-setup.md

Lines changed: 70 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ title: Environment Setup
44

55
## Setting up your system
66

7-
- [REFERENCE] https://github.com/NativeScript/docs/blob/master/docs/start/general-requirements.md
7+
- [USED REFERENCE] https://github.com/NativeScript/docs/blob/master/docs/start/general-requirements.md
88
- [REFERENCE] https://github.com/NativeScript/docs/blob/master/docs/start/ns-setup-linux.md
9-
- [REFERENCE] https://github.com/NativeScript/docs/blob/master/docs/start/ns-setup-os-x.md
10-
- [REFERENCE] https://github.com/NativeScript/docs/blob/master/docs/start/ns-setup-win.md
11-
- [REFERENCE] https://github.com/NativeScript/docs/blob/master/docs/start/quick-setup.md
9+
- [USED REFERENCE] https://github.com/NativeScript/docs/blob/master/docs/start/ns-setup-os-x.md
10+
- [USED REFERENCE] https://github.com/NativeScript/docs/blob/master/docs/start/ns-setup-win.md
11+
- [USED REFERENCE] https://github.com/NativeScript/docs/blob/master/docs/start/quick-setup.md
1212

1313
---
1414

@@ -116,7 +116,7 @@ You will need Node, NativeScript CLI (command line interface), Android Studio an
116116

117117
**Android Studio** is not strictly necessary — however it provides an easy to use interface for installing and managing the Android SDKs.
118118

119-
We recommend using [Howbrew](https://brew.sh/) to install the required dependencies — a popular package manager for macOS.
119+
We recommend using [Homebrew](https://brew.sh/) to install the required dependencies — a popular package manager for macOS.
120120

121121
:::warning
122122
When installing Homebrew, carefully follow their instructions to avoid configuration issues.
@@ -188,7 +188,7 @@ To run a NativeScript app, you will need an Android device — either a phy
188188

189189
You will need Node, NativeScript CLI (command line interface), XCode, xcodeproj, cocoapods.
190190

191-
We recommend using [Howbrew](https://brew.sh/) to install the required dependencies — a popular package manager for macOS.
191+
We recommend using [Homebrew](https://brew.sh/) to install the required dependencies — a popular package manager for macOS.
192192

193193
:::warning Note
194194
When installing Homebrew, carefully follow their instructions to avoid configuration issues.
@@ -354,6 +354,69 @@ Talk about how NativeScript can be embedded into existing apps - clear and detai
354354

355355
### Building for Smart Watches
356356

357-
- [REFERENCE] https://github.com/NativeScript/docs/blob/master/docs/tooling/ios-watch-apps.md
357+
- [USED REFERENCE] https://github.com/NativeScript/docs/blob/master/docs/tooling/ios-watch-apps.md
358+
359+
#### iOS WatchOS Applications
360+
361+
With version 5.4 the NativeScript CLI introduces a Beta support for integrating a [WatchOS](https://developer.apple.com/watchos/) application in your iOS mobile app created with NativeScript.
362+
363+
#### Prerequisites
364+
365+
- **NativeScript CLI version 5.4** and above.
366+
- NativeScript project.
367+
- **Xcode 10** and above.
368+
- Paired devices or simulators (**iPhone** and **iWatch** with **WatchOS 4.x/5.x** and above).
369+
370+
> **Note:** WatchOS 4.x won't work with the default Watch App created with Xcode. The user will have to manually set **_`WATCHOS_DEPLOYMENT_TARGET`_** in the configuration json (see below for details).
371+
372+
- WatchOS app created with **Objective-C** (Swift code [is **not** supported yet](https://github.com/NativeScript/nativescript-cli/issues/4541#issuecomment-491202270)).
373+
374+
#### WatchOS application in NativeScript.
375+
376+
To integrate your existing WatchOS application into your NativeScript project, execute the following steps:
377+
378+
1. Create **_Single View App_** from Xcode.
379+
380+
2. Add watch app target through **_File > New > Target > WatchKit App_**.
381+
382+
3. Add a name to your watch app, for example, **_MyFirstWatchApp_**. In the same screen verify that **Objective-C** is selected as your language.
383+
384+
> **Note** You can skip steps 1-3 if your Watch app is already created.
385+
386+
4. Copy the generated **_MyFirstWatchApp_** and **_MyFirstWatchAppExtension_** to **_.../apps/MyApp/app/App_Resources/iOS/watchapp/MyFirstWatchApp_** and **_.../apps/MyApp/app/App_Resources/iOS/watchextension/MyFirstWatchAppExtension_** respectively.
387+
388+
5. Inside the **_Info.plist_** of the Watch App replace the value of **_`WKCompanionAppBundleIdentifier`_** with **_`$(WK_APP_BUNDLE_IDENTIFIER)`_**.
389+
390+
6. Inside the **_Info.plist_** of the Watch Extension replace the
391+
of **_`WKAppBundleIdentifier`_** with **_`$(WK_APP_BUNDLE_IDENTIFIER)`_**.
392+
393+
7. You can populate the **_Assets.xcassets_** of the Watch App and add the name of the **_`appiconset`_** to the **_.../apps/MyApp/app/App_Resources/iOS/watchapp/MyFirstWatchApp/watchapp.json_**:
394+
395+
```JSON
396+
{
397+
"assetcatalogCompilerAppiconName": "AppIcon"
398+
}
399+
```
400+
401+
8. You can modify the **_`WATCHOS_DEPLOYMENT_TARGET`_** of the Watch App by adding the value inside the **_watchapp.json _** file like this:
402+
403+
```JSON
404+
{
405+
"assetcatalogCompilerAppiconName": "AppIcon",
406+
"targetBuildConfigurationProperties": {
407+
"WATCHOS_DEPLOYMENT_TARGET": 4.1
408+
}
409+
}
410+
```
411+
412+
9. Build & Run the NativeScript application.
413+
414+
```Shell
415+
ns run ios
416+
```
417+
418+
10. The application will be deployed and started on your iOS device/simulator. Make sure that the test iPhone is already paired with the testing iWatch. Once the iOS app starts, the Watch app will be automatically deployed on the testing iWatch device.
419+
420+
> **Note:** As of May 2019 the feature is still in _BETA_. Please report all issues, bugs and features related to the WatchOS functionality in [the tracking issue](https://github.com/NativeScript/nativescript-cli/issues/4541#issue-433686622).
358421
359422
### Potentially desktop in the future?

0 commit comments

Comments
 (0)