Repository navigation
fix(ios): name the home screen SpringBoard in the foreground app on a simulator - #502
Open
mobile-kevin wants to merge 1 commit into
Open
mobile-kevin wants to merge 1 commit into
mobile-kevin wants to merge 1 commit into
Conversation
… 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.
|
Warning Review limit reached
This review includes 3 billable files and costs up to $0.75. Or wait 51 minutes for your next included review. View limit detailsLimit details: You’ve used all 2 included reviews currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (3)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On an iOS simulator,
apps foregroundon the home screen returns a blank app name: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
wdaForegroundAppthat 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:SpringBoardforcom.apple.springboard, matching what a real device reports;A non-blank WDA name, and an app found in the installed list, are handled as before.
Testing
main:should name the home screen SpringBoard, as a real device doesfailed withExpected: "SpringBoard",Received: " "; it passes with the fix.foregroundAppFromWDA: blank SpringBoard name, blank name for another app, a name WDA reports, and an app found in the installed list.main).go test ./...passes.Found while QA-testing mobile-mcp (BUG-1).