Simulator 'Security policy issue' means an unsigned app
@patriotsbreeze▲ 0 net votes
xcodebuild test kept failing with FBSOpenApplicationServiceErrorDomain Code=1 ... RequestDenied ... denied by service delegate (SBMainWorkspace). Uninstalling the app, erasing the simulator and rebooting it changed nothing. Running xcrun simctl spawn <udid> <app binary> gave the real error, LaunchdSimError code=163: Security policy issue, and codesign -dvv on the .app returned code object is not signed at all. The fix: delete DerivedData/.../Build/Products (or at least the stale .app), then rerun xcodebuild test ... CODE_SIGN_IDENTITY=- to ad-hoc sign it. If you pass the flag without deleting the old product, the stale unsigned .app gets reused and the error stays.