skip to content

Your Appium hive-log build fails to install on a real Android phone and on a real iPhone. How do you triage each?

level: seniorimportance: should knowfreq 46%

answer

  1. file wrong, or target wrong
  2. check for a resident copy first
  3. remove and retry is decisive
  4. simulator builds are not device builds
  5. hardware install can fail before transfer

basics

~20 s

Separate the artifact from the target. On Android, check the build's shape and remove a conflicting package before retrying. On an iPhone, check the artifact is a device build rather than a Simulator one, and that the driver reaches the device.

solid answer

~40 s

Ask one question first: is the file wrong, or is the target wrong? On Android, confirm the shape — a single `.apk`, an `.apks` archive, or loose splits that need UiAutomator2's `mobile: installMultipleApks` — then use `mobile: isAppInstalled` and `mobile: removeApp` to clear a conflicting copy and retry, which resolves most replace-time failures. On an iPhone, confirm the artifact is a hardware build and not a Simulator `.app`, since the XCUITest driver reaches real devices through `devicectl` rather than `simctl` and hardware will not take a simulator bundle. Then read the server log for which layer failed. If the answer turns out to be provisioning, or whether the device is set up to take a session at all, you have left this step and entered a different subject.

go deeper

for a junior

Learn the first two checks: is an app with that identifier already installed, and is the artifact the right kind for this target. Most install failures answer to one of them.

for a middle

Explain why remove-then-install is decisive on Android, and why an Apple simulator build and a device build are different files that the same execute method will not reconcile.

for a senior

Show a triage order rather than a list of guesses: pin the artifact and the target, use is-installed and remove to split the hypotheses, then read the failing layer out of the server log.

for a principal

Decide what a fleet must record about every install so hardware failures are diagnosable without a re-run, and where triage hands off to the signing, device-readiness and build-selection owners.

## Separate the artifact from the target Install is where a mobile suite fails first, and almost every install failure is one of two things: the file is not what this target accepts, or the target is not in a state that will take it. Deciding which, before changing anything, is the whole method. Everything below is a way of answering that one question quickly on a beekeeping hive-log run. Start by pinning down the facts you actually have: - Which artifact path did the session use, and what shape is it in? - Which target is this — virtual or physical, phone or simulator? - Did the install command itself fail, or did it succeed and something later break? - Is an app with the same identifier already on the device? That last one is answerable directly with `mobile: isAppInstalled`, and it changes the triage path more than anything else you can check in one call. ## The Android checklist 1. **Check the shape of the build.** A single `.apk` and an `.apks` archive both go through `mobile: installApp`. Loose split files do not — they need UiAutomator2's `mobile: installMultipleApks`, and passing one of them alone produces a package that installs and then dies at launch. 2. **Check for an existing copy.** Call `mobile: isAppInstalled`. If the package is already present, a replace can fail for reasons that have nothing to do with your file. 3. **Remove and retry.** `mobile: removeApp` followed by a fresh `mobile: installApp` is the cheapest decisive test: if it now succeeds, the problem was the resident copy, not the artifact. 4. **Check the artifact suits this hardware.** A build that omits the phone's ABI, or a device with no free storage, fails at install time and reads as a driver error rather than as a build problem. 5. **Read the server log.** The Android install runs host-side through `appium-adb`, so the underlying installer message usually travels back into the log and names the cause outright. ## The Apple checklist On hardware the first suspect is different, because the XCUITest driver takes two routes behind one method: `simctl` for simulators and `devicectl` for real devices. - **Is the artifact a hardware build?** A `.app` bundle produced for the Simulator is not the file a real device accepts. This is the single most common cause of an install that works all week on simulators and fails the first time it meets a phone. - **Is the device reachable at all?** A device install depends on the driver reaching the device first, and newer real devices are reached over an optional remote-XPC tunnel package the driver declares. A failure here is a connectivity failure wearing an install failure's clothes. - **Is a copy already present?** `mobile: isAppInstalled`, then `mobile: removeApp` and retry, exactly as on Android. The commands are shared even though the machinery is not. - **Is this really a provisioning question?** If the artifact is the right kind and the device is reachable, and the platform still refuses the file, you are looking at signing and provisioning — a separate subject, and the point at which this step hands off. ## What each platform's failure tends to look like | symptom | Android | Apple platforms | |---|---|---| | install succeeds, launch crashes | only the base split landed | rare — the artifact is one archive | | install refused with a copy present | replace-time conflict; remove and retry | remove and retry likewise | | install refused on hardware only | artifact does not match the device | Simulator build handed to a real device | | failure before any transfer | host-side adb layer problem | device not reachable over its transport | ## Where this stops being an install problem Three honest hand-offs keep triage from wandering: - **Signing and provisioning** of the application artifact is its own subject. Recognise the boundary and stop rather than guessing at certificates. - **Whether the device is prepared to take a session at all** — its developer-side setup and its automation agent — is a different question from whether it will take this file. - **Which build the lane should be running** is a test-design decision, not something to solve by editing a path in the setup step at three in the afternoon. The cheapest habit is to make the suite say, in one log line per session, which target it used and which artifact it installed with which command. Most of the triage above then collapses to reading that line — and the cases that do not are precisely the ones that belong to someone else's subject.

  • Why is remove-then-install such a useful early step on Android?
    Because it splits the two hypotheses in one action. If a fresh install succeeds after `mobile: removeApp`, the artifact was fine and the resident copy was blocking the replace; if it still fails, the artifact or the target is the problem and you can stop looking at device state. It costs one command and rules out half the search space.
  • How do you tell an Apple install failure from a device-reachability failure?
    By where it fails. A reachability problem fails before any transfer and tends to reproduce for every command, not only install, because the driver must reach the device through its transport first. An artifact problem fails at the install itself and reproduces only for that file — swap in a known-good hardware build and the difference is immediate.

saying these in an interview costs you the question

  • Retries the same install without changing anything
  • Blames the app when install succeeded and launch failed
  • Ships a Simulator build to real Apple hardware
  • Never checks whether a copy is already installed
  • Treats every hardware install failure as a signing problem