diff --git a/plugins/idea/src/main/java/org/robovm/idea/running/RoboVmIOSRunConfigurationSettingsEditor.java b/plugins/idea/src/main/java/org/robovm/idea/running/RoboVmIOSRunConfigurationSettingsEditor.java index e6ae51750..38ef3fb07 100755 --- a/plugins/idea/src/main/java/org/robovm/idea/running/RoboVmIOSRunConfigurationSettingsEditor.java +++ b/plugins/idea/src/main/java/org/robovm/idea/running/RoboVmIOSRunConfigurationSettingsEditor.java @@ -30,7 +30,6 @@ import org.robovm.compiler.target.ios.ProvisioningProfile; import org.robovm.compiler.target.ios.SigningIdentity; import org.robovm.compiler.util.InfoPList; -import org.robovm.compiler.util.PList; import org.robovm.idea.RoboVmPlugin; import org.robovm.idea.running.RoboVmRunConfiguration.EntryType; import org.robovm.libimobiledevice.IDevice; @@ -194,7 +193,8 @@ protected void applyEditorTo(@NotNull RoboVmRunConfiguration config) throws Conf config.setSigningIdentity(Decorator.from(signingIdentity).id); config.setProvisioningProfileType(Decorator.from(provisioningProfile).entryType); config.setProvisioningProfile(Decorator.from(provisioningProfile).id); - config.setTargetDeviceUDID(Decorator.from(targetDeviceUDID).id); + // TargetDeviceUDID is optional + config.setTargetDeviceUDID(Decorator.idOrNullFrom(targetDeviceUDID)); // simulator related config.setSimulatorArch((CpuArch) simArch.getSelectedItem()); config.setSimulatorType(Decorator.from(simType).entryType); @@ -816,6 +816,15 @@ static Decorator from(JComboBox> cb) { //noinspection unchecked return (Decorator) cb.getSelectedItem(); } + + /** + * @return id from decorator if it presents + */ + static String idOrNullFrom(JComboBox> cb) { + //noinspection unchecked + Decorator decorator = (Decorator) cb.getSelectedItem(); + return decorator != null ? decorator.id : null; + } } /**