Search code examples
iosiphonetestingappiumsimulator

Appium fails launching on iPhone Simulator, success on device


  • Appium v1.15.1
  • Mac 10.14.6
  • Xcode 11.2.1
  • Python test file.

I'm able to run the test on iPhone Device successfully, but on iPhone Simulator not.

Error:

[debug] [WD Proxy] Matched '/status' to command name 'getStatus'
[debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[HTTP] --> GET /status
[HTTP] {}
[debug] [HTTP] No route found. Setting content type to 'text/plain'
[HTTP] <-- GET /status 404 1 ms - 49
[HTTP] 
[WD Proxy] Got an unexpected response with status 404: The URL '/status' did not map to a valid resource

This is the Appium Server details:

Welcome to Appium v1.15.1
[Appium] Non-default server args:
[Appium]   address: 127.0.0.1
[Appium]   port: 8100
[Appium] Appium REST http interface listener started on 127.0.0.1:8100

Capabilities (Python):

def setUp(self):

        app = ('/Users/...app')
        self.driver = webdriver.Remote(
            command_executor='http://127.0.0.1:8100/wd/hub',
            desired_capabilities={
                'app': app,
                'platformName': 'iOS',
                'platformVersion': '13.1',
                'deviceName': 'iPhone Simulator',
                "automationName": "XCUITest",
                "xcodeOrgId": "XXXXXXXX",
                "xcodeSigningId": "iPhone Developer"
            }
        )

Any suggestions?


Solution

  • Try with the below capabilities:

    desired_capabilities={
                'app': app,
                'platformName': 'iOS',
                'platformVersion': '13.1',
                'deviceName': 'iPhone Simulator',
                'udid': 'unique id of simulator',
                "automationName": "XCUITest"              
            }
    

    udid can be found in Simulator>Hardware>Device>Manage Device select the device and then you can see the Identifier.

    Port need to be 4723.