Conversation
a0904aa to
97cbce9
Compare
Mitko-Kerezov
left a comment
There was a problem hiding this comment.
Please fix relevant comments
| ] | ||
| */ | ||
| const mappedApps = _.map(applicationsOnDevice, app => { | ||
| return { |
There was a problem hiding this comment.
You can use the short syntax here:
_.map(applicationsOnDevice, app => ({
applicationIdentifier: app.CFBundleIdentifier,
isLiveSyncSupported: app.IceniumLiveSyncEnabled,
configuration: app.configuration,
deviceIdentifier: this.device.deviceInfo.identifier
}));| })); | ||
| this.applicationsLiveSyncInfos = this.applicationsLiveSyncInfos.concat(currentList); | ||
| }); | ||
| this.applicationsLiveSyncInfos = this.applicationsLiveSyncInfos.concat(mappedApps); |
There was a problem hiding this comment.
Since you're setting this.applicationsLiveSyncInfos = [] 10 rows above, IMO there's no need to concat here.
You can skip this.applicationsLiveSyncInfos = [] from above and just reassign here:
this.applicationsLiveSyncInfos = mappedApps;
| public async startApplication(appIdentifier: string): Promise<void> { | ||
| if (this.$hostInfo.isWindows && !this.$staticConfig.enableDeviceRunCommandOnWindows) { | ||
| this.$errors.fail("$%s device run command is not supported on Windows for iOS devices.", this.$staticConfig.CLIENT_NAME.toLowerCase()); | ||
| // this.$errors.fail("$%s device run command is not supported on Windows for iOS devices.", this.$staticConfig.CLIENT_NAME.toLowerCase()); |
There was a problem hiding this comment.
I believe we need it.
| try { | ||
| await settlePromises(await this.$iosDeviceOperations.uploadFiles(filesToUpload)); | ||
| } catch (err) { | ||
| if (err.deviceId === this.device.deviceInfo.identifier) { |
There was a problem hiding this comment.
settlePromises alters the thrown error, so you won't get an object that has a deviceId in the catch clause
| } | ||
| } | ||
|
|
||
| @cache() |
There was a problem hiding this comment.
I don't think we should @cache this - what if we want to start a second device log (e.g. we have two devices attached)
mobile/ios/device/ios-device.ts
Outdated
| import * as net from "net"; | ||
|
|
||
| export class IOSDevice implements Mobile.IiOSDevice { | ||
| // iOS errors are described here with HEX representation |
There was a problem hiding this comment.
IMO you can delete those comments too - they're no longer relevant
mobile/ios/device/ios-device.ts
Outdated
|
|
||
| public async openDeviceLogStream(): Promise<void> { | ||
| if (this.deviceInfo.status !== constants.UNREACHABLE_STATUS) { | ||
| await this.$iosDeviceOperations.startDeviceLog(this.deviceInfo.identifier, (data: string) => { |
There was a problem hiding this comment.
There's no need to await this - it doesn't return a Promise
rosen-vladimirov
left a comment
There was a problem hiding this comment.
The title says: Remove ios native dependencies
However the PR just adds dependency in package.json. Shouldn't we actually delete the native dependencies from package.json?
| this.$logger.trace(`Error while uninstalling application ${e}.`); | ||
| } | ||
| await this.$iosDeviceOperations.uninstall(appIdentifier, [this.device.deviceInfo.identifier], (err: IDeviceOperationError) => { | ||
| this.$logger.warn(`Failed to uninstall install ${appIdentifier} on device with identifier ${err.deviceIdentifier}`); |
There was a problem hiding this comment.
which operation failed - unisntall or install ?
|
|
||
| public async execute(args: string[]): Promise<void> { | ||
| await this.$devicesService.initialize({ deviceId: this.$options.device, skipInferPlatform: true }); | ||
| let appIdentifier = args[1]; |
There was a problem hiding this comment.
as we modify the command, shouldn't we delete the $options.app that has been used before (not in the command itself, but in the service behind it. If I understand correctly, we'll support getting of file only from application sandbox, so the $options.app is a mandatory argument now. So... let's remove $options.app
| public async startApplication(appIdentifier: string): Promise<void> { | ||
| if (this.$hostInfo.isWindows && !this.$staticConfig.enableDeviceRunCommandOnWindows) { | ||
| this.$errors.fail("$%s device run command is not supported on Windows for iOS devices.", this.$staticConfig.CLIENT_NAME.toLowerCase()); | ||
| // this.$errors.fail("$%s device run command is not supported on Windows for iOS devices.", this.$staticConfig.CLIENT_NAME.toLowerCase()); |
There was a problem hiding this comment.
I believe we need it.
c752b38 to
99e1148
Compare
cda297e to
f06b56e
Compare
|
related issue: NativeScript/nativescript-cli#2562 |
f06b56e to
eaec133
Compare
8ebc7b9 to
a82b75c
Compare
We need to remove our native dependencies - ref and ffi because they are casuing problems with each version of NodeJS which has new version of V8 in it. We are using ref and ffi to communicate with iTunes and execute fs and application management operations on iOS devices. This operations are moved in new dependency - device-lib. The device lib has JavaScript wrapper which we use in the CLI. Everything in the ios device file system and ios device application manager is replaced with the exposed methods from the device lib.
f978b57 to
741a91d
Compare
f2d2993 to
220a852
Compare
Since we use the ios-device-lib to connect to the device backend port for debugging, the socket returned from the device can be used only in the ios-device lib. That's why we need to change the logic for creating the Node.js socket in the CLI. The ios-device-lib will expose the device socket on a specific port in the localhost. After we connect to the exposed socket we can continue to work like we used to.
220a852 to
cfd19f2
Compare
|
💔 |
|
run ci |
|
❤️ |
802b22c to
32ecf38
Compare
|
❤️ |
We need to remove our native dependencies - ref and ffi because they are casuing problems with each version of NodeJS which has new version of V8 in it. We are using ref and ffi to communicate with iTunes and execute fs and application management operations on iOS devices. This operations are moved in new dependency - device-lib. The device lib has JavaScript wrapper which we use in the CLI. Everything in the ios device file system and ios device application manager is replaced with the exposed methods from the device lib.