How to configure Nightwatch.js + Selenium Hub + Appium + real mobile devices?
<p>I have a working selenium configuration with a selenium hub which is my entry point for firefox/chrome desktop tests, launched via Nightwatch.js.</p>

<p>Now I would like to add tests for mobile devices, so, after some search, I've configured an Appium on a Mac, plugged with my hub as below:</p>

<pre><code>{
    "capabilities": [
        {
            "browserName": "Safari",
            "platformName": "iOS",
            "platformVersion": "9.3",
            "maxInstances": 1,
            "platform": "MAC"
        }
    ],
    "configuration": {
        "cleanUpCycle": 2000,
        "timeout": 30000,
        "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
        "url":"http://192.168.24.222:4723/wd/hub",
        "host": "192.168.24.222",
        "port": 4723,
        "maxSession": 1,
        "register": true,
        "registerCycle": 5000,
        "hubPort": 4444,
        "hubHost": "selenium-hub-host"
    }
}
</code></pre>

<p>For now I would like to:</p>

<ol>
<li>Configure a virtual device with Appium (I'm lost with the official documentation and I'm not familiar with Apple devices)</li>
<li>Have a proper Nightwatch test configuration to run on them</li>
<li>Add one or more real devices on the Appium side</li>
</ol>

<p>Any help is welcome, thanks</p>

<p><strong>Edit</strong>: I've achieved 1. and 2. by enhance capabilities in both nightwatch task def and appium capabilities:</p>

<p>On Nightwatch.js:</p>

<pre><code>"ios": {
    "desiredCapabilities" : {
        "browserName" : "Safari",
        "deviceName": "iPhone Simulator",
        "platformName" : "iOS",
        "platform" : "MAC",
        "javascriptEnabled" : true,
        "acceptSslCerts" : true
    }
}
</code></pre>

<p>On Appium nodeconf.json:</p>

<pre><code>"capabilities": [
    {
        "browserName": "Safari",
        "platformName": "iOS",
        "platformVersion": "9.3",
        "deviceName": "iPhone Simulator",
        "maxInstances": 1,
        "platform": "MAC"
    }
]
</code></pre>

<p>but now I'm stuck with real devices, it's doesn't want to register my nodeconf on the selenium hub (invalid param, apparently):</p>

<pre><code>{
    "browserName": "Safari",
    "platformName": "iOS",
    "platformVersion": "8.1",
    "deviceName": "testmac’s iPad",
    "udid": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "maxInstances": 1,
    "platform": "MAC"
}
</code></pre>

<p>Here is my hub grid:
<a href="https://i.stack.imgur.com/bw3Jl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bw3Jl.png" alt="selenium hub grid"></a></p>