I need to install a .mobileconfig file into iPhone as a profile, similar to how AppleConfigurator does it but I don't own a MAC. I don't know where it default installs to, should there be options included? The goal is to skip the Setup Assistant that takes place with each newly erased phone.
ReadOnlyCollection<string> udids;
int count = 0;
var idevice = LibiMobileDevice.Instance.iDevice;
var lockdown = LibiMobileDevice.Instance.Lockdown;
var ret = idevice.idevice_get_device_list(out udids, ref count);
if (ret == iDeviceError.NoDevice)
{
return;
}
ret.ThrowOnError();
// Get the device serial
foreach (var udid in udids)
{
LockdownClientHandle lockdownHandle;
iDeviceHandle deviceHandle;
LockdownServiceDescriptorHandle ldsHandle;
idevice.idevice_new(out deviceHandle, udid).ThrowOnError();
lockdown.lockdownd_client_new_with_handshake(deviceHandle, out
lockdownHandle, "Quamotion").ThrowOnError();
InstallationProxyClientHandle ipc;
lockdown.lockdownd_start_service(lockdownHandle,
"com.apple.mobile.installation_proxy", out ldsHandle);
ldsHandle.Api.InstallationProxy.instproxy_client_new(deviceHandle,
ldsHandle, out ipc);
ldsHandle.Api.InstallationProxy.instproxy_install(ipc,
@"C:\configFile.mobileconfig",PlistHandle.Zero,Callback,IntPtr.Zero);
}