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
*[Fixed #4189](https://github.com/NativeScript/nativescript-cli/pull/4189): API: Fix "Cannot read property 'removeListener' of undefined" error on second stop of livesync to preview app
8
+
9
+
10
+
5.0.2 (2018, November 29)
11
+
==
12
+
### Implemented
13
+
*[Implemented #4167](https://github.com/NativeScript/nativescript-cli/pull/4167): API: Expose previewAppLiveSyncError event when some error is thrown while livesyncing to preview app
14
+
15
+
### Fixed
16
+
*[Fixed #3962](https://github.com/NativeScript/nativescript-cli/issues/3962): If command 'tns plugin create .. ' failed , directory with plugin repository name must be deleted
17
+
*[Fixed #4053](https://github.com/NativeScript/nativescript-cli/issues/4053): Update Nativescript cli setup scripts to use android sdk 28
18
+
*[Fixed #4077](https://github.com/NativeScript/nativescript-cli/issues/4077): Platform add with framework path and custom version breaks run with "--bundle"
*[Fixed #4135](https://github.com/NativeScript/nativescript-cli/issues/4135): Too many TypeScript "Watching for file changes" messages in console during build
21
+
*[Fixed #4158](https://github.com/NativeScript/nativescript-cli/pull/4158): API: reset devices list when stopLiveSync method is called
22
+
*[Fixed #4161](https://github.com/NativeScript/nativescript-cli/pull/4161): API: raise deviceLost event after timeout of 5 seconds
@@ -779,6 +786,33 @@ tns.liveSyncService.liveSync([ androidDeviceDescriptor, iOSDeviceDescriptor ], l
779
786
});
780
787
```
781
788
789
+
### liveSyncToPreviewApp
790
+
Starts a LiveSync operation to the Preview app. After scanning the QR code with the scanner provided in the NativeScript Playground app, the app will be launched on a device through the Preview app. Additionally, any changes made to the project will be automatically synchronized with the deployed app.
791
+
792
+
* Definition
793
+
```TypeScript
794
+
/**
795
+
* Starts LiveSync operation by producting a QR code and starting watcher.
796
+
* @param{IPreviewAppLiveSyncData}liveSyncData Describes the LiveSync operation - for which project directory is the operation and other settings.
`emulatorImageInfo` is of type [Moble.IDeviceInfo](https://github.com/telerik/mobile-cli-lib/blob/61cdaaaf7533394afbbe84dd4eee355072ade2de/definitions/mobile.d.ts#L9-L86).
1354
1388
1389
+
## previewDevicesService
1390
+
The `previewDevicesService` module allows interaction with preview devices. You can get a list of the connected preview devices and logs from specified device.
1391
+
1392
+
### previewDevicesEmitterEvents
1393
+
1394
+
* `deviceFound` - Raised when the QR code is scanned with any device. The callback function will receive one argument - `device`.
console.log("Detached device with identifier: "+device.id);
1407
+
});
1408
+
```
1409
+
1410
+
* `deviceLog` - Raised when the app deployed in Preview app reports any information. The event is raised for any device that reports data. The callback function has two arguments - `device` and `message`. <br/><br/>
The `previewQrCodeService` exposes methods for getting information about the QR of the Playground app and deployed app in Preview app.
1420
+
1421
+
### getPlaygroundAppQrCode
1422
+
Returns information used to generate the QR code of the Playground app.
1423
+
1424
+
* Usage:
1425
+
```TypeScript
1426
+
tns.previewQrCodeService.getPlaygroundAppQrCode()
1427
+
.then(result=> {
1428
+
console.log("QR code data for iOS platform: "+result.ios);
1429
+
console.log("QR code data for Android platform: "+result.android);
1430
+
});
1431
+
```
1432
+
1355
1433
## How to add a new method to Public API
1356
1434
CLI is designed as command line tool and when it is used as a library, it does not give you access to all of the methods. This is mainly implementation detail. Most of the CLI's code is created to work in command line, not as a library, so before adding method to public API, most probably it will require some modification.
1357
1435
For example the `$options` injected module contains information about all `--` options passed on the terminal. When the CLI is used as a library, the options are not populated. Before adding method to public API, make sure its implementation does not rely on `$options`.
this.$logger.printMarkdown("Make sure your custom template is compatible with the Plugin Seed at https://github.com/NativeScript/nativescript-plugin-seed/");
78
90
}else{
@@ -84,9 +96,6 @@ export class CreatePluginCommand implements ICommand {
0 commit comments