Error:Could not find a device to launch. You requested 'iOS (iOS)', but the available devices were: ["iPad 2 (9.2)

Mac 10.11 Appium 1.4.13 iOSSDK 9.2 using Java in Eclipse, JDK1.8
real device: ipad2 ios9.0
Connect with Appium GUI app successfully without any problem, can run my test as well
But using below code, the error occurs

code: public void startServer() throws Exception{
service=AppiumDriverLocalService.buildService(new AppiumServiceBuilder()
.usingDriverExecutable(new File("/Applications/Appium.app/Contents/Resources/node/bin//node"))
.withAppiumJS(new File("/Applications/Appium.app/Contents/Resources/node_modules/appium/bin//appium.js"))
.withIPAddress(“127.0.0.1”)
.usingPort(4723));
IOSDriver driver=getIOSDriver();
}

IOSDriver getIOSDriver() throws Exception {
	 String path=System.getProperty("user.dir");
	 String file=path+File.separator+"ConfigInfo.xml";
	 log.info("Configuration XML path= "+file+" reading xml begin...");	        
	 /**********For device*********/
	 DesiredCapabilities capabilities = new DesiredCapabilities();
	 capabilities.setCapability(CapabilityType.BROWSER_NAME, getElement.getXMLElement("iOStype", file));
	 capabilities.setCapability("platformName", getElement.getXMLElement("platformname", file));
	 capabilities.setCapability("deviceName", getElement.getXMLElement("devicename", file));
	 capabilities.setCapability("platformVersion", getElement.getXMLElement("platformversion", file));
	 capabilities.setCapability("appium-version", getElement.getXMLElement("appiumversion", file));
	 capabilities.setCapability("app",getElement.getXMLElement("iOSdevicemtbuildpath", file));
	 //capabilities.setCapability("language","es");
	 // support Chinese
	 capabilities.setCapability("unicodeKeyboard", "True");
	 capabilities.setCapability("resetKeyboard", "True");
	 //driveriOS = new IOSDriver (new URL("http://127.0.0.1:4723/wd/hub"),capabilities);
	 driveriOS=new IOSDriver(service,capabilities);

	return driveriOS;
}

Error log:A new session could not be created. (Original error: Could not find a device to launch. You requested ‘iOS (iOS)’, but the available devices were: [“iPad 2 (9.2) [1B9BF425-8813-462B-8120-B7B4B192472D]”,“iPad Air (9.2) [D5ED2CBF-C3D8-40C8-BA77-6D3EEC6357DB]”,“iPad Air 2 (9.2) [29075D43-6103-43EC-9854-D19ABF1A4153]”,“iPad Pro (9.2) [FB05B096-B616-413A-8922-4B8BB3AD3F55]”,“iPad Retina (9.2) [89322C95-227D-4D6D-AC31-4C4D7054C84E]”,“iPhone 4s (9.2) [87EFAE6D-4F19-42D7-BD0A-9C37934AD1DF]”,“iPhone 5 (9.2) [17739CC5-A71D-4FC0-BE01-95793F4AAD5D]”,“iPhone 5s (9.2) [0F981E74-698D-446F-88C7-8289B12D4874]”,“iPhone 6 (9.2) [E5C6BD73-77A2-40AC-A034-11258BD10697]”,“iPhone 6 Plus (9.2) [0DA4BFDF-8579-4F93-A6E7-F73B01BC644A]”,“iPhone 6s (9.2) [5DCA52CD-7C6C-4FC5-83FD-BD9C763087EA]”,“iPhone 6s (9.2) + Apple Watch - 38mm (2.1) [0099A161-8A85-490A-B416-98677862322A]”,“iPhone 6s Plus (9.2) [67DB4DAE-ABDD-427B-9C0D-C7D89EECFB82]”,“iPhone 6s Plus (9.2) + Apple Watch - 42mm (2.1) [54C4B1AF-E046-4648-8046-1E00186A6E5D]”]) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 3.79 seconds

I tried to modify the iOS.js: var reqVersion = opts.platformVersion || opts.iOSSDKVersion;
if (opts.iOSSDKVersion >= 8 && xcodeMajorVer === 7) {
iosDeviceString += " (" + reqVersion + “)”;
} else if (9>opts.iOSSDKVersion >= 8) {
iosDeviceString += " (" + reqVersion + " Simulator)";
} else if (8>opts.iOSSDKVersion >= 7.1) {
iosDeviceString += " - Simulator - iOS " + reqVersion;
} else if (opts.iOSSDKVersion>=9){
iosDeviceString += " (" + reqVersion + “)”;
}

but can’t work, could anyone please help me out? Thanks a lot!

This error has gone after I added capabilities for did, but see another error:
Error: Could not initialize ideviceinstaller; make sure it is installed and works on your system

Above is the related post.