Skip to content

Commit 0284ae9

Browse files
committed
Merge branch 'master' into etabakov/remove-emulate-command
2 parents f17c5a6 + a1932ce commit 0284ae9

14 files changed

+205
-63
lines changed

README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,12 @@ The NativeScript CLI respects any platform configuration files placed inside `ap
257257

258258
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.
259259

260+
### Modifying Entitlements File (iOS only)
261+
262+
To specify which Capabilities are required by your App - Maps, Push Notifications, Wallet and etc. you can add or edit the `app.entitlements` file placed inside `app/App_Resources/iOS`. When building the project, the default `app/App_Resources/iOS/app.entitlements` file gets merged with all Plugins entitlement files and a new `yourAppName.entitlements` is created in the platforms directory. The path would be `app/platforms/ios/<application name>/<application name>.entitlements` and will be linked in the `build.xcconfig` file.
263+
264+
You can always override the generated entitlements file, by pointing to your own entitlements file by setting the `CODE_SIGN_ENTITLEMENTS` property in the `app/App_Resources/iOS/build.xcconfig` file.
265+
260266
[Back to Top][1]
261267

262268
## Prepare for Build
@@ -375,7 +381,7 @@ tns doctor
375381

376382
This command prints warnings about current configuration issues and provides basic information about how to resolve them.
377383

378-
If addressing the configuration issues does not resolve your problem, you can [report an issue](https://github.com/NativeScript/nativescript-cli/blob/master/CONTRIBUTING.md#report-an-issue) or [post in the NativeScript page in Google Groups](https://groups.google.com/forum/#!forum/nativescript).
384+
If addressing the configuration issues does not resolve your problem, you can [report an issue](https://github.com/NativeScript/nativescript-cli/blob/master/CONTRIBUTING.md#report-an-issue) or [post in the NativeScript forums](https://discourse.nativescript.org/).
379385

380386
[Back to Top][1]
381387

docs/man_pages/project/testing/debug-android.md

+18-23
Original file line numberDiff line numberDiff line change
@@ -3,51 +3,46 @@ debug android
33

44
Usage | Synopsis
55
---|---
6-
Deploy on device, run the app start Chrome DevTools, and attach the debugger | `$ tns debug android`
7-
Deploy on device, run the app and stop at the first code statement | `$ tns debug android --debug-brk [--device <Device ID>] [--debug-port <port>] [--timeout <timeout>]`
8-
Deploy in the native emulator, run the app and stop at the first code statement | `$ tns debug android --debug-brk --emulator [<Emulator Options>] [--timeout <timeout>]`
9-
Attach the debug tools to a running app on device | `$ tns debug android --start [--device <Device ID>] [--debug-port <port>] [--timeout <timeout>]`
10-
Attach the debug tools to a running app in the native emulator | `$ tns debug android --start --emulator [<Emulator Options>] [--timeout <timeout>]`
11-
Detach the debug tools | `$ tns debug android --stop`
6+
Deploy on device/emulator, run the app, follow generated link to use in Chrome Developer Tools, and attach the debugger | `$ tns debug android`
7+
Deploy on device/emulator, run the app and stop at the first code statement | `$ tns debug android --debug-brk [--device <Device ID>] [--timeout <timeout>]`
8+
Deploy in the native emulator, run the app and stop at the first code statement | `$ tns debug android --debug-brk --emulator [--timeout <timeout>]`
9+
Attach the debug tools to a running app on device/emulator | `$ tns debug android --start [--device <Device ID>] [--timeout <timeout>]`
10+
Attach the debug tools to a running app in the native emulator | `$ tns debug android --start --emulator [--timeout <timeout>]`
1211

1312
Prepares, builds and deploys the project when necessary. Debugs your project on a connected device or emulator.
14-
While debugging, prints the output from the application in the console and watches for changes in your code. Once a change is detected, it synchronizes the change with all selected devices and restarts/refreshes the application.
13+
While debugging, prints the output from the application in the console and watches for changes in your code. Once a change is detected, it synchronizes the change with the selected device and restarts the application.
1514

1615
### Options
17-
* `--device` - Specifies a connected device on which to debug the app.
18-
* `--emulator` - Specifies that you want to debug the app in the native Android emulator from the Android SDK.
19-
* `--debug-brk` - Prepares, builds and deploys the application package on a device or in an emulator, launches the Chrome DevTools of your Chrome browser and stops at the first code statement.
16+
* `--device` - Specifies a connected device/emulator on which to debug the app.
17+
* `--emulator` - Specifies that you want to debug the app in the native Android emulator.
18+
* `--debug-brk` - Prepares, builds and deploys the application package on a device/emulator, generates a link for Chrome Developer Tools and stops at the first code statement.
2019
* `--start` - Attaches the debug tools to a deployed and running app.
21-
* `--stop` - Detaches the debug tools.
22-
* `--debug-port` - Sets a new port on which to attach the debug tools.
23-
* `--timeout` - Sets the number of seconds that the NativeScript CLI will wait for the debugger to boot. If not set, the default timeout is 90 seconds.
20+
* `--timeout` - Sets the number of seconds that the NativeScript CLI will wait for the emulator/device to boot. If not set, the default timeout is 90 seconds.
2421
* `--no-watch` - If set, changes in your code will not be reflected during the execution of this command.
2522
* `--clean` - If set, forces rebuilding the native application.
2623

2724
### Attributes
28-
* `<Device ID>` is the index or name of the target device as listed by `$ tns device`
29-
* `<Port>` is an accessible port on the device to which you want to attach the debugging tools.
30-
* `<Emulator Options>` is any valid combination of options as listed by `$ tns help emulate android`
25+
* `<Device ID>` is the device identifier or name of the target device as listed by `$ tns device android`
3126

3227
<% if(isHtml) { %>
3328
### Prerequisites
3429

35-
* You must have Chrome installed on your system.<br/>If you are using a non-standard named Chrome app on an OS X system (for example, a nightly Canary update), you need to set this name in the `ANDROID_DEBUG_UI_MAC` setting in the NativeScript [config.json](file:///<%= #{config.getConfigPath(config)} %>).
30+
* You must have Chrome installed on your system.<br/>
31+
3632

3733
### Related Commands
3834

3935
Command | Description
4036
----------|----------
41-
[build android](build-android.html) | Builds the project for Android and produces an APK that you can manually deploy on device or in the native emulator.
42-
[build ios](build-ios.html) | Builds the project for iOS and produces an APP or IPA that you can manually deploy in the iOS Simulator or on device, respectively.
4337
[build](build.html) | Builds the project for the selected target platform and produces an application package that you can manually deploy on device or in the native emulator.
44-
[debug ios](debug-ios.html) | Debugs your project on a connected iOS device or in a native emulator.
38+
[build android](build-android.html) | Builds the project for Android and produces an APK that you can manually deploy on device or in the native emulator.
4539
[debug](debug.html) | Debugs your project on a connected device or in a native emulator.
40+
[debug ios](debug-ios.html) | Debugs your project on a connected iOS device or in a native emulator.
4641
[deploy](deploy.html) | Builds and deploys the project to a connected physical or virtual device.
47-
[run android](run-android.html) | Runs your project on a connected Android device or in a native Android emulator, if configured.
48-
[run ios](run-ios.html) | Runs your project on a connected iOS device or in the iOS Simulator, if configured.
42+
[device](../../device/device.html) | Lists all connected devices/emulators.
43+
[device android](../../device/device-android.html) | Lists all connected devices/emulators for android.
4944
[run](run.html) | Runs your project on a connected device or in the native emulator for the selected platform.
45+
[run android](run-android.html) | Runs your project on a connected Android device or in a native Android emulator, if configured.
5046
[test init](test-init.html) | Configures your project for unit testing with a selected framework.
5147
[test android](test-android.html) | Runs the tests in your project on Android devices or native emulators.
52-
[test ios](test-ios.html) | Runs the tests in your project on iOS devices or the iOS Simulator.
5348
<% } %>

docs/man_pages/project/testing/debug-ios.md

+20-21
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,38 @@ debug ios
33

44
Usage | Synopsis
55
---|---
6-
Deploy on device, run the app, start Safari Web Inspector and attach the debugger | `$ tns debug ios`
7-
Deploy on device, run the app and stop at the first code statement | `$ tns debug ios --debug-brk [--device <Device ID>] [--no-client]`
8-
Deploy in the iOS Simulator, run the app and stop at the first code statement | `$ tns debug ios --debug-brk --emulator [<Emulator Options>] [--no-client]`
9-
Attach the debug tools to a running app on device | `$ tns debug ios --start [--device <Device ID>] [--no-client]`
10-
Attach the debug tools to a running app in the iOS Simulator | `$ tns debug ios --start --emulator [<Emulator Options>] [--no-client]`
6+
Deploy on device/simulator, run the app, start Safari Web Inspector and attache the debugger | `$ tns debug ios`
7+
Deploy on device/simulator, run the app and stop at the first code statement | `$ tns debug ios --debug-brk [--device <Device ID>] [--no-client]`
8+
Deploy in the iOS simulator, run the app and stop at the first code statement | `$ tns debug ios --debug-brk --emulator [--no-client]`
9+
Attach the debug tools to a running app on specified device or simulator| `$ tns debug ios --start [--device <Device ID>] [--no-client]`
10+
Attach the debug tools to a running app in the iOS simulator | `$ tns debug ios --start --emulator [--no-client]`
1111

12-
Prepares, builds and deploys the project when necessary. Debugs your project on a connected device or in the iOS Simulator. <% if(isHtml) { %>Any debugging traffic is forwarded on port 8080 from the device to the local machine.<% } %>
13-
While debugging, prints the output from the application in the console and watches for changes in your code. Once a change is detected, it synchronizes the change with all selected devices and restarts/refreshes the application.
12+
Prepares, builds and deploys the project when necessary. Debugs your project on a connected device or in the iOS simulator. <% if(isHtml) { %>Any debugging traffic is forwarded to port 8080( or the next available one) from the device to the local machine.<% } %>
13+
While debugging, prints the output from the application in the console and watches for changes in your code. Once a change is detected, it synchronizes the change with the selected device and restarts the application.
1414

1515
<% if(isConsole && (isWindows || isLinux)) { %>WARNING: You can run this command only on OS X systems. To view the complete help for this command, run `$ tns help debug ios`<% } %>
1616

1717
<% if((isConsole && isMacOS) || isHtml) { %>
1818
<% if(isHtml) { %>> <% } %>IMPORTANT: Before building for iOS device, verify that you have configured a valid pair of certificate and provisioning profile on your OS X system. <% if(isHtml) { %>For more information, see [Obtaining Signing Identities and Downloading Provisioning Profiles](https://developer.apple.com/library/mac/recipes/xcode_help-accounts_preferences/articles/obtain_certificates_and_provisioning_profiles.html).<% } %>
1919

2020
### Options
21-
* `--device` - Specifies a connected device on which to run the app.
21+
* `--device` - Specifies a connected device or iOS simulator on which to run the app.
2222
* `--emulator` - Indicates that you want to debug your app in the iOS simulator.
23-
* `--debug-brk` - Prepares, builds and deploys the application package on a device or in an emulator, runs the app, launches the developer tools of your Safari browser and stops at the first code statement.
23+
* `--debug-brk` - Prepares, builds and deploys the application package on a device or in a simulator, runs the app, launches the developer tools of your Safari browser and stops at the first code statement.
2424
* `--start` - Attaches the debug tools to a deployed and running app and launches the developer tools of your Safari browser.
25-
* `--no-client` - If set, the NativeScript CLI attaches the debug tools but does not launch the developer tools in Safari.
26-
* `--timeout` - Sets the number of seconds that NativeScript CLI will wait for the debugger to boot. If not set, the default timeout is 90 seconds.
25+
* `--no-client` - If set, the NativeScript CLI attaches the debug tools but does not launch the developer tools in Safari. Could be used on already started Safari Web Inspector.
26+
* `--timeout` - Sets the number of seconds that NativeScript CLI will wait for the simulator/device to boot. If not set, the default timeout is 90 seconds.
2727
* `--no-watch` - If set, changes in your code will not be reflected during the execution of this command.
2828
* `--clean` - If set, forces rebuilding the native application.
29+
* `--chrome` - Allows debugging in Chrome Developer Tools. If set Safari Web Inspector is not started and debugging is attached to Chrome Developer Tools.
2930

3031
### Attributes
31-
* `<Device ID>` is the index or name of the target device as listed by `$ tns device`
32-
* `<Emulator Options>` is any valid combination of options as listed by `$ tns help emulate ios`
32+
* `<Device ID>` is the device identifier of the target device as listed by `$ tns device ios`
3333
<% } %>
3434
<% if(isHtml) { %>
3535
### Prerequisite
3636

37-
* If you want to debug in the iOS Simulator, you must have Xcode 6 or later installed on your system.
37+
* If you want to debug in the iOS simulator, you must have Xcode 6 or later installed on your system.
3838

3939
### Command Limitations
4040

@@ -44,16 +44,15 @@ While debugging, prints the output from the application in the console and watch
4444

4545
Command | Description
4646
----------|----------
47-
[build android](build-android.html) | Builds the project for Android and produces an APK that you can manually deploy on device or in the native emulator.
48-
[build ios](build-ios.html) | Builds the project for iOS and produces an APP or IPA that you can manually deploy in the iOS Simulator or on device, respectively.
4947
[build](build.html) | Builds the project for the selected target platform and produces an application package that you can manually deploy on device or in the native emulator.
50-
[debug android](debug-android.html) | Debugs your project on a connected Android device or in a native emulator.
48+
[build ios](build-ios.html) | Builds the project for iOS and produces an APP or IPA that you can manually deploy in the iOS simulator or on device, respectively.
5149
[debug](debug.html) | Debugs your project on a connected device or in a native emulator.
50+
[debug android](debug-android.html) | Debugs your project on a connected Android device or in a native emulator.
5251
[deploy](deploy.html) | Builds and deploys the project to a connected physical or virtual device.
53-
[run android](run-android.html) | Runs your project on a connected Android device or in a native Android emulator, if configured.
54-
[run ios](run-ios.html) | Runs your project on a connected iOS device or in the iOS Simulator, if configured.
52+
[device](../../device/device.html) | Lists all connected devices/emulators.
53+
[device ios](../../device/device-ios.html) | Lists all connected devices/simulators for iOS.
5554
[run](run.html) | Runs your project on a connected device or in the native emulator for the selected platform.
55+
[run ios](run-ios.html) | Runs your project on a connected iOS device or in the iOS simulator, if configured.
5656
[test init](test-init.html) | Configures your project for unit testing with a selected framework.
57-
[test android](test-android.html) | Runs the tests in your project on Android devices or native emulators.
58-
[test ios](test-ios.html) | Runs the tests in your project on iOS devices or the iOS Simulator.
57+
[test ios](test-ios.html) | Runs the tests in your project on iOS devices or the iOS simulator.
5958
<% } %>

docs/man_pages/project/testing/debug.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ Usage | Synopsis
55
---|---
66
<% if((isConsole && isMacOS) || isHtml) { %>General | `$ tns debug <Platform>`<% } %><% if(isConsole && (isLinux || isWindows)) { %>General | `$ tns debug android`<% } %>
77

8-
Debugs your project on a connected device or in a native emulator. <% if(isMacOS) { %>You must specify the target platform on which you want to debug.<% } %> The command will prepare, build and deploy the app when necessary. By default listens for changes in your code, synchronizes those changes and refreshes the selected device.
8+
Debugs your project on a connected device or in a native emulator. <% if(isMacOS) { %>You must specify the target platform on which you want to debug.<% } %> The command will prepare, build and deploy the app when necessary. By default listens for changes in your code, synchronizes those changes and restarts the app on the targeted device.
99

1010
<% if((isConsole && isMacOS) || isHtml) { %>### Attributes
11-
`<Platform>` is the target mobile platform for which you want to debug your project. You can set the following target platforms.
11+
`<Platform>` is the target mobile platform for which you want to debug your project. You can set the following target platforms:
1212
* `android` - Debugs your project on a connected Android device or Android emulator.
13-
* `ios` - Debugs your project on a connected iOS device or in a native iOS emulator.<% } %>
13+
* `ios` - Debugs your project on a connected iOS device or in a native iOS simulator.<% } %>
1414

1515
<% if(isHtml) { %>
1616
### Command Limitations

lib/nativescript-cli-lib-bootstrap.ts

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ $injector.requirePublicClass("deviceEmitter", "./common/appbuilder/device-emitte
1010
$injector.requirePublicClass("deviceLogProvider", "./common/appbuilder/device-log-provider");
1111
$injector.requirePublicClass("localBuildService", "./services/local-build-service");
1212
$injector.requirePublicClass("debugService", "./services/debug-service");
13-
$injector.require("iOSLogFilter", "./common/mobile/ios/ios-log-filter");
1413

1514
// We need this because some services check if (!$options.justlaunch) to start the device log after some operation.
1615
// We don't want this behaviour when the CLI is required as library.

lib/providers/livesync-provider.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export class LiveSyncProvider implements ILiveSyncProvider {
1010
private $childProcess: IChildProcess,
1111
private $options: IOptions) { }
1212

13-
private static FAST_SYNC_FILE_EXTENSIONS = [".css", ".xml"];
13+
private static FAST_SYNC_FILE_EXTENSIONS = [".css", ".xml", ".html"];
1414

1515
private deviceSpecificLiveSyncServicesCache: IDictionary<any> = {};
1616
public get deviceSpecificLiveSyncServices(): IDictionary<any> {

lib/services/ios-log-filter.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ import { cache } from "../common/decorators";
44
import * as iOSLogFilterBase from "../common/mobile/ios/ios-log-filter";
55

66
export class IOSLogFilter extends iOSLogFilterBase.IOSLogFilter implements Mobile.IPlatformLogFilter {
7-
protected infoFilterRegex = /^.*?(<Notice>:.*?((CONSOLE LOG|JS ERROR).*?)|(<Warning>:.*?)|(<Error>:.*?))$/im;
7+
protected infoFilterRegex = /^.*?(<Notice>:.*?(((?:CONSOLE|JS) (?:LOG|ERROR)).*?))$/im;
88

99
private partialLine: string = null;
1010

1111
constructor($loggingLevels: Mobile.ILoggingLevels,
1212
private $fs: IFileSystem,
1313
private $projectData: IProjectData) {
14-
super($loggingLevels);
15-
}
14+
super($loggingLevels);
15+
}
1616

1717
public filterData(data: string, logLevel: string, pid?: string): string {
18-
data = super.filterData(data, logLevel, pid);
18+
data = super.filterData(data, logLevel, pid);
1919
if (pid && data && data.indexOf(`[${pid}]`) === -1) {
2020
return null;
2121
}

lib/services/ios-project-service.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,8 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
329329

330330
// build only for device specific architecture
331331
if (!buildConfig.release && !buildConfig.architectures) {
332-
await this.$devicesService.initialize({ platform: this.$devicePlatformsConstants.iOS.toLowerCase(), deviceId: buildConfig.device });
332+
await this.$devicesService.initialize({ platform: this.$devicePlatformsConstants.iOS.toLowerCase(), deviceId: buildConfig.device,
333+
isBuildForDevice: true });
333334
let instances = this.$devicesService.getDeviceInstances();
334335
let devicesArchitectures = _(instances)
335336
.filter(d => this.$mobileHelper.isiOSPlatform(d.deviceInfo.platform) && d.deviceInfo.activeArchitecture)

0 commit comments

Comments
 (0)