Why am I getting “Could not start session” during local Appium script execution?

Modified on Mon, Jun 22 at 2:16 PM


A session may fail to start due to incorrect capabilities, device unavailability, app installation failure, Appium server issue, stale session, or timeout. 


  • First, verify that the device is online and not already locked by another session. 
  • Then check your desired capabilities, app package/bundle ID, app activity, automation name, and device details.

    Android Capabilities (Mandatory + Recommended)

    {// Platform & device
    "appium:platformName": "Android",
    "appium:automationName": "UiAutomator2",
    "appium:deviceName": "<Device_Name>",
    "appium:platformVersion": "<Android_Version>",
    "appium:udid": "<Device_UDID>",// PORT MANAGEMENT (MANDATORY)
    "appium:systemPort": "<Unique_System_Port>",

    // App behavior
    "appium:autoGrantPermissions": true,
    "appium:noReset": true,
    "appium:fullReset": false,

    // Stability timeouts
    "appium:uiautomator2ServerLaunchTimeout": 90000,
    "appium:newCommandTimeout": 300,

    // TestGrid metadata
    "tg:userToken": "<Your_User_Token>",
    "tg:projectName": "<Project_Name>"
    }


    iOS Capabilities (Mandatory + Recommended)

    {"appium:platformName": "iOS",
    "appium:automationName": "XCUITest",
    "appium:deviceName": "<Device_Name>",
    "appium:platformVersion": "<iOS_Version>",
    "appium:udid": "<Device_UDID>",// PORT MANAGEMENT (MANDATORY)
    "appium:wdaLocalPort": "<Unique_WDA_Port>",

    // Stability timeouts
    "appium:wdaLaunchTimeout": 900000,
    "appium:wdaConnectionTimeout": 900000,
    "appium:newCommandTimeout": 300,

    // TestGrid
    "tg:userToken": "<Your_User_Token>",
    "tg:projectName": "<Project_Name>"

    }

  • Also make sure your script properly ends the session using driver.quit(). Stale or orphaned sessions can block new sessions from starting.


If the issue continues, raise it with support team share the complete capability set, execution logs, device name, app build, and timestamp 



Still have a question?

Support Contact:
support@testgrid.io

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article