Skip to content

Commit 476d689

Browse files
author
Dimitar Kerezov
committed
Update README.md
Remove obsolete information and add references to setup scripts. Update docs for running ps1 setup script from within PowerShell in order to avoid problems with PowerShell Execution policies. Change .NET download link to a more robust one.
1 parent 5b5a555 commit 476d689

File tree

2 files changed

+37
-10
lines changed

2 files changed

+37
-10
lines changed

README.md

+34-7
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ With the NativeScript CLI, you can target the following mobile platforms.
5959
System Requirements
6060
===
6161

62-
You can install and run the NativeScript CLI on Windows or OS X.
62+
You can install and run the NativeScript CLI on Windows, OS X or Linux.
6363

6464
* [Windows](#windows)
6565
* [OS X](#os-x)
@@ -69,6 +69,21 @@ You can install and run the NativeScript CLI on Windows or OS X.
6969

7070
> On Windows systems, you can develop, build, and deploy NativeScript projects that target Android.
7171
72+
### Setup Script
73+
To quickly set up your system for the latest NativeScript CLI, paste the following PowerShell script in the **Command Prompt** and hit `Enter`:
74+
```cmd
75+
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/NativeScript/nativescript-cli/production/setup/native-script.ps1'))"
76+
```
77+
78+
Alternatively, your can paste the following PowerShell setup script in a **Windows PowerShell console** and hit `Enter`:
79+
```PowerShell
80+
start-process -FilePath PowerShell.exe -Verb Runas -Wait -ArgumentList "-NoProfile -ExecutionPolicy Bypass -Command iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/NativeScript/nativescript-cli/production/setup/native-script.ps1'))"
81+
```
82+
> Both scripts require that you have **.NET 4.0 or later** installed on your system. You can download .NET 4.6.1 from this [link](http://go.microsoft.com/fwlink/?LinkId=671729).
83+
84+
85+
### Manual Setup
86+
7287
* Windows 7 SP1 or later
7388
* The latest Node.js [0.10.x](https://nodejs.org/dist/latest-v0.10.x/), [0.12.x](https://nodejs.org/dist/latest-v0.12.x/), [4.x](https://nodejs.org/dist/latest-v4.x/) or [5.x](https://nodejs.org/dist/latest-v5.x/) stable official release
7489
* (Optional) [Chocolatey][Chocolatey]
@@ -125,6 +140,14 @@ android update sdk --filter tools,platform-tools,android-23,build-tools-23.0.2,s
125140

126141
> On OS X systems, you can develop, build, and deploy NativeScript projects that target iOS and Android.
127142
143+
### Setup Script
144+
To quickly set up your system for the latest NativeScript CLI, paste the following Ruby script in the **Terminal** and hit `Enter`:
145+
```Shell
146+
sudo ruby -e "$(curl -fsSL https://raw.githubusercontent.com/NativeScript/nativescript-cli/production/setup/native-script.rb)"
147+
```
148+
149+
### Manual Setup
150+
128151
* OS X Mavericks
129152
* The latest Node.js [0.10.x](https://nodejs.org/dist/latest-v0.10.x/), [0.12.x](https://nodejs.org/dist/latest-v0.12.x/), [4.x](https://nodejs.org/dist/latest-v4.x/) or [5.x](https://nodejs.org/dist/latest-v5.x/) stable official release
130153
* For iOS development
@@ -325,7 +348,7 @@ MyApp/
325348
```
326349

327350
* 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.
328-
* 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`.
351+
* 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.
329352

330353
[Back to Top][1]
331354

@@ -398,9 +421,13 @@ You can develop shared functionality or design in common files. To indicate that
398421

399422
### Development in `platforms`
400423

401-
In `platforms`, you can safely modify files which are part of the native project structure and do not have a corresponding source located in the `app` directory in the root. For example, `AndroidManifest.xml` and `Info.plist`.
424+
> **IMPORTANT:** Avoid editing files located in the `platforms` subdirectory because the NativeScript CLI overrides such files during the `prepare <Platform>` using the contents of the `app` directory.
425+
426+
### Modifying Configuration Files
402427

403-
**Do not modify files and resources that have a corresponding file in the `app` directory in the root**, such as application scripts, icons, and splash screens. The NativeScript CLI overrides such files during the `prepare <Platform>` operation with the content from `app`.
428+
The NativeScript CLI respects any platform configuration files placed inside `app/App_Resources`. Those files are respectively `app/App_Resources/AndroidManifest.xml` for Android and `app/App_Resources/Info.plist` for iOS.
429+
430+
Additionaly, you can modify `app/App_Resources/build.xcconfig` and `app/App_Resources/app.gradle` for adding/removing additional build properties for iOS and Android, respectively.
404431

405432
[Back to Top][1]
406433

@@ -417,8 +444,6 @@ tns prepare ios
417444

418445
Keep in mind that `prepare` overrides changes made to the platform-specific subdirectory in `platforms`. For more information, see [Development in platforms](#development-in-platforms).
419446

420-
> **IMPORTANT:** Always run `prepare <Platform>` before running `build <Platform>`, `deploy <Platform>`, or `emulate <Platform>`. This ensures that the NativeScript CLI will build an application package with your latest code and resources.
421-
422447
[Back to Top][1]
423448

424449
## Build Your Project
@@ -434,7 +459,9 @@ The NativeScript CLI calls the SDK for the selected target platform and uses it
434459

435460
When you build for Android, the NativeScript CLI saves the application package as an `APK` in `platforms` &#8594; `android` &#8594; `bin`.
436461

437-
When you build for iOS, if the `--device` flag is not set, the NativeScript CLI builds your project for the native emulator and saves the application package as an `APP` in `platforms` &#8594; `ios` &#8594; `build` &#8594; `emulator`. If the `--device` flag is set, the NativeScript CLI builds your project for device and saves the application package as an `IPA` in `platforms` &#8594; `ios` &#8594; `build` &#8594; `device`.
462+
When you build for iOS, the NativeScript CLI will either build for a device, if there's a device attached, or for the native emulator if there are no devices attached. To trigger a native emulator build when a device is attached, set the `--emulator` flag.
463+
464+
The native emulator build is saved as an `APP` in `platforms` &#8594; `ios` &#8594; `build` &#8594; `emulator`. The device build is saved as an `IPA` in `platforms` &#8594; `ios` &#8594; `build` &#8594; `device`.
438465

439466
> **IMPORTANT:** To build your app for an iOS device, you must configure a valid certificate and provisioning profile pair, and have that pair present on your system for code signing your application package. For more information, see [iOS Code Signing - A Complete Walkthrough](http://seventhsoulmountain.blogspot.com/2013/09/ios-code-sign-in-complete-walkthrough.html).
440467

setup/native-script.ps1

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
# To run it inside a COMMAND PROMPT against the production branch (only one supported with self-elevation) use
55
# @powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/NativeScript/nativescript-cli/production/setup/native-script.ps1'))"
66
# To run it inside a WINDOWS POWERSHELL console against the production branch (only one supported with self-elevation) use
7-
# iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/NativeScript/nativescript-cli/production/setup/native-script.ps1'))
7+
# start-process -FilePath PowerShell.exe -Verb Runas -Wait -ArgumentList "-NoProfile -ExecutionPolicy Bypass -Command iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/NativeScript/nativescript-cli/production/setup/native-script.ps1'))"
88

99
# Check if latest .NET framework installed is at least 4
1010
$dotNetVersions = Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -recurse | Get-ItemProperty -name Version,Release -EA 0 | Where { $_.PSChildName -match '^(?!S)\p{L}'} | Select Version
1111
$latestDotNetVersion = $dotNetVersions.GetEnumerator() | Sort-Object Version | Select-Object -Last 1
1212
$latestDotNetMajorNumber = $latestDotNetVersion.Version.Split(".")[0]
1313
if ($latestDotNetMajorNumber -lt 4) {
1414
Write-Host -ForegroundColor Red "To run this script, you need .NET 4.0 or later installed"
15-
if ((Read-Host "Do you want to open Microsoft Download Center (y/n)") -eq 'y') {
16-
Start-Process -FilePath "https://www.microsoft.com/en-us/download/search.aspx?q=.net%20framework&p=0&r=10&t=&s=Relevancy~Descending"
15+
if ((Read-Host "Do you want to open .NET Framework 4.6.1 download page (y/n)") -eq 'y') {
16+
Start-Process -FilePath "http://go.microsoft.com/fwlink/?LinkId=671729"
1717
}
1818

1919
exit 1

0 commit comments

Comments
 (0)