Your Appium library loan-renewal suite needs an unreleased driver fix - how do you install that build?
answer
- the short name is a catalogue lookup
- --source: npm, github, git, local
- git sources also need --package
- a branch pins nothing across hosts
basics
~20 sInstall the build from where it lives: appium driver install with --source=github or --source=git plus --package, or --source=local for a checkout. It lands in APPIUM_HOME like any driver, but a branch pins nothing - treat it as temporary.
solid answer
~40 sInstall it from where it lives. `appium driver install` takes `--source` with the values `npm`, `github`, `git` and `local`: a `github` or `git` source also needs `--package` naming the package inside the repository, and `--source=local` points at a checkout you have already built. The install lands in `APPIUM_HOME` exactly as a registry install would, and `extensions.yaml` records the origin, so `appium driver list --installed` still tells you what this machine is running. Then treat it as temporary: a branch install is a moving target, the driver still declares a peer dependency on the server's major line, and the way back is a pinned published version - an internal package if the fork outlives a few days.
code
bash · 5 lines# Android driver straight from its GitHub repository
appium driver install --source=github --package=appium-uiautomator2-driver appium/appium-uiautomator2-driver
# the same Android driver from a checkout you have already built
appium driver install --source=local ./appium-uiautomator2-driver
appium driver list --installedgo deeper
Know that appium driver install accepts --source with the values npm, github, git and local, so a driver does not have to come from the public registry to be installed.
Explain what each source records: extensions.yaml keeps the package, version and origin, and a github or git install also needs --package to name the package inside the repository.
Show the operational reasoning - a branch install is a moving target across hosts, so pin what you can, verify with appium driver list --installed, and script the install instead of typing it.
Own the exit plan: decide when a fork becomes an internally published package, who carries the fix upstream, and how the fleet returns to a pinned published driver once the release lands.
## The short name is a catalogue lookup, not the only way in `appium driver install uiautomator2` works because the CLI carries a list of official extensions and can turn that short name into a package. Everything outside that list - a community driver, your fork of one, a branch carrying a fix that has not been published - needs you to say where the package comes from, using `--source`. The **library loan-renewal** suite in this scenario is blocked on a merged but unpublished driver fix, and `--source` is how that build reaches the machine without waiting for a release. ## The four sources - `--source=npm` names a package in the registry and can pin an exact version; this is what a short name resolves to. - `--source=github` names a repository as `<org>/<repo>`. - `--source=git` names any git URL, including a private one the host can reach. - `--source=local` names a directory on this machine - a checkout you are editing, or a build your own tooling produced. For `github` and `git` the repository alone is not enough: Appium also wants `--package` naming the package inside it, because a repository may hold several and the manifest has to record one name. For `local`, the directory must already be a complete, built extension package - Appium installs it, it does not build it for you. ## What gets recorded Whichever source you use, the outcome has the same shape: the extension lands under `APPIUM_HOME`, and `extensions.yaml` gains an entry naming the extension, its package, its version and where it came from. `appium driver list --installed` then prints that entry. This matters more here than in the ordinary case, because six weeks later the difference between a driver from the registry and a driver from somebody's branch is invisible in behaviour and obvious in the manifest. ## What a git or local install costs you | | published install | git or github install | local install | |---|---|---|---| | What you get | an immutable published version | whatever the branch points at now | whatever is on this disk now | | Reproducible elsewhere | yes, by version | only if you pin a commit or tag | no | | Update path | `appium driver update` | reinstall from the source | reinstall from the directory | - A branch install is a moving target: the same command on two machines a week apart can produce two different drivers. - Nothing about the source changes the driver's own requirements - it still declares a peer dependency on the server's major line, and an unpublished build may expect a newer server than you run. - A local install ties the machine to a path; move or delete that directory and the next reinstall fails for reasons that have nothing to do with Appium. - The **Android** UiAutomator2 driver and the **Apple-platform** XCUITest driver are separate packages in separate repositories, so forking one leaves the other on its published version. Say that out loud in a suite that runs both, or someone will assume the whole toolchain moved. ## Getting back to boring A driver installed from a branch is a **temporary** state and deserves to be labelled as one: 1. Pin what you can - a tag or commit for a git source, an exact version for a registry source - so the install is repeatable while it lasts. 2. Publish an internal package if the fork will outlive a few days. That turns a branch install back into a pinned registry install and restores the normal update path. 3. Get the fix upstream, then reinstall the published driver and delete the special case. 4. Record the install commands where the next person will read them, because `APPIUM_HOME` is ambient state on the machine and nothing inside the suite reveals which driver build it ran against. ## Why interviewers ask this one The flag itself is a lookup. What the question tests is whether you can hold two things at once: that Appium's extension model deliberately makes an unpublished driver installable, and that installing one puts a machine into a state no version number describes. The strong answer names `--source` and `--package` in one breath and, in the next, says how the fleet gets back to a published version and who is responsible for making that happen. The weak answer either waits for a release it cannot influence, or installs the branch and never revisits it - which is the same failure a year later, wearing a different name.
- How would you keep a git-sourced Appium driver reproducible across two machines?Pin it - install from a tag or commit rather than a branch tip - and put the exact `appium driver install` command in a script both machines run. Then verify with `appium driver list --installed`, which prints the source and version recorded in `extensions.yaml`. A branch name alone reproduces nothing.
- When is publishing an internal package better than installing from a fork's branch?As soon as the fork outlives a few days or is needed on more than one machine. A published package restores a version number, a pinned install and the ordinary `appium driver update` path, and it makes the deviation visible in the manifest rather than in somebody's memory.
saying these in an interview costs you the question
- Waits for a published release when the fix could be installed from source
- Installs the driver package globally and expects the server to load it
- Treats a branch install as reproducible across machines
- Omits --package when installing from a git or GitHub source
- Leaves the fork in place with no plan to return to a published build
- Assumes a local checkout is built for you at install time