norman784 / libimobiledevice-node

A cross-platform software protocol library and tools to communicate with iOS® devices natively.
MIT License
25 stars 8 forks source link

Settings for iOS device back #1

Closed brandonhilkert closed 6 years ago

brandonhilkert commented 6 years ago

Thanks so much for porting this over! I'm really interested in using this. Do you happen to know the right combo of settings to take a backup?

I've tried what seems like every sane combination and can't get it to do anything. I've been able to get it to list out the devices, but can't get further.

Thanks!

norman784 commented 6 years ago

You could try to comment this line and install again the dependencies, and test with the binaries the backup, I've know that some people has issues installing all the dependencies, in those cases the library won't work, and if you could provide more information about the issue so I could try to figure it out and fix it.

Regards

brandonhilkert commented 6 years ago

hey @norman784 Thanks! I was able to get it to work with something like:

    libMobile.backup2({
      udid: [udid],
      backup: true,
      full: true,
      backup_directory: this.itunesBackupPath
    }, (err, data) => {
      log.error(err)
      log.info('first callback', data)
    }, progress => {
      log.info('progresss', progress)
    })

Do you happen to know what dictates whether a device is available via wifi? The backup works well when a device is plugged in via USB. I've found that open iTunes immediately makes my iPhone listed in the id() call, but it will no longer be included after a minute or so. My guess is iTunes did something when it opened to trigger something to search for all devices on the same network, but it's not clear to me how you'd get a device to be available without iTunes involved.

norman784 commented 6 years ago

I really don't know how the devices get listed, didn't check the deep into the source code.

I sometimes get listed devices over wifi, but without opening iTunes,info() also return the connected devices (also sometimes via wifi too) but I find id() more reliable in that case.

Did you try to backup a device connected via wifi? If so you could see the error message / code returned and prompt the user that the selected device need to be connected via usb to do the backup process, I don't really know another method to get rid of it, but this is something of the native library itself and not the node module, so you could check their github page and see if you find anything related to your question.

brandonhilkert commented 6 years ago

Makes sense, thanks for your thoughts. I figured you might have some deeper knowledge of the native lib, which is why I asked. Your recommendation to ask on their page makes sense.