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: README.md
+80-38Lines changed: 80 additions & 38 deletions
Original file line number
Diff line number
Diff line change
@@ -69,52 +69,60 @@ You can install and run the NativeScript CLI on Windows or OS X.
69
69
> On Windows systems, you can develop, build, and deploy NativeScript projects that target Android.
70
70
71
71
* Windows Vista or later
72
-
*[Node.js 0.10.26][Node.js 0.10.26] or a later stable official release
72
+
*[Node.js 0.10.35][Node.js 0.10.35] or a later stable official release
73
73
* (Optional) [Chocolatey][Chocolatey]
74
74
*[JDK 8][JDK 8] or a later stable official release
75
-
*[Apache Ant 1.8][Apache Ant 1.8] or a later stable official release
76
-
*[Android SDK 19][Android SDK 19] or a later stable official release
75
+
*[Gradle 2.3][Gradle 2.3] or a later stable official release
76
+
*[Android SDK 21][Android SDK 21] or a later stable official release
77
+
*[Android SDK Build-tools 22.0.0][Android SDK Build-tools 22.0.0] or a later stable official release
78
+
*[Android Support Repository][Android Support Repository]
77
79
* (Optional) [Genymotion][Genymotion]
78
80
79
81
If you want to develop for Android, verify that you have added the following paths in the `PATH` system environment variable.
80
82
81
83
```
82
-
Path to the bin directory in the Apache Ant installation folder
84
+
Path to the bin directory in the Gradle installation folder
83
85
Path to tools directory in the Android SDK installation folder
84
86
Path to platform-tools directory in the Android SDK installation folder
85
87
```
86
88
87
-
For example: PATH=...;...;C:\tools\apache-ant-1.9.4\bin;C:\Users\MyUser\AppData\Local\Android\android-sdk\tools;C:\Users\MyUser\AppData\Local\Android\android-sdk\platform-tools;
89
+
For example: PATH=...;...;C:\tools\gradle\bin;C:\Users\MyUser\AppData\Local\Android\android-sdk\tools;C:\Users\MyUser\AppData\Local\Android\android-sdk\platform-tools;
88
90
89
-
If you have installed Chocolatey, you can complete these steps to set up JDK, Apache Ant, and Android SDK.
91
+
If you have installed Chocolatey, you can complete these steps to set up JDK, Gradle, and Android SDK.
90
92
91
93
1. Run a Windows command prompt.
92
94
1. To install JDK, run the following command.
93
95
94
96
```Shell
95
97
choco install java.jdk
96
98
```
97
-
1. If not present, create the following environment variable.
99
+
1. If not present, create the following environment variables.
98
100
99
101
```
100
102
JAVA_HOME=Path to the jdk* install folder
101
103
```
102
104
103
105
For example: JAVA_HOME=C:\Program Files\Java\jdk1.8.0_11
104
-
1. To install Apache Ant, run the following command.
106
+
107
+
```
108
+
ANDROID_HOME=Path to Android installation directory
109
+
```
110
+
111
+
For example: ANDROID_HOME=C:\Android\android-sdk
112
+
1. To install Gradle, run the following command.
105
113
106
114
```Shell
107
-
choco install ant
115
+
choco install gradle
108
116
```
109
117
1. If not present, add the following file path to the `PATH` system environment variable.
110
118
111
119
```
112
-
Path to the bin directory in the Apache Ant installation folder
120
+
Path to the bin directory in the Gradle installation folder
113
121
```
114
122
115
-
For example: PATH=...;...;C:\tools\apache-ant-1.9.4\bin
123
+
For example: PATH=...;...;C:\tools\gradle\bin
116
124
1. To install the Android SDK, run the following command.
117
-
125
+
118
126
```Shell
119
127
choco install android-sdk
120
128
```
@@ -126,50 +134,68 @@ If you have installed Chocolatey, you can complete these steps to set up JDK, Ap
126
134
```
127
135
128
136
For example: PATH=...;...;C:\Users\MyUser\AppData\Local\Android\android-sdk\tools;C:\Users\MyUser\AppData\Local\Android\android-sdk\platform-tools
129
-
1. To update the Android SDK to 19 or later, run the following command.
137
+
1. To update the Android SDK to 21 or later, run the following command.
130
138
131
139
```Shell
132
140
android update sdk
133
141
```
134
-
1. Select all packages for the Android 19 SDK and any other SDKs that you want to install, click **Install** and wait for the installation to complete.
142
+
1. Select all packages for the Android 21 SDK and any other SDKs that you want to install, click **Install** and wait for the installation to complete.
143
+
1. Select Android SDK Build-tools 22.0.0 or later stable version, click **Install** and wait for the installation to complete.
144
+
1. Select Extras/Android Support Repository, click **Install** and wait for the installation to complete.
135
145
136
146
## OS X
137
147
138
148
> On OS X systems, you can develop, build, and deploy NativeScript projects that target iOS and Android.
139
149
140
150
* OS X Mavericks
141
-
*[Node.js 0.10.26][Node.js 0.10.26] or a later stable official release
151
+
*[Node.js 0.10.35][Node.js 0.10.35] or a later stable official release
142
152
* For iOS development
143
153
* [Latest Xcode][12]
144
154
* [Xcode command-line tools][12]
145
155
* For Android development
146
-
* [JDK 8][JDK 8] or a later stable official release
147
-
* [Apache Ant 1.8][Apache Ant 1.8] or a later stable official release
148
-
* [Android SDK 19][Android SDK 19] or a later stable official release
156
+
* [JDK 8][JDK 8] or a later stable official release
157
+
* [Gradle 2.3][Gradle 2.3] or a later stable official release
158
+
* [Android SDK 21][Android SDK 21] or a later stable official release
159
+
* [Android SDK Build-tools 22.0.0][Android SDK Build-tools 22.0.0] or a later stable official release
160
+
* [Android Support Repository][Android Support Repository]
149
161
* (Optional) [Genymotion][Genymotion]
150
162
151
163
If you want to develop for Android, verify that you have added the following paths in your `PATH` in `~/.bash_profile`.
152
164
153
165
```
154
-
Path to the bin subdirectory in the Apache Ant installation directory
166
+
Path to the bin subdirectory in the Gradle installation directory
155
167
Path to the tools subdirectory in the Android SDK installation directory
156
168
Path to the platform-tools subdirectory in the Android SDK installation directory
If not present, create the following environment variables.
177
+
178
+
```
179
+
JAVA_HOME=Path to the jdk* install folder
180
+
```
181
+
182
+
For example: JAVA_HOME=/usr/bin/java
183
+
184
+
```
185
+
ANDROID_HOME=Path to Android installation directory
162
186
```
163
187
188
+
For example: ANDROID_HOME=/Applications/Android\ Studio.app/sdk/
189
+
164
190
## Linux
165
191
166
192
> On Linux systems, you can develop, build, and deploy NativeScript projects that target Android.
167
193
168
194
* Ubuntu 14.04 LTS
169
-
*[Node.js 0.10.26][Node.js 0.10.26] or a later stable official release
195
+
*[Node.js 0.10.35][Node.js 0.10.35] or a later stable official release
170
196
171
197
> **TIP:** You can follow the instructions provided [here](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager) to install Node.js on your system.
If not present, create the following environment variables.
231
+
232
+
```
233
+
JAVA_HOME=Path to the jdk* install folder
234
+
```
235
+
236
+
For example: JAVA_HOME=/usr/bin/java
237
+
238
+
```
239
+
ANDROID_HOME=Path to Android installation directory
200
240
```
201
241
242
+
For example: ANDROID_HOME=/home/user/android-sdk
243
+
202
244
[Back to Top][1]
203
245
204
246
Installation
@@ -263,7 +305,7 @@ Run `tns help` to view all available commands in the browser. Run `tns help <Com
263
305
*`library add <Platform> <Library Path>` adds a locally stored native library to the current project.
264
306
*`prepare <Platform>` copies cross-platform and selected platform-specific content to the subdirectory for the target platform.
265
307
*`build <Platform>` builds the project for the selected target platform.
266
-
*`emulate <Platform>` builds the project for the selected target platform and runs it in the native emulator, if configured.
308
+
*`emulate <Platform>` builds the project for the selected target platform and runs it in the native emulator, if configured.
267
309
*`deploy <Platform> [--device <Device ID>]` deploys an already built application on connected device.
268
310
*`run <Platform> [--device <Device ID>]` executes `prepare`, `build`, and `deploy`.
269
311
*`livesync <Platform>` synchronizes changes from your project to an already deployed application on device.
@@ -314,8 +356,8 @@ MyApp/
314
356
└── ...
315
357
```
316
358
317
-
* The `app` directory is the **development space for your application**. You should modify all common and platform-specific code within this directory. When you run `prepare <Platform>`, the NativeScript CLI copies relevant content to the platform-specific folders for each target platform.
318
-
* The `platforms` directory is created empty. When you add a target platform to your project, the NativeScript CLI creates a new subdirectory with the platform name. The subdirectory contains the ready-to-build resources of your app. When you run `prepare <Platform>`, the NativeScript CLI copies relevant content from the `app` directory to the platform-specific subdirectory for each target platform.<br/>In the `platforms` directory, you can safely modify configuration files such as `AndroidManifest.xml` and `Info.plist`.
359
+
* The `app` directory is the **development space for your application**. You should modify all common and platform-specific code within this directory. When you run `prepare <Platform>`, the NativeScript CLI copies relevant content to the platform-specific folders for each target platform.
360
+
* The `platforms` directory is created empty. When you add a target platform to your project, the NativeScript CLI creates a new subdirectory with the platform name. The subdirectory contains the ready-to-build resources of your app. When you run `prepare <Platform>`, the NativeScript CLI copies relevant content from the `app` directory to the platform-specific subdirectory for each target platform.<br/>In the `platforms` directory, you can safely modify configuration files such as `AndroidManifest.xml` and `Info.plist`.
319
361
320
362
[Back to Top][1]
321
363
@@ -330,7 +372,7 @@ tns platform add android
330
372
tns platform add ios
331
373
```
332
374
333
-
`platform add` creates the `android` and the `ios` subdirectories in the `platforms` directory. These subdirectories have the platform-specific project structure required for native development with the native SDKs for the platform.
375
+
`platform add` creates the `android` and the `ios` subdirectories in the `platforms` directory. These subdirectories have the platform-specific project structure required for native development with the native SDKs for the platform.
334
376
335
377
```
336
378
...
@@ -380,9 +422,9 @@ For more information about working with NativeScript, see the following resource
380
422
381
423
### Development in `app`
382
424
383
-
The `app` directory in the root of the project is the development space for your project. **Place all your common and platform-specific code in this directory.** When you run `prepare <Platform>`, the NativeScript CLI copies relevant content to the platform-specific folders for each target platform.
425
+
The `app` directory in the root of the project is the development space for your project. **Place all your common and platform-specific code in this directory.** When you run `prepare <Platform>`, the NativeScript CLI copies relevant content to the platform-specific folders for each target platform.
384
426
385
-
In the `app` directory, you can use **platform-specific files** to provide customized functionality and design for each target platform. To indicate that a file is platform-specific, make sure that the file name is in the following format: `name.ios.extension` or `name.android.extension`. For example: `main.ios.js` or `main.android.js`.
427
+
In the `app` directory, you can use **platform-specific files** to provide customized functionality and design for each target platform. To indicate that a file is platform-specific, make sure that the file name is in the following format: `name.ios.extension` or `name.android.extension`. For example: `main.ios.js` or `main.android.js`.
386
428
387
429
You can develop shared functionality or design in common files. To indicate that a file is common, make sure that the file name does not contain a `.android.` or `.ios.` string.
388
430
@@ -420,7 +462,7 @@ tns build android
420
462
tns build ios
421
463
```
422
464
423
-
The NativeScript CLI calls the SDK for the selected target platform and uses it to build your app locally.
465
+
The NativeScript CLI calls the SDK for the selected target platform and uses it to build your app locally.
424
466
425
467
When you build for Android, the NativeScript CLI saves the application package as an `APK` in `platforms`→`android`→`bin`.
426
468
@@ -450,7 +492,7 @@ tns deploy android
450
492
tns deploy ios
451
493
```
452
494
453
-
The NativeScript CLI calls the SDK for the selected target platform and uses it to build your app locally. After the build is complete, the NativeScript CLI downloads and installs the application package on your connected devices.
495
+
The NativeScript CLI calls the SDK for the selected target platform and uses it to build your app locally. After the build is complete, the NativeScript CLI downloads and installs the application package on your connected devices.
454
496
455
497
On Android devices, the app runs automatically.
456
498
@@ -473,7 +515,7 @@ This operation calls the SDK for the selected target platform, builds your app l
473
515
474
516
For Android, the NativeScript CLI runs your app in the earliest created virtual device or the currently running Android Virtual Device. Before running your app in the Android native emulator, make sure that you have configured at least one virtual device in the Android Virtual Device manager.
475
517
476
-
For iOS, the NativeScript CLI runs your app in the iOS Simulator.
518
+
For iOS, the NativeScript CLI runs your app in the iOS Simulator.
477
519
478
520
[Back to Top][1]
479
521
@@ -553,9 +595,9 @@ This software is licensed under the Apache 2.0 license, quoted <a href="LICENSE"
0 commit comments