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
+95-38Lines changed: 95 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 0.x 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,78 @@ 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.
145
+
146
+
> NOTE: You can install required Android Tools with the following command:
> On Linux systems, you can develop, build, and deploy NativeScript projects that target Android.
167
203
168
204
* Ubuntu 14.04 LTS
169
-
*[Node.js 0.10.26][Node.js 0.10.26] or a later stable official release
205
+
*[Node.js 0.10.35][Node.js 0.10.35] or a later stable 0.x release
170
206
171
207
> **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.
@@ -263,7 +320,7 @@ Run `tns help` to view all available commands in the browser. Run `tns help <Com
263
320
*`library add <Platform> <Library Path>` adds a locally stored native library to the current project.
264
321
*`prepare <Platform>` copies cross-platform and selected platform-specific content to the subdirectory for the target platform.
265
322
*`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.
323
+
*`emulate <Platform>` builds the project for the selected target platform and runs it in the native emulator, if configured.
267
324
*`deploy <Platform> [--device <Device ID>]` deploys an already built application on connected device.
268
325
*`run <Platform> [--device <Device ID>]` executes `prepare`, `build`, and `deploy`.
269
326
*`livesync <Platform>` synchronizes changes from your project to an already deployed application on device.
@@ -314,8 +371,8 @@ MyApp/
314
371
└── ...
315
372
```
316
373
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`.
374
+
* 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.
375
+
* 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
376
320
377
[Back to Top][1]
321
378
@@ -330,7 +387,7 @@ tns platform add android
330
387
tns platform add ios
331
388
```
332
389
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.
390
+
`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
391
335
392
```
336
393
...
@@ -380,9 +437,9 @@ For more information about working with NativeScript, see the following resource
380
437
381
438
### Development in `app`
382
439
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.
440
+
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
441
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`.
442
+
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
443
387
444
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
445
@@ -420,7 +477,7 @@ tns build android
420
477
tns build ios
421
478
```
422
479
423
-
The NativeScript CLI calls the SDK for the selected target platform and uses it to build your app locally.
480
+
The NativeScript CLI calls the SDK for the selected target platform and uses it to build your app locally.
424
481
425
482
When you build for Android, the NativeScript CLI saves the application package as an `APK` in `platforms`→`android`→`bin`.
426
483
@@ -450,7 +507,7 @@ tns deploy android
450
507
tns deploy ios
451
508
```
452
509
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.
510
+
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
511
455
512
On Android devices, the app runs automatically.
456
513
@@ -473,7 +530,7 @@ This operation calls the SDK for the selected target platform, builds your app l
473
530
474
531
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
532
476
-
For iOS, the NativeScript CLI runs your app in the iOS Simulator.
533
+
For iOS, the NativeScript CLI runs your app in the iOS Simulator.
477
534
478
535
[Back to Top][1]
479
536
@@ -553,9 +610,9 @@ This software is licensed under the Apache 2.0 license, quoted <a href="LICENSE"
0 commit comments