Skip to content

Commit 602f450

Browse files
Merge pull request NativeScript#4967 from NativeScript/tachev/wifi-sync
feat: support LiveSync to Wi-Fi devices
2 parents 5ea6e8d + ccf2b84 commit 602f450

30 files changed

+1476
-1253
lines changed

lib/common/commands/device/list-devices.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { createTable, formatListOfNames } from "../../helpers";
2+
import { DeviceConnectionType } from "../../../constants";
23

34
export class ListDevicesCommand implements ICommand {
45
constructor(private $devicesService: Mobile.IDevicesService,
@@ -25,9 +26,9 @@ export class ListDevicesCommand implements ICommand {
2526

2627
this.$logger.info("\nConnected devices & emulators");
2728
let index = 1;
28-
await this.$devicesService.initialize({ platform: args[0], deviceId: null, skipInferPlatform: true, skipDeviceDetectionInterval: true, skipEmulatorStart: true });
29+
await this.$devicesService.initialize({ platform: args[0], deviceId: null, skipInferPlatform: true, skipDeviceDetectionInterval: true, skipEmulatorStart: true, fullDiscovery: true });
2930

30-
const table: any = createTable(["#", "Device Name", "Platform", "Device Identifier", "Type", "Status"], []);
31+
const table: any = createTable(["#", "Device Name", "Platform", "Device Identifier", "Type", "Status", "Connection Type"], []);
3132
let action: (_device: Mobile.IDevice) => Promise<void>;
3233
if (this.$options.json) {
3334
action = async (device) => {
@@ -37,7 +38,8 @@ export class ListDevicesCommand implements ICommand {
3738
action = async (device) => {
3839
table.push([(index++).toString(), device.deviceInfo.displayName || '',
3940
device.deviceInfo.platform || '', device.deviceInfo.identifier || '',
40-
device.deviceInfo.type || '', device.deviceInfo.status || '']);
41+
device.deviceInfo.type || '', device.deviceInfo.status || '',
42+
device.deviceInfo.connectionTypes.map(type => DeviceConnectionType[type]).join(", ")]);
4143
};
4244
}
4345

lib/common/constants.ts

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export class HmrConstants {
4444

4545
export class DeviceDiscoveryEventNames {
4646
static DEVICE_FOUND = "deviceFound";
47+
static DEVICE_UPDATED = "deviceUpdated";
4748
static DEVICE_LOST = "deviceLost";
4849
}
4950

@@ -55,6 +56,7 @@ export class EmulatorDiscoveryNames {
5556
export const DEVICE_LOG_EVENT_NAME = "deviceLogData";
5657
export const IOS_LOG_PREDICATE = 'senderImagePath contains "NativeScript" || eventMessage contains[c] "NativeScript"';
5758
export const IOS_APP_CRASH_LOG_REG_EXP = /Fatal JavaScript exception \- application has been terminated/;
59+
export const FAIL_LIVESYNC_LOG_REGEX = /Failed to refresh the application with RefreshRequest./;
5860

5961
export const TARGET_FRAMEWORK_IDENTIFIERS = {
6062
Cordova: "Cordova",

0 commit comments

Comments
 (0)