Record Class McpMobileInitOptions

java.lang.Object
java.lang.Record
com.shaft.mcp.McpMobileInitOptions
Record Components:
targetUrl - web-emulation only: initial URL; blank leaves the browser on its startup page
browser - web-emulation only: browser name, defaults to CHROME
deviceName - web-emulation: Chrome/Edge emulated device name, defaults to Pixel 5; native: emulator, simulator, or real device name
width - web-emulation only: custom device width; requires height
height - web-emulation only: custom device height; requires width
pixelRatio - web-emulation only: custom device pixel ratio
userAgent - web-emulation only: optional custom mobile user agent
headless - web-emulation only: whether the emulated browser should run headlessly
platformName - native only: Android or iOS
appiumServerUrl - native only: Appium server URL; blank defaults to http://127.0.0.1:4723
automationName - native only: Appium automation name; blank selects UiAutomator2/XCUITest
platformVersion - native only: optional platform version
udid - native only: optional device UDID
app - native only: optional app path or remote app URL
appPackage - native only: optional Android app package
appActivity - native only: optional Android app activity
bundleId - native only: optional iOS bundle identifier for installed apps

public record McpMobileInitOptions(String targetUrl, String browser, String deviceName, Integer width, Integer height, Double pixelRatio, String userAgent, Boolean headless, String platformName, String appiumServerUrl, String automationName, String platformVersion, String udid, String app, String appPackage, String appActivity, String bundleId) extends Record
Optional nested mobile-session request object accepted by driver_initialize when engine selects ActiveEngine.MOBILE_NATIVE or ActiveEngine.MOBILE_WEB (design doc amendment A9): carries the union of the former mobile_initialize_native and mobile_initialize_web_emulation tools' parameters. Every field is optional; unset fields resolve from SHAFT.Properties exactly as the current mobile init tools do (blank/zero values are passed straight through to MobileService.initializeNative(String, String, String, String, String, String, String, String, String, String)/ MobileService.initializeWebEmulation(String, String, String, int, int, double, String, boolean), which already default them internally).
  • Constructor Details

    • McpMobileInitOptions

      public McpMobileInitOptions(@ToolParam(required=false) String targetUrl, @ToolParam(required=false) String browser, @ToolParam(required=false) String deviceName, @ToolParam(required=false) Integer width, @ToolParam(required=false) Integer height, @ToolParam(required=false) Double pixelRatio, @ToolParam(required=false) String userAgent, @ToolParam(required=false) Boolean headless, @ToolParam(required=false) String platformName, @ToolParam(required=false) String appiumServerUrl, @ToolParam(required=false) String automationName, @ToolParam(required=false) String platformVersion, @ToolParam(required=false) String udid, @ToolParam(required=false) String app, @ToolParam(required=false) String appPackage, @ToolParam(required=false) String appActivity, @ToolParam(required=false) String bundleId)
      Creates an instance of a McpMobileInitOptions record class.
      Parameters:
      targetUrl - the value for the targetUrl record component
      browser - the value for the browser record component
      deviceName - the value for the deviceName record component
      width - the value for the width record component
      height - the value for the height record component
      pixelRatio - the value for the pixelRatio record component
      userAgent - the value for the userAgent record component
      headless - the value for the headless record component
      platformName - the value for the platformName record component
      appiumServerUrl - the value for the appiumServerUrl record component
      automationName - the value for the automationName record component
      platformVersion - the value for the platformVersion record component
      udid - the value for the udid record component
      app - the value for the app record component
      appPackage - the value for the appPackage record component
      appActivity - the value for the appActivity record component
      bundleId - the value for the bundleId record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • targetUrl

      public String targetUrl()
      Returns the value of the targetUrl record component.
      Returns:
      the value of the targetUrl record component
    • browser

      public String browser()
      Returns the value of the browser record component.
      Returns:
      the value of the browser record component
    • deviceName

      public String deviceName()
      Returns the value of the deviceName record component.
      Returns:
      the value of the deviceName record component
    • width

      public Integer width()
      Returns the value of the width record component.
      Returns:
      the value of the width record component
    • height

      public Integer height()
      Returns the value of the height record component.
      Returns:
      the value of the height record component
    • pixelRatio

      public Double pixelRatio()
      Returns the value of the pixelRatio record component.
      Returns:
      the value of the pixelRatio record component
    • userAgent

      public String userAgent()
      Returns the value of the userAgent record component.
      Returns:
      the value of the userAgent record component
    • headless

      public Boolean headless()
      Returns the value of the headless record component.
      Returns:
      the value of the headless record component
    • platformName

      public String platformName()
      Returns the value of the platformName record component.
      Returns:
      the value of the platformName record component
    • appiumServerUrl

      public String appiumServerUrl()
      Returns the value of the appiumServerUrl record component.
      Returns:
      the value of the appiumServerUrl record component
    • automationName

      public String automationName()
      Returns the value of the automationName record component.
      Returns:
      the value of the automationName record component
    • platformVersion

      public String platformVersion()
      Returns the value of the platformVersion record component.
      Returns:
      the value of the platformVersion record component
    • udid

      public String udid()
      Returns the value of the udid record component.
      Returns:
      the value of the udid record component
    • app

      public String app()
      Returns the value of the app record component.
      Returns:
      the value of the app record component
    • appPackage

      public String appPackage()
      Returns the value of the appPackage record component.
      Returns:
      the value of the appPackage record component
    • appActivity

      public String appActivity()
      Returns the value of the appActivity record component.
      Returns:
      the value of the appActivity record component
    • bundleId

      public String bundleId()
      Returns the value of the bundleId record component.
      Returns:
      the value of the bundleId record component