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: index.html
+11-5Lines changed: 11 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -183,18 +183,24 @@ <h4 class="exercise-start">
183
183
</h4>
184
184
185
185
<p>If your previous <code>tns run ios</code> or <code>tns run android</code> task is still running, type <code>Ctrl+C</code> in your terminal to kill it.</p>
186
-
<p>If you’re on a Mac, start an iOS livesync watcher by executing the following command:</p>
187
-
<pre><code>tns livesync ios --emulator --watch
188
-
</code></pre><p>If you have an Android emulator running, start an Android livesync watcher by executing the following command:</p>
186
+
<!--
187
+
If you’re on a Mac, start an iOS livesync watcher by executing the following command:
188
+
189
+
```
190
+
tns livesync ios --emulator --watch
191
+
```
192
+
-->
193
+
<p>If you have an Android emulator running, start an Android livesync watcher by executing the following command:</p>
</code></pre><p>The <code>tns livesync</code> command updates your app by transferring the updated source code to the device or simulator. By adding the <code>--watch</code> flag, the <code>livesync</code> command additionally watches the files in your NativeScript project. Whenever one of those files changes, the command detects the update, and patches your app with the updated code.</p>
191
196
<blockquote>
192
197
<p><strong>TIP</strong>: You can learn about how this is possible by reading more about <ahref="http://developer.telerik.com/featured/nativescript-works/">how NativeScript works</a>.</p>
193
198
</blockquote>
194
199
<p>To see livesync in action let’s make a small update to your app. Open your project’s <code>app/app.component.ts</code> file in your text editor of choice and change <code><Label text='hello world'></Label></code> to <code><Label text='hello NativeScript'></Label></code>. Save the file and you should see the app relaunch and the updated text displayed.</p>
200
+
<p>If you’re on a Mac building for iOS, the workflow is currently a bit different, as the <code>tns livesync ios</code> command is not yet supported. (See the <ahref="#chapter8.0">known issues</a> for details.) To see the updated text, type <code>Ctrl+C</code> to kill your previous <code>tns run ios</code> command, and then re-execute <code>tns run ios --emulator</code> to launch the app with your changes.</p>
195
201
<divclass="exercise-end"></div>
196
202
197
-
<p>In addition to updating your NativeScript app on the fly, the livesync command also shows the output of <code>console.log()</code> statements as your app executes, as well as stack traces when things go wrong. So if your app crashes at any time during this guide, look to the terminal for a detailed report of the problem.</p>
203
+
<p>Regardless of whether you’re running on iOS or Android, or whether you’re using <code>tns livesync</code> or <code>tns run</code>, the NativeScript CLI shows the output of <code>console.log()</code> statements as your app executes, as well as stack traces when things go wrong. So if your app crashes at any time during this guide, look to the terminal for a detailed report of the problem.</p>
198
204
<p>The iOS and Android logs can be a bit noisy, so you might have to scroll up a bit to find the actual problem. For example if I try to call <code>foo.bar()</code> when <code>foo</code> does not exist, here's the information I get on iOS:</p>
<p><strong>TIP</strong>: When you're trying to debug a problem, try adding <code>console.log()</code> statements in your JavaScript code—exactly as you would in a browser-based application.</p>
206
-
<p><strong>WARNING</strong>: Not all changes can be livesync’d in a NativeScript app. For instance, livesync cannot patch native configuration file changes (<code>Info.plist</code>, <code>AndroidManifest.xml</code>, and so forth), new plugin installations, and any other change that requires a full compilation of the application. In those cases, you’ll want to use <code>Ctrl+C</code> to stop livesync, and rerun the application using the <code>tns run ios</code> and <code>tns run android</code> commands. Not to worry though, when situations that require a full compilation come up in this guide, these instructions will be explicitly listed.</p>
212
+
<p><strong>WARNING</strong>: Not all changes can be livesync’d in a NativeScript app. For instance, livesync cannot patch native configuration file changes (<code>Info.plist</code>, <code>AndroidManifest.xml</code>, and so forth), new plugin installations, and any other change that requires a full compilation of the application. In those cases, you’ll want to use <code>Ctrl+C</code> to stop livesync, and rerun the application using the <code>tns run android</code> commands. Not to worry though, when situations that require a full compilation come up in this guide, these instructions will be explicitly listed.</p>
207
213
</blockquote>
208
214
<p>Now that you've created an app, configured your environment, and set up your app to run on iOS and Android, you're ready to start digging into the files that make up a NativeScript app.</p>
Copy file name to clipboardExpand all lines: src/chapters/chapter1.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -147,11 +147,13 @@ At this point, you have the NativeScript CLI downloaded and installed, as well a
147
147
148
148
If your previous `tns run ios` or `tns run android` task is still running, type `Ctrl+C` in your terminal to kill it.
149
149
150
+
<!--
150
151
If you’re on a Mac, start an iOS livesync watcher by executing the following command:
151
152
152
153
```
153
154
tns livesync ios --emulator --watch
154
155
```
156
+
-->
155
157
156
158
If you have an Android emulator running, start an Android livesync watcher by executing the following command:
157
159
@@ -165,9 +167,11 @@ The `tns livesync` command updates your app by transferring the updated source c
165
167
166
168
To see livesync in action let’s make a small update to your app. Open your project’s `app/app.component.ts` file in your text editor of choice and change `<Label text='hello world'></Label>` to `<Label text='hello NativeScript'></Label>`. Save the file and you should see the app relaunch and the updated text displayed.
167
169
170
+
If you’re on a Mac building for iOS, the workflow is currently a bit different, as the `tns livesync ios` command is not yet supported. (See the [known issues](#chapter8.0) for details.) To see the updated text, type `Ctrl+C` to kill your previous `tns run ios` command, and then re-execute `tns run ios --emulator` to launch the app with your changes.
171
+
168
172
<div class="exercise-end"></div>
169
173
170
-
In addition to updating your NativeScript app on the fly, the livesync command also shows the output of `console.log()` statements as your app executes, as well as stack traces when things go wrong. So if your app crashes at any time during this guide, look to the terminal for a detailed report of the problem.
174
+
Regardless of whether you’re running on iOS or Android, or whether you’re using `tns livesync` or `tns run`, the NativeScript CLI shows the output of `console.log()` statements as your app executes, as well as stack traces when things go wrong. So if your app crashes at any time during this guide, look to the terminal for a detailed report of the problem.
171
175
172
176
The iOS and Android logs can be a bit noisy, so you might have to scroll up a bit to find the actual problem. For example if I try to call `foo.bar()` when `foo` does not exist, here's the information I get on iOS:
> **TIP**: When you're trying to debug a problem, try adding `console.log()` statements in your JavaScript code—exactly as you would in a browser-based application.
187
191
188
-
> **WARNING**: Not all changes can be livesync’d in a NativeScript app. For instance, livesync cannot patch native configuration file changes (`Info.plist`, `AndroidManifest.xml`, and so forth), new plugin installations, and any other change that requires a full compilation of the application. In those cases, you’ll want to use `Ctrl+C` to stop livesync, and rerun the application using the `tns run ios` and `tns run android` commands. Not to worry though, when situations that require a full compilation come up in this guide, these instructions will be explicitly listed.
192
+
> **WARNING**: Not all changes can be livesync’d in a NativeScript app. For instance, livesync cannot patch native configuration file changes (`Info.plist`, `AndroidManifest.xml`, and so forth), new plugin installations, and any other change that requires a full compilation of the application. In those cases, you’ll want to use `Ctrl+C` to stop livesync, and rerun the application using the `tns run android` commands. Not to worry though, when situations that require a full compilation come up in this guide, these instructions will be explicitly listed.
189
193
190
194
Now that you've created an app, configured your environment, and set up your app to run on iOS and Android, you're ready to start digging into the files that make up a NativeScript app.
0 commit comments