how to factory reset the iPhone programmatically

I am developing an iPhone application, one of the features of this app is a factory reset the phone. I install this app from the windows desktop application by using libimobiledevice library, our application will not go for the AppStore, I didn't find any documentation to factory reset the iPhone. please give me a guide or documentation to factory reset the phone.
Answered by ad4nll in 612839022
Like Claude31 said this is not possible from within the app. The only option is to either utilize a 3rd party MDM like Jamf Pro, Meraki,
etc. or build a simple one yourself. The command you’re looking for is “EraseDevice”: https://developer.apple.com/documentation/devicemanagement/erase_a_device
That is not possible on a legal iPhone. Because that would let you erase content outside your app.
Accepted Answer
Like Claude31 said this is not possible from within the app. The only option is to either utilize a 3rd party MDM like Jamf Pro, Meraki,
etc. or build a simple one yourself. The command you’re looking for is “EraseDevice”: https://developer.apple.com/documentation/devicemanagement/erase_a_device
dear ad4nll

what do you suggest to me which one is better to buy service from Jamf Pro/ Merak or create my MDM server
how to factory reset the iPhone programmatically
 
 
Q