Skip to content

fix(ios): name the home screen SpringBoard in the foreground app on a simulator - #502

Open
mobile-kevin wants to merge 1 commit into
mobile-next:mainfrom
mobile-kevin:fix-ios-springboard-foreground-name
Open

mobile-kevin wants to merge 1 commit into
mobile-next:mainfrom
mobile-kevin:fix-ios-springboard-foreground-name

Conversation

@mobile-kevin

Copy link
Copy Markdown
Collaborator

Problem

On an iOS simulator, apps foreground on the home screen returns a blank app name:

$ mobilecli apps foreground --device <simulator>
{"status": "ok", "data": {"packageName": "com.apple.springboard", "appName": " ", "version": "", "activity": "SBRootFolderController"}}

WDA names SpringBoard with a single space. A real device lists SpringBoard among its installed apps, so it reports "appName": "SpringBoard"; a simulator does not, so WDA's blank name is passed through. Clients that fall back to the package name only when the name is empty (mobile-mcp does) show a blank.

Fix

The part of wdaForegroundApp that builds the answer is moved into a pure function, foregroundAppFromWDA, so it can be unit-tested. When the app is not in the installed list and WDA's name is blank after trimming, it uses:

  • SpringBoard for com.apple.springboard, matching what a real device reports;
  • the bundle ID for any other app, matching what the Android foreground app does for an app with no label.

A non-blank WDA name, and an app found in the installed list, are handled as before.

Testing

  • e2e, written first and failing on main: should name the home screen SpringBoard, as a real device does failed with Expected: "SpringBoard", Received: " "; it passes with the fix.
  • Unit tests for foregroundAppFromWDA: blank SpringBoard name, blank name for another app, a name WDA reports, and an app found in the installed list.
  • Full simulator suite: 55 passed, 1 skipped (same skip as main).
  • go test ./... passes.

Found while QA-testing mobile-mcp (BUG-1).

… simulator

WDA names com.apple.springboard with a single space, and a simulator does
not list SpringBoard among its installed apps, so 'apps foreground' on the
home screen reported appName " ". Use 'SpringBoard', the name a real
device lists, and fall back to the bundle ID for any other blank name.
@coderabbitai

coderabbitai Bot commented Oct 6, 2026

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

This review includes 3 billable files and costs up to $0.75.

Or wait 51 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: mobile-next/mobilecli/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a93dc0dc-2302-4e35-a776-7fe1b034460e
📥 Commits

Reviewing files that changed from the base of the PR and between aca77be and 731148d.

📒 Files selected for processing (3)
  • devices/wda_foreground_app.go
  • devices/wda_foreground_app_test.go
  • test/simulator.spec.ts

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant