Search code examples
iosxcodeios-simulatorappium-iossimctl

Can't install .app on simulator via command line


I'm using appium for ios test automation. Lately, I get an error when installing an .app on a simulator. I could reproduce that locally.

Command line execution, that fails:

xcrun simctl install DEVICE_ID /full/path/to/app

Error message:

An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2): Failed to install the requested application An application bundle was not found at the provided path. Provide a valid path to the desired application bundle.

However!

When I drag the .app on the Simulator, it works just fine. The deviceId is correct. I can easily boot and shutdown the simulator via xcrun simctl. This is on our CI mac slave. Running locally on my mac (with same versions) works just fine.

Environment:

OS version: ProductName: Mac OS X ProductVersion: 10.13.5 BuildVersion: 17F77

Xcode version: 9.4

Command line tools version: 9.4

xcrun version: xcrun version 43

simctl version: @(#)PROGRAM:simctl PROJECT:CoreSimulator-518.22

Simulator under test: iPhone SE (11.4)

I would be very about any hints.


Solution

  • Thanks for the feedback. Good to know, that drag and drop uses the same API. I found out, what was the issue. The path was really incorrect. However, cd'ing into the path worked, that's why I thought, the path can't be the issue.

    The actual path was "/Users/Jenkins/..." but I used "/Users/jenkins..." because this was returned by the jenkins' pwd function. Seems like our jenkins slave was misconfigured.

    So, somehow cd could handle the incorrect casing, while xcrun simctl couldn't.