<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>293831</bug_id>
          
          <creation_ts>2025-05-30 14:51:28 -0700</creation_ts>
          <short_desc>Crash when using libswiftWebKit APIs in iOS 18.5 simulator</short_desc>
          <delta_ts>2025-06-05 13:37:56 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit API</component>
          <version>Other</version>
          <rep_platform>Other</rep_platform>
          <op_sys>iOS 18</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Elliott Williams">emw</reporter>
          <assigned_to name="Elliott Williams">emw</assigned_to>
          <cc>ap</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2120795</commentid>
    <comment_count>0</comment_count>
    <who name="Elliott Williams">emw</who>
    <bug_when>2025-05-30 14:51:28 -0700</bug_when>
    <thetext>Some apps fail to launch in iOS 18.5 simulator with an error that says:

```
Library not loaded: /usr/lib/swift/libswiftWebKit.dylib
```

and later, variations of:

```
tried: &apos;... Build/Products/Debug-iphonesimulator/libswiftWebKit.dylib&apos; (no such file)
```

This happens to apps that have a deployment target of iOS 18.3 or older, and use WebKit APIs which are annotated with NS_REFINED_FOR_SWIFT. These are:

```
WKPDFConfiguration.rect
WKWebView.callAsyncJavaScript(_:arguments:in:in:completionHandler:)
WKWebView.callAsyncJavaScript(_:arguments:in:contentWorld:)
WKWebView.createPDF(configuration:completionHandler:)
WKWebView.pdf(configuration:)
WKWebView.createWebArchiveData(completionHandler:)
WKWebView.evaluateJavaScript(_:in:in:completionHandler:)
WKWebView.evaluateJavaScript(_:in:contentWorld:)
WKWebView.find(_:configuration:completionHandler:)
WKWebView.find(_:configuration:)
WKWebsiteDataStore.proxyConfigurations
```</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2120797</commentid>
    <comment_count>1</comment_count>
    <who name="Elliott Williams">emw</who>
    <bug_when>2025-05-30 14:52:03 -0700</bug_when>
    <thetext>rdar://152200884</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2120810</commentid>
    <comment_count>2</comment_count>
    <who name="Elliott Williams">emw</who>
    <bug_when>2025-05-30 15:16:34 -0700</bug_when>
    <thetext>At this time, there are some workarounds that developers can use for testing and debugging in iOS 18.5 simulator:

Option 1: Change your app&apos;s deployment target to iOS 18.4 or later.

1. Set `IPHONEOS_DEPLOYMENT_TARGET = 18.4` in build settings, or use Xcode&apos;s UI: Select the app&apos;s target in a xcodeproj file, then go to General &gt; Minimum Deployments &gt; iOS and set it to 18.4.

2. Rebuild the app.

---

Option 2: Set DYLD_FALLBACK_LIBRARY_PATH in the app&apos;s run action. This will allow you to test in iOS 18.5 simulator while continuing to deploy to older OS versions.

1. Find the simulator runtime&apos;s path using `xcrun simctl list runtimes -v`. It will be a path like &quot;/Library/Developer/CoreSimulator/Volumes/iOS_22F77/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.5.simruntime&quot;.

2. Add &quot;Contents/Resources/RuntimeRoot/System/Cryptexes/OS/usr/lib/swift&quot; to this path.

3. In Xcode, navigate to the launch arguments pane of your app&apos;s scheme. (Product &gt; Scheme &gt; Edit Scheme &gt; Run &gt; Arguments). Add a &quot;DYLD_FALLBACK_LIBRARY_PATH&quot; environment variable, whose value is the path you computed. It will be something like this:

```
DYLD_FALLBACK_LIBRARY_PATH = /Library/Developer/CoreSimulator/Volumes/iOS_22F77/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.5.simruntime/Contents/Resources/RuntimeRoot/System/Cryptexes/OS/usr/lib/swift
```

4. Run the app (no need to rebuild).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2120820</commentid>
    <comment_count>3</comment_count>
    <who name="Elliott Williams">emw</who>
    <bug_when>2025-05-30 16:00:23 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/46146</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2121931</commentid>
    <comment_count>4</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2025-06-05 09:48:26 -0700</bug_when>
    <thetext>Committed 295876@main (d53b778e73ac): &lt;https://commits.webkit.org/295876@main&gt;

Reviewed commits have been landed. Closing PR #46146 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2121959</commentid>
    <comment_count>5</comment_count>
    <who name="Elliott Williams">emw</who>
    <bug_when>2025-06-05 11:45:01 -0700</bug_when>
    <thetext>Re-opening for pull request https://github.com/apple/WebKit/pull/3150</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2121984</commentid>
    <comment_count>6</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2025-06-05 13:37:54 -0700</bug_when>
    <thetext>Committed 289651.558@safari-7621-branch (074e23185bb1): &lt;https://commits.webkit.org/289651.558@safari-7621-branch&gt;

Reviewed commits have been landed. Closing PR #3150 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>