Skip to content

Commit f9766bd

Browse files
authored
Merge pull request #4778 from NativeScript/fatme/fix-hmr-fail-ios-device
fix: fix "Could not open file Library/Application Support/LiveSync/app/tns_modules/tns-core-modules/inspector_modules.js for writing" error on iOS device when hmr fails
2 parents 98b14da + 61ca753 commit f9766bd

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

lib/services/livesync/ios-livesync-service.ts

+3-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as temp from "temp";
33

44
import { IOSDeviceLiveSyncService } from "./ios-device-livesync-service";
55
import { PlatformLiveSyncServiceBase } from "./platform-livesync-service-base";
6-
import { APP_FOLDER_NAME, TNS_MODULES_FOLDER_NAME } from "../../constants";
6+
import { APP_FOLDER_NAME } from "../../constants";
77
import { performanceLog } from "../../common/decorators";
88

99
export class IOSLiveSyncService extends PlatformLiveSyncServiceBase implements IPlatformLiveSyncService {
@@ -30,14 +30,10 @@ export class IOSLiveSyncService extends PlatformLiveSyncServiceBase implements I
3030

3131
temp.track();
3232
const tempZip = temp.path({ prefix: "sync", suffix: ".zip" });
33-
const tempApp = temp.mkdirSync("app");
3433
this.$logger.trace("Creating zip file: " + tempZip);
35-
this.$fs.copyFile(path.join(path.dirname(projectFilesPath), `${APP_FOLDER_NAME}/*`), tempApp);
3634

37-
this.$fs.deleteDirectory(path.join(tempApp, TNS_MODULES_FOLDER_NAME));
38-
39-
await this.$fs.zipFiles(tempZip, this.$fs.enumerateFilesInDirectorySync(tempApp), (res) => {
40-
return path.join(APP_FOLDER_NAME, path.relative(tempApp, res));
35+
await this.$fs.zipFiles(tempZip, this.$fs.enumerateFilesInDirectorySync(projectFilesPath), (res) => {
36+
return path.join(APP_FOLDER_NAME, path.relative(projectFilesPath, res));
4137
});
4238

4339
await device.fileSystem.transferFiles(deviceAppData, [{

0 commit comments

Comments
 (0)