In Appium, a driver adds a mobile: command your java-client version predates — what must you upgrade?
answer
- three release trains
- a name is just a string
- the driver answers, not the client
- upgrade the driver, not the client
basics
~20 sUsually nothing on the client side. A driver's new mobile: command is reachable from any client version, because the client sends the name as a plain string; what must be current is the driver installed on the Appium server.
solid answer
~50 sSplit the question by artefact. To the client a `mobile:` command is **a string and a map**, so an older `java-client` can already call one a newer driver added — nothing in the library needs to know the name exists. What must be current is the **driver on the Appium server**, because that driver is the only thing that can answer it. The client has to move for a different class of change: a new or altered W3C endpoint, a change in how a session is created or how capabilities are serialised, a serialisation bug fix, or simply because you want a typed helper instead of a raw execute call. So the triage runs: an *unknown method* error points at the session's driver, while a request the client cannot form at all points at the client. Upgrading the client never adds driver behaviour.
go deeper
Know that the client, the Appium server and each driver are separate downloads with separate versions, and that calling a driver's new command does not require a new client.
Explain why a mobile: name travels as a plain string, so the client never needs to know it. Be able to name the changes that do require a client upgrade, such as a changed endpoint or a changed session-creation shape.
Triage a failure to the right artefact from its error: an unknown-method error is the session's driver, a malformed or missing request is the client. Show how you pin and move the three independently in a real suite.
Own the upgrade cadence across suites: which artefact moves first, how a driver upgrade is validated before it reaches every team, and how to stop client-version skew turning into an untestable matrix.
## Three release trains, deliberately Appium's client, its server and each driver are published separately, and the split is a design choice rather than an accident. A driver has to move quickly, because Android's and Apple's tooling moves and the driver follows. The protocol between client and server moves slowly, because it is W3C WebDriver plus a small, stable set of Appium extensions. Coupling the client's release to the driver's would drag the slow-moving part along behind the fast-moving one, for no benefit to anybody. The consequence is exactly the situation in the question: a driver publishes a command your client release predates. Answering it well means naming which artefact has to move, and — just as important — which ones do not. ## What a new driver command actually needs Nothing in the client. To the client, a `mobile:` command is a string and a map: - The name sits in the script slot as a string; the library never validates it and does not know it. - The parameters are one map, serialised as-is. - The reply comes back as generic JSON and is decoded into a map, a list or a scalar. Because none of that involves the command's identity, an older client encodes a brand-new command exactly as well as a brand-new client does. What must be current is the **driver installed on the Appium server**, since that driver is the only thing that can answer the name at all — plus, where the driver requires it, the server generation that driver runs on. The inverse is the more common misconception and is worth stating flatly: **upgrading the client never adds driver behaviour.** No client release can make a command exist that the driver on the other end does not implement. ## What genuinely requires a client upgrade The client has to move for protocol-shaped changes and for convenience, not for driver features: - A new or changed W3C endpoint the client has no method for at all. - A change to how a session is created, or how capabilities are serialised on the way out. - A serialisation or decoding fix in the client, or in the Selenium client beneath it. - A typed helper you would rather use than a raw execute call. - Support for a language or runtime version your project has moved to. That list is short, and it is why suites routinely run a client several releases behind a fast-moving driver with no trouble at all. ## Reading a failure back to its artefact | Symptom | Most likely artefact | First thing to check | |---|---|---| | Server rejects a `mobile:` name as an unknown method | the driver in that session | which driver created the session, and its command surface | | The command runs but rejects your parameters | your parameter map | the key names and shape that driver expects | | No client method exists for a standard endpoint | the client | whether that endpoint is newer than your client pin | | Session creation itself fails | the client or the capability map | how the client serialises the capabilities you set | | Answered on Android but unknown on Apple devices | neither — this is attribution | each driver publishes its own command names | The last row is the one that most often masquerades as version skew. A name owned by Android's UiAutomator2 driver is simply unknown to Apple's XCUITest driver, and no client version changes that. ## A worked case A physiotherapy exercise app suite runs the same journeys on Android's UiAutomator2 driver and on Apple's XCUITest driver. Someone adds a step that needs a driver command introduced after the team's `java-client` pin. The instinct is to bump the client dependency, which means re-validating the whole matrix for a change that could not possibly have helped: the client would have encoded the same string either way. The change that mattered was on the server side — the installed driver had to be the release that owns the command. Once the team sees that, the client pin stays where it is, the upgrade touches one artefact, and the validation burden shrinks to that artefact's behaviour. ## A pinning policy worth defending 1. Pin all three — client, server and driver — explicitly, so any environment difference is a readable diff rather than a guess. 2. Move the driver on its own cadence, because that is where new device behaviour arrives. 3. Move the client for protocol or language reasons, and treat a client bump as its own change with its own validation. 4. Before bumping anything, classify the failure by artefact using the symptoms above; most "our client is too old" reports turn out to be driver or attribution problems. 5. Record which driver release a given command depends on, because the client cannot express that dependency for you and your build will not warn you about it.
- A mobile: command works on Android but errors on Apple devices — which artefact is wrong?Neither the client nor its version. Each driver publishes its own command names, so a name owned by Android's UiAutomator2 driver is unknown to Apple's XCUITest driver. The fix is a per-platform branch calling each driver's own command, not a client upgrade.
- When does upgrading java-client actually change what goes on the wire?When the protocol shape changes — session creation, an endpoint's request or response body, or how capabilities are serialised — or when a client bug altered what was sent. Adding driver commands does not qualify: those names travel as strings, unchanged by the client version.
- How would you prove that a client upgrade is unnecessary before refusing it?Call the command from the current client with a raw execute call against the driver release that owns it. If it answers, the client was never the constraint. That is a single test, and it is cheaper than re-validating a whole suite against a new dependency.
saying these in an interview costs you the question
- Upgrades the client hoping a new driver command appears
- Assumes client, server and driver share one version number
- Reads an unknown-method error as a client-side bug
- Believes a mobile: name must exist in the client to be callable
- Pins all three artefacts to whatever a tutorial happened to use