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
@@ -768,6 +775,33 @@ tns.liveSyncService.liveSync([ androidDeviceDescriptor, iOSDeviceDescriptor ], l
768
775
});
769
776
```
770
777
778
+
### liveSyncToPreviewApp
779
+
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.
780
+
781
+
* Definition
782
+
```TypeScript
783
+
/**
784
+
* Starts LiveSync operation by producting a QR code and starting watcher.
785
+
* @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).
1343
1377
1378
+
## previewDevicesService
1379
+
The `previewDevicesService` module allows interaction with preview devices. You can get a list of the connected preview devices and logs from specified device.
1380
+
1381
+
### previewDevicesEmitterEvents
1382
+
1383
+
* `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);
1396
+
});
1397
+
```
1398
+
1399
+
* `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.
1409
+
1410
+
### getPlaygroundAppQrCode
1411
+
Returns information used to generate the QR code of the Playground app.
1412
+
1413
+
* Usage:
1414
+
```TypeScript
1415
+
tns.previewQrCodeService.getPlaygroundAppQrCode()
1416
+
.then(result=> {
1417
+
console.log("QR code data for iOS platform: "+result.ios);
1418
+
console.log("QR code data for Android platform: "+result.android);
1419
+
});
1420
+
```
1421
+
1344
1422
## How to add a new method to Public API
1345
1423
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.
1346
1424
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`.
0 commit comments