Commit b93230f
Fail fast when a REPL target is not a launchable app
Summary:
`idb-repl app --bundle-id com.apple.springboard` now fails immediately, naming the app and explaining why, instead of hanging for the client's full two-minute deadline and then reporting only a hashed socket path.
SpringBoard is a launchd job, not a launchable app. Launching one still reports success, because CoreSimulator resolves it to the process already running -- so the injected environment is dropped, `libRepl` is never loaded, and nothing ever binds the control socket the client is waiting for. The wait cannot succeed, and the message it eventually produced named neither the app nor the cause.
The guard runs after the launch and asks whether the bundle id now has a `UIKitApplication:` service in the simulator's launchd. A real app registers one; a launchd-managed target never does. This is the same lookup `confirmApplicationLaunchState` already trusts to decide whether an app is running, so it introduces no new signal -- it just stops discarding the one case the two cannot distinguish, where "no service" means "not an app" rather than "not running".
Deliberately not keyed on install type. Apple's system apps are ordinary launchable apps as far as injection is concerned -- Safari, Photos, Settings, Messages, Maps, Calendar, Contacts, Reminders, Files and Health all host a REPL with full access to their own UIKit state -- so refusing a target for being Apple-signed would be wrong. A comment at the call site says so, because the install-type predicate already exists nearby for uninstall and is the tempting thing to reach for.
Reviewed By: williamtwilson
Differential Revision: D119189291
fbshipit-source-id: 805ad2d2efb356f96ce98daecf95b98e54330d721 parent f7807a4 commit b93230f
2 files changed
Lines changed: 92 additions & 1 deletion
File tree
- FBSimulatorControlTests/Tests/Unit
- FBSimulatorControl/Commands
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
24 | 31 | | |
25 | 32 | | |
26 | 33 | | |
| |||
168 | 175 | | |
169 | 176 | | |
170 | 177 | | |
171 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
172 | 196 | | |
173 | 197 | | |
174 | 198 | | |
| |||
Lines changed: 67 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
0 commit comments