Forked from jasonbekolay/trigger webViewWebContentProcessDidTerminate in simulator
Created
November 7, 2025 02:17
-
-
Save srea/3d4af07ad0815feb9adf38c772f23402 to your computer and use it in GitHub Desktop.
Killing a WKWebView content process in the iOS simulator to trigger a webViewWebContentProcessDidTerminate call
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
| # In the command line, find the PID of your simulator process: | |
| ps -p `pgrep launchd_sim` | |
| # or if you have many simulators running: | |
| ps -A | grep launchd_sim | |
| # Find the PID of the WebContent process: | |
| pgrep -P <simulator-pid> 'com.apple.WebKit.WebContent' | |
| # kill it | |
| kill <webcontent-pid> | |
| # or if you want a one-lner: | |
| kill $(pgrep -P $(pgrep launchd_sim) 'com.apple.WebKit.WebContent') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment