idb is a flexible command line interface for automating iOS simulators and devices
by facebookSwift
Last 12 weeks · 625 commits
6 of 6 standards met
Motivation While reading the HID gesture builders in , I noticed that derives its interpolation step count from without the clamp its sibling gestures have. When the swipe distance is shorter than the delta — for example a 5pt swipe with the default 10pt — truncates to . The next line, , then divides by zero to , and in the interpolation loop makes every emitted touch event carry NaN coordinates — a short swipe silently degrades into garbage input instead of a small, valid gesture. already guards this with and the tvOS builder uses ; is the only interpolating gesture missing the clamp. It is reachable from normal usage — (a sub-delta swipe) hits it directly. Test Plan Steps must be at least 1 for the interpolation loop, so clamping with — mirroring — is the minimal fix. Added next to the existing swipe step-count tests: it runs a 5pt swipe with delta 10 and asserts both that the event count matches a single clamped step and that no emitted touch event carries a non-finite coordinate. It fails before the change (NaN coordinates, wrong count) and passes after. A standalone reproduction of the arithmetic confirms it: before, the short swipe emits touch points ; after, — all finite. A normal 100pt swipe is unchanged (13 events, no NaN), so this is a pure guard with no regression. Related PRs None.
Motivation At the end of a test run, assembles up to three heavyweight artifacts into the final : the gzipped result bundle, the exported code coverage data (an merge + export), and the gzipped log directory. These are independent, multi-second operations, but they run sequentially — one after another. The method has carried a TODO about this since the reporter was first ported from Objective-C to Swift (commit , Feb 2022), and the line has sat untouched ever since: The original Objective-C reporter ran the three steps concurrently, collecting their s and awaiting them together via . The Swift port serialized them. This PR restores the parallelism. I noticed the TODO while working in this same file on #927. Modifications Run the three finalization steps in a and fold each result into the response as it completes, instead of -ing them one by one. Behavior is otherwise identical to the current sequential code: Same gating conditions decide which artifacts are produced. Per-artifact error handling is preserved exactly: a result-bundle or coverage failure is logged and skipped; a log-directory failure still propagates. The response fields populated and the final call are identical; only the scheduling of the three steps changed. A task group is used to stay consistent with the companion's existing concurrent code (, ). Measurements End-of-run finalization changes from the sum of the three artifact times to the slowest one. Benchmarked the dominant work (tar+gzip) on representative directories (result-bundle ~64 MB, logs ~24 MB, coverage ~21 MB), wall-clock, 3 runs each: Individually: 2.56 s + 0.89 s + 1.00 s (sum 4.45 s) vs. max 2.56 s — confirming the sum→max behavior (~1.7x, ~2.2 s saved on this workload). The absolute saving grows with artifact size, and the real coverage export () adds further parallelizable time on top of the gzip measured here. Honest scope: this benefits runs that request more than one artifact (a single-artifact run is unaffected); the floor is the largest single artifact; and the numbers above are a local proxy for the gzip/export work, not a full end-to-end . Test Plan builds cleanly (no new warnings). Behavioral equivalence vs. the previous sequential code was verified across all paths — both artifacts-present combinations and the three error paths (result-bundle / coverage swallowed-and-logged; log-directory propagated): the set of populated response fields, whether the method throws, and whether the final response is written are identical in every case. Related PRs #927 — same file (compiles the assertion-failure regex once).
When I ran , I was asked to install Xcode. Which is pretty serious business (in terms of waiting times) so I am adding this to the install instructions. Motivation (Write your motivation here.) Test Plan (Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!) Related PRs (If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/idb, and link to your PR here.)
Repository: facebook/idb. Description: idb is a flexible command line interface for automating iOS simulators and devices Stars: 5169, Forks: 497. Primary language: Swift. Languages: Swift (60.3%), Objective-C (25%), Python (11.5%), MDX (2.3%), Shell (0.5%). License: MIT. Homepage: https://fbidb.io/ Latest release: v1.1.8 (3y ago). Open PRs: 3, open issues: 170. Last activity: 4h ago. Community health: 87%. Top contributors: lawrencelomax, xgerrit, c-ryan747, jbardini, zeyadsalloum, thegreatwallfb, plu, ajbalik, fgasperij, stepanhruda and others.