简体   繁体   中英

How to reboot and factory reset iOS devices from my Mac app

For my current project, I need to develop a MAC application similar to Dr.Fone . Here muliple iOS devices (iPhone, iPad, iPod Touch) will be connected to a Mac with USB serial port. This app will will be able to do the followings

  • Collect basic information about the device. (Model, Capacity, UDID).
  • Factory reset of an connected iOS device.
  • Reboot the iOS device.
  • Run a custom test suite (Hardware Tests) on that device.

  • After a quick search over the web, I found libimobiledevice . There is not any option to factory reset an iOS device. Though libimobiledevice claims to reboot an iOS device using its idevicediagnostics tool, but got an issue similar to the following on iOS 10 device.

    在此输入图像描述

    I tried some library like PeerTalk to run the hardware test suite and it seems feasible to me.

    But I am still wandering to find out a way to do a factory reset and reboot a connected device. Can anyone help me to figure out how Dr.Fone is doing this?

    Dr.Fone Needs a firmware to do a Factory reset, the same way with imobiledevice with the command :

    idevicerestore -e path/to/firmaware.ipsw
    

    -e, --erase : perform a full restore, erasing all data (defaults to update)

    And about Collecting basic information about devices, Reboot the iOS device... it also has other tools to do what you looking for.

    To collect info you need to use idevice_id.exe for UDID and then use ideviceinfo -u udid for serial number and so on.

    ideviceenterrecovery will restart IOS device to recovery mode, there you can also use irecovery.exe to get all kinds info.

    As for factory reset, I don't think idevicerestore -e will do, it actually wipes out and restores entirely which is not something you want I assume.

    I had this same problem I ran

    sudo chmod -R 777 /var/db/lockdown/
    

    Then I get error code -3 when trying to restart the device

    Then ran

    brew uninstall ideviceinstaller
    brew uninstall libimobiledevice
    brew install --HEAD libimobiledevice
    brew install ideviceinstaller
    

    I disconnected/reconnected the device somewhere in this process and now I am able to run all the commands without getting the lockdownd error

    https://github.com/libimobiledevice/libimobiledevice/issues/391

    https://github.com/libimobiledevice/ideviceinstaller/issues/54

    The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

     
    粤ICP备18138465号  © 2020-2024 STACKOOM.COM