Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove previous app button #659

Merged
merged 3 commits into from
Oct 28, 2024
Merged

Conversation

filip131311
Copy link
Collaborator

This PR removes the "previous app button" from top left corner of the ios simulator. Before this change If the user switched workspaces without shouting down the ios simulator, the button pointing to the previous app would appear in top left corner of the application. Clicking the button would break the IDE functionality as there is no way of navigating through the simulator and the only way to recover would be to restart app process (which would still leave the button in the corner).

The solution it to terminate any open applications before launching a new one.

Screenshot 2024-10-24 at 20 34 01

How Has This Been Tested:

  • open an application ios using IDE
  • switch workspaces without closing ide
  • in the new workspace open the ios application using the same device
  • switch workspaces back to the original one without closing ide

Copy link

vercel bot commented Oct 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
radon-ide ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 28, 2024 8:42am

Copy link
Member

@kmagiera kmagiera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if I like this approach, it may terminate some system processes if I understand correctly. Instead of doing that, maybe there is a way to force opening home screen right before launching. This way the handoff button should be gone as well?

@filip131311
Copy link
Collaborator Author

This Portion of the regex ApplicationType = User; makes sure we don't try to close any system processes/applications and It was tricky to find a way to force simulator to home screen, there might be a way on sim-server side, but I couldn't find a command through xcrun.

Comment on lines +287 to +291
await exec(
"xcrun",
["simctl", "--set", deviceSetLocation, "terminate", this.deviceUDID, bundleID],
{ allowNonZeroExit: true }
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would likely be better to use Promise.all to await on all the commands

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines 301 to 305
await Promise.all(
matches.map((bundleID) => {
return terminateApp(bundleID);
})
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
await Promise.all(
matches.map((bundleID) => {
return terminateApp(bundleID);
})
);
await Promise.all(matches.map(terminateApp));

@filip131311 filip131311 merged commit a52051a into main Oct 28, 2024
4 checks passed
@filip131311 filip131311 deleted the @Filip131311/FixPreviousAppButton branch October 28, 2024 08:43
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.

2 participants