simctl not working in Xcode 7.0 and Xcode 7.1 beta 1 - backboardd not loaded

UPDATED FOR Xcode 7


In Xcode 7.0, I have not been able to install or uninstall apps with simctl.


And there is a typo in the simctl help:



$ xcrun simctl help
...
get_app_container  Print the path of the **intsalled** app's container
...


Reproduce


$ export DEVICE=F24BE4F9-36C5-4842-84A4-1EA2614B8A3E
$ export APP=/path/to/CalSmoke-cal.app

$ xcrun simctl boot $DEVICE
$ xcrun simctl install $DEVICE $PATH


Expected


To see the app installed on the target simulator.


Found


The command hangs indefinitely. Xcode 7 GM


$ xcrun simctl install $DEVICE $PATH
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.


The APP does exist at path.


The Simulator log shows that `backboard` is not loaded; that log message repeats indefinitely.

$ tail -f ~/Library/Logs/CoreSimulator/F24BE4F9-36C5-4842-84A4-1EA2614B8A3E
stern CoreSimulatorBridge[8316]: Requesting installation of file:///Users/moody/git/calabash/ios-smoke-test-app/CalSmokeApp/CalSmoke-cal.app/ with options: {
    CFBundleIdentifier = "sh.calaba.CalSmoke-cal";
    PackageType = Developer;
    SimulatorRootPath = "/Xcode/7.0/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk";
    SimulatorUserPath = "/Users/moody/Library/Developer/CoreSimulator/Devices/F24BE4F9-36C5-4842-84A4-1EA2614B8A3E/data";
  }
stern CoreSimulatorBridge[8316]: LaunchServices: installing app for existing placeholder <LSApplicationProxy: 0x7fd5e3700580> sh.calaba.CalSmoke-cal <(null) *Not found in database*>
stern CoreSimulatorBridge[8316]: LaunchServices: Not creating progress for <LSApplicationProxy: 0x7fd5e3700580> sh.calaba.CalSmoke-cal <(null) *Not found in database*> since it is not a placeholder.
stern installd[8290]: 0x112481000 -[MIClientConnection installPath:withOptions:completion:]: Install of "/Users/moody/git/stern installd[8290]: 0x111bfc000 -[MIInstaller _extractPackageWithError:]: Did not construct delta; doing full copy for installation.
stern SpringBoard[8300]: BSXPCMessage received error for message: Connection invalid
--- last message repeated 1 time ---
stern SpringBoard[8300]: -[BKSSystemApplicationClient queue_connectionWasInvalidated] backboardd is not loaded; waiting for it to return.
stern SpringBoard[8300]: BSXPCMessage received error for message: Connection invalid
--- last message repeated 1 time ---
stern SpringBoard[8300]: -[BKSSystemApplicationClient queue_connectionWasInvalidated] backboardd is not loaded; waiting for it to return.

stern ***[8341]: LaunchServices: Currently 0 installed placeholders: (
  )
stern SpringBoard[8300]: BSXPCMessage received error for message: Connection invalid
--- last message repeated 1 time ---
stern SpringBoard[8300]: -[BKSSystemApplicationClient queue_connectionWasInvalidated] backboardd is not loaded; waiting for it to return.


Regression


  1. Xcode 6.0 - 6.4 - works as expected.
  2. Xcode 7.1 beta 1 - same result as Xcode 7.0 GM
  3. The same behavior occurs with any app.


Notes


If the app is already installed and I try to uninstall, the command also hangs.


The software I maintain requires that I have many side-by-side installations of Xcode (back to Xcode 5.1.1). They are installed like this:


/Xcode/5.1.1/Xcode.app
...
/Xcode/6.4/Xcode.app
/Xcode/7.0/Xcode.app
/Xcode/7.1b1/Xcode-beta.app


  • I have restarted my machine several times.
  • The app can be built and installed from any Xcode.
  • The app can be installed and launched with instruments from any Xcode.
  • I tried with --noxpc (something I don't usually do).
  • I ensured that all simulators were launched at least once and ensured they have finished installing their content.



MacOS Yosemite 10.10.5 (14F27)

Answered by Developer Tools Engineer in 61314022

Nope, that is not supported. If it worked in Xcode 6, that was a quirk of the implementation (likely older iOS versions didn't need backboardd to do the install). backboardd is not included when booting up the simulator from the command line. You need to boot the device in Simulator.app. I've duped your radar to the one tracking adding this feature.

I can confim that it also doesnt work on the El Capitan GM

It works fine for me.


Based on the output, it looks like you booted your device with 'xcrun simctl boot ...' rather than with Simulator.app. If you do that, backboardd will not be loaded, and things like app install, app launch, etc will not function.


Making 'simctl boot' boot into a full session is something that I want to make happen at some point, but for now, you will need to use Simulator.app to boot into a full session.

> Based on the output, it looks like you booted your device with 'xcrun simctl boot ...' rather than with Simulator.app.

I did boot the device with simctl boot, which is the way the API appears to work.

1. Boot the device with simctl

2. Install/uninstall/erase

This is how it worked in Xcode 6. Our testing showed that the Simulator.app could not be running while executing simctl commands.

Are you saying that we need to launch the target simulator in Simulator.app and run the simctl commands?

Filed a radar: 22780413

Accepted Answer

Nope, that is not supported. If it worked in Xcode 6, that was a quirk of the implementation (likely older iOS versions didn't need backboardd to do the install). backboardd is not included when booting up the simulator from the command line. You need to boot the device in Simulator.app. I've duped your radar to the one tracking adding this feature.

I don't quite understand.. how are we supposed to launch the simulator, then?


xcrun simctl install booted $(pwd)/Empty.app
No devices are booted.


OK, it's closed.


open -a "Simulator.app"
xcrun simctl install booted $(pwd)/Empty.app

An error was encountered processing the command (domain=LaunchServicesError, code=0):
The operation couldn’t be completed. (LaunchServicesError error 0.)
simctl not working in Xcode 7.0 and Xcode 7.1 beta 1 - backboardd not loaded
 
 
Q