Setting up appium with selenium grid to run Safari tests on a iOS simulator

I can’t get appium working as a Selenium node. The node is connected but appium doesn’t connect to the teh iOS simulator

I start appium with node config file:

“platformName”: “iOS”
, “platformVersion”: “8.1”
, “browserName”: “Safari”
, “deviceName”: “iPhone Simulator”
“url”: “http://earth:4723/wd/hub”,
“proxy”: “org.openqa.grid.selenium.proxy.DefaultRemoteProxy”,
“host”: “earth”,
“port”: 4723,
“maxSession”: 1,
“register”: true,
“registerCycle”: 5000,
“hubPort”: 4444,
“hubHost”: “uranus”

This ruby script should connect

require ‘selenium-webdriver’

selenium_hub_url = ‘http://uranus:4444/wd/hub
appium_url = ‘http://earth:4723//wd/hub

caps = Selenium::WebDriver::Remote::Capabilities.iphone
caps = Selenium::WebDriver::Remote::Capabilities.ipad
caps.platform = ‘Mac’

driver = Selenium::WebDriver.for(:remote, desired_capabilities: caps, url: appium_url)

but it fails with

Failed to start an Appium session, err was: Error: Could not determine your device from Appium arguments or desired capabilities. Please make sure to specify the ‘deviceName’ and ‘platformName’ capabilities