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: content/guide/choosing-an-editor.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ The `code` command runs in your command-line or terminal, and it works just like
20
20
21
21
Once set up, you can type `code .` in your terminal to open the files in your current folder for editing. For example, you could use the following sequence of command to create a new NativeScript app and open it for editing.
Copy file name to clipboardExpand all lines: content/guide/cli-basics.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ This helps ensure everything fits together correctly. If you're dealing with mys
25
25
26
26
To clean, run this command from your project's root directory:
27
27
28
-
```cli
28
+
```bash
29
29
ns clean
30
30
```
31
31
@@ -43,7 +43,7 @@ If you have multiple projects in a directory, you can run `ns clean` in it, and
43
43
44
44
To list all connected devices (both physical and virtual), run:
45
45
46
-
```cli
46
+
```bash
47
47
ns devices
48
48
```
49
49
@@ -61,7 +61,7 @@ Example output:
61
61
62
62
To set the default package manager that the CLI uses (unless overridden in [nativescript.config.ts](/project-structure/nativescript-config#cli-packagemanager)):
Copy file name to clipboardExpand all lines: content/guide/creating-a-project.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,21 +16,21 @@ Official templates can be found in the [Templates GitHub repository](https://git
16
16
17
17
Some of the templates are listed in the NativeScript CLI when creating a new project with `ns create`, others may be used by passing the `--template` flag with the template name (NPM package name).
18
18
19
-
```cli
19
+
```bash
20
20
ns create myCoolApp
21
21
```
22
22
23
23
If you would like to try one of the other templates not listed by `ns create` run:
24
24
25
-
```cli
25
+
```bash
26
26
ns create myCoolApp --template <template-package-name or path-to-template>
27
27
```
28
28
29
29
:::tip
30
30
31
31
If you want to skip the interactive prompts, you can pass the following flags:
32
32
33
-
```cli
33
+
```bash
34
34
ns create myCoolApp --angular // or --ng for short
35
35
ns create myCoolApp --vue
36
36
ns create myCoolApp --vue --ts // for vue with typescript
@@ -56,7 +56,7 @@ A basic template with a single page and no custom styles.
Copy file name to clipboardExpand all lines: content/guide/debugging.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,15 +40,15 @@ console.timeEnd('myLabel')
40
40
41
41
To start a Chrome debugging session, run your app in debug mode:
42
42
43
-
```cli
43
+
```bash
44
44
ns debug android|ios
45
45
```
46
46
47
47
The `ns debug` command builds and deploys the app on a connected device or emulator, in case you have multiple devices available you will need to pick one from a list, or pass in the `--device <id>` from `ns devices`.
48
48
49
49
Once the app starts, a URL is printed to the console
50
50
51
-
```cli{5-6}
51
+
```bash{5-6}
52
52
Setting up debugger proxy...
53
53
Press Ctrl + C to terminate, or disconnect.
54
54
@@ -99,15 +99,15 @@ If you need to debug parts of the native stack instead of the JavaScript part of
99
99
100
100
To start, prepare the iOS app:
101
101
102
-
```cli
102
+
```bash
103
103
ns prepare ios
104
104
```
105
105
106
106
This compiles your app source, creates the `platforms/ios` folder (if it doesn't exist yet). You can pass any of the flags you would normally pass to `ns run`.
107
107
108
108
Next, open the `platforms/ios/<project-name>.xcworkspace` in XCode, either through the XCode browse menu, or from the command line:
109
109
110
-
```cli
110
+
```bash
111
111
open platforms/ios/<project-name>.xcworkspace
112
112
```
113
113
@@ -134,7 +134,7 @@ If you need to debug parts of the native stack instead of the JavaScript part of
134
134
135
135
To start, prepare the Android app:
136
136
137
-
```cli
137
+
```bash
138
138
ns prepare android
139
139
```
140
140
@@ -145,7 +145,7 @@ Next, open the `platforms/android` folder in Android Studio, through the Android
145
145
:::tip Tip
146
146
If you [set up the `studio` command line launcher](https://stackoverflow.com/a/48266060/2270725), you can quickly open the NativeScript project from the command line with
Copy file name to clipboardExpand all lines: content/guide/development-workflow/using-packages.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,19 +21,19 @@ You can also explore [@nativescript/core](/core/#nativescript-core), which is in
21
21
22
22
Once the needed plugin is found, it can be installed in a NativeScript app using the `ns plugin add` command which behaves just like `npm install` while also modifying any existing platform projects (linking, etc.).
23
23
24
-
```cli
24
+
```bash
25
25
ns plugin add <plugin-name>
26
26
```
27
27
28
28
For example, the following command installs the [NativeScript camera plugin](https://v8.docs.nativescript.org/plugins/camera.html).
29
29
30
-
```cli
30
+
```bash
31
31
ns plugin add @nativescript/camera
32
32
```
33
33
34
34
Instead of using plugin add, package managers like npm, yarn, or pnpm can also be used:
35
35
36
-
```cli
36
+
```bash
37
37
npm install --save @nativescript/camera
38
38
```
39
39
@@ -43,7 +43,7 @@ The installation of a NativeScript plugin is similar to installing a npm package
43
43
44
44
As demonstrated above, the command `ns plugin add @nativescript/camera` is equivalent to `npm i @nativescript/camera --save` internally. However, when installing a developer dependency, such as @nativescript/types or @nativescript/webpack, you need to explicitly save it as a devDependency. To do so, use the npm install command with the --save-dev flag. For instance:
45
45
46
-
```cli
46
+
```bash
47
47
npm i @nativescript/types --save-dev
48
48
```
49
49
@@ -69,13 +69,13 @@ requestPermissions()
69
69
70
70
To remove a NativeScript plugin, you can use the following command.
71
71
72
-
```cli
72
+
```bash
73
73
ns plugin remove <plugin-name>
74
74
```
75
75
76
76
For example, the following command removes the NativeScript camera plugin.
77
77
78
-
```cli
78
+
```bash
79
79
ns plugin remove @nativescript/camera
80
80
```
81
81
@@ -99,6 +99,6 @@ NativeScript CLI supports three package managers:
99
99
100
100
In case you want to check what is the currently used package manager, you can use:
Copy file name to clipboardExpand all lines: content/guide/running.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ To run a NativeScript app, you need a device — either a physical or virtu
11
11
12
12
To run a project, use the `ns run` command. There's also a `ns debug` command covered in the [debugging documentation](/guide/debugging#debugging-with-chrome-devtools).
13
13
14
-
```cli
14
+
```bash
15
15
ns run android
16
16
ns run ios
17
17
```
@@ -52,13 +52,13 @@ Next, go to `Settings › System › Developer options` and enable `USB debuggin
52
52
53
53
Plug in your device via USB and check that it is correctly being detected by <abbrtitle="Android Debug Bridge">ADB</abbr>:
54
54
55
-
```cli
55
+
```bash
56
56
adb devices
57
57
```
58
58
59
59
To verify NativeScript can also detect the device, run:
60
60
61
-
```cli
61
+
```bash
62
62
ns devices android
63
63
```
64
64
@@ -99,7 +99,7 @@ If there's no `.xcworkspace` file, you can open the `.xcodeproj` file instead.
99
99
100
100
Once the app successfully runs from Xcode, you can close it and continue using the NativeScript cli:
101
101
102
-
```cli
102
+
```bash
103
103
ns run ios
104
104
```
105
105
@@ -111,7 +111,7 @@ Once the device has been [prepared for development](#preparing-an-ios-device-for
111
111
112
112
After disconnecting the cable, the device should remain visible in `ns devices` and running the app should work as normal:
0 commit comments