diff --git a/docs/man_pages/lib-management/plugin.md b/docs/man_pages/lib-management/plugin.md index 89677429c2..f44f2e6a41 100644 --- a/docs/man_pages/lib-management/plugin.md +++ b/docs/man_pages/lib-management/plugin.md @@ -35,5 +35,5 @@ Command | Description [plugin remove](plugin-remove.html) | Uninstalls the specified plugin and its dependencies. [plugin update](plugin-update.html) | Updates the specified plugin(s) and its dependencies. [plugin build](plugin-build.html) | Builds the Android project of a NativeScript plugin, and updates the `include.gradle`. -[plugin create](plugin-create.html) | Builds the Android project of a NativeScript plugin, and updates the `include.gradle`. +[plugin create](plugin-create.html) | Creates a new project for NativeScript plugin development. <% } %> diff --git a/lib/controllers/run-controller.ts b/lib/controllers/run-controller.ts index 8b29bdfe0d..caee785a21 100644 --- a/lib/controllers/run-controller.ts +++ b/lib/controllers/run-controller.ts @@ -166,6 +166,7 @@ export class RunController extends EventEmitter implements IRunController { const debugOptions = deviceDescriptor.debugOptions || {}; liveSyncResultInfo.waitForDebugger = !!debugOptions.debugBrk; + liveSyncResultInfo.forceRefreshWithSocket = true; const refreshInfo = await this.refreshApplicationWithoutDebug(projectData, liveSyncResultInfo, filesChangeEventData, deviceDescriptor, { shouldSkipEmitLiveSyncNotification: true, shouldCheckDeveloperDiscImage: true }); diff --git a/lib/definitions/livesync.d.ts b/lib/definitions/livesync.d.ts index e4ac2c0d99..f729eabfa6 100644 --- a/lib/definitions/livesync.d.ts +++ b/lib/definitions/livesync.d.ts @@ -220,7 +220,8 @@ declare global { isFullSync: boolean; waitForDebugger?: boolean; deviceAppData: Mobile.IDeviceAppData; - didRecover?: boolean + didRecover?: boolean; + forceRefreshWithSocket?: boolean; } interface IAndroidLiveSyncResultInfo extends ILiveSyncResultInfo, IAndroidLivesyncSyncOperationResult { } diff --git a/lib/services/livesync/ios-device-livesync-service.ts b/lib/services/livesync/ios-device-livesync-service.ts index b8afcb8028..f82898cf4b 100644 --- a/lib/services/livesync/ios-device-livesync-service.ts +++ b/lib/services/livesync/ios-device-livesync-service.ts @@ -23,7 +23,11 @@ export class IOSDeviceLiveSyncService extends DeviceLiveSyncServiceBase implemen super(platformsDataService, device); } - private canRefreshWithNotification(projectData: IProjectData): boolean { + private canRefreshWithNotification(projectData: IProjectData, liveSyncInfo?: ILiveSyncResultInfo): boolean { + if (liveSyncInfo && liveSyncInfo.forceRefreshWithSocket) { + return false; + } + if (this.device.isEmulator) { return false; } @@ -72,7 +76,7 @@ export class IOSDeviceLiveSyncService extends DeviceLiveSyncServiceBase implemen shouldRestart = true; } else { const canExecuteFastSync = this.canExecuteFastSyncForPaths(liveSyncInfo, localToDevicePaths, projectData, deviceAppData.platform); - const isRefreshConnectionSetup = this.canRefreshWithNotification(projectData) || (!this.device.isOnlyWiFiConnected && await this.setupSocketIfNeeded(projectData)); + const isRefreshConnectionSetup = this.canRefreshWithNotification(projectData, liveSyncInfo) || (!this.device.isOnlyWiFiConnected && await this.setupSocketIfNeeded(projectData)); if (!canExecuteFastSync || !isRefreshConnectionSetup) { shouldRestart = true; } @@ -93,7 +97,7 @@ export class IOSDeviceLiveSyncService extends DeviceLiveSyncServiceBase implemen try { if (otherFiles.length) { - didRefresh = await this.refreshApplicationCore(projectData); + didRefresh = await this.refreshApplicationCore(projectData, liveSyncInfo); } } catch (e) { didRefresh = false; @@ -102,9 +106,9 @@ export class IOSDeviceLiveSyncService extends DeviceLiveSyncServiceBase implemen return didRefresh; } - private async refreshApplicationCore(projectData: IProjectData) { + private async refreshApplicationCore(projectData: IProjectData, liveSyncInfo: ILiveSyncResultInfo) { let didRefresh = true; - if (this.canRefreshWithNotification(projectData)) { + if (this.canRefreshWithNotification(projectData, liveSyncInfo)) { didRefresh = await this.refreshWithNotification(projectData); } else { if (await this.setupSocketIfNeeded(projectData)) {