Bug 199852 - run-safari --ios-simulator is no longer working with Xcode 11
Summary: run-safari --ios-simulator is no longer working with Xcode 11
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Frédéric Wang (:fredw)
Keywords: InRadar
Depends on:
Blocks: 202263
  Show dependency treegraph
Reported: 2019-07-17 03:17 PDT by Frédéric Wang (:fredw)
Modified: 2019-09-26 14:54 PDT (History)
6 users (show)

See Also:

Patch (1.61 KB, patch)
2019-09-26 13:54 PDT, Frédéric Wang (:fredw)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Frédéric Wang (:fredw) 2019-07-17 03:17:43 PDT
XCode relase and beta use different paths for MobileSafari.app:

$ find Xcode.app -name MobileSafari.app

$ find Xcode-beta.app -name MobileSafari.app

(note that "Developer" and "Library" have been switched)

A trivial patch to make things work again is:

diff --git a/Tools/Scripts/webkitdirs.pm b/Tools/Scripts/webkitdirs.pm
index 1374b4b3f2..c011655669 100755
--- a/Tools/Scripts/webkitdirs.pm
+++ b/Tools/Scripts/webkitdirs.pm
@@ -2503,7 +2503,7 @@ sub setupIOSWebKitEnvironment($)
 sub iosSimulatorApplicationsPath()
     # FIXME: We should ask simctl for this information, instead of guessing from available runtimes.
-    my $runtimePath = File::Spec->catdir(sdkPlatformDirectory("iphoneos"), "Developer", "Library", "CoreSimulator", "Profiles", "Runtimes");
+    my $runtimePath = File::Spec->catdir(sdkPlatformDirectory("iphoneos"), "Library", "Developer", "CoreSimulator", "Profiles", "Runtimes");
     opendir(RUNTIMES, $runtimePath);
     my @runtimes = grep {/.*\.simruntime/} readdir(RUNTIMES);

but of course that will break backward compatibility...
Comment 1 Radar WebKit Bug Importer 2019-09-26 03:26:17 PDT
Comment 2 Frédéric Wang (:fredw) 2019-09-26 05:27:03 PDT
This bug now happens on Mojave with the recent XCode 11 release.
Comment 3 Jonathan Bedard 2019-09-26 07:22:13 PDT
We can totally break iOS 12 at this point, so the 'trivial patch' is probably the way to go.
Comment 4 Frédéric Wang (:fredw) 2019-09-26 13:54:22 PDT
Created attachment 379676 [details]

OK let's do that.
Comment 5 WebKit Commit Bot 2019-09-26 14:54:37 PDT
Comment on attachment 379676 [details]

Clearing flags on attachment: 379676

Committed r250400: <https://trac.webkit.org/changeset/250400>
Comment 6 WebKit Commit Bot 2019-09-26 14:54:39 PDT
All reviewed patches have been landed.  Closing bug.