Added code to shutdown device if the device is already in booted state while erasing content and settings

[nit]: You are not using the return value. So you may just do
    simctlCmd.executeAndWait(false);