From 6fe1c9feabb2ab44aa023627b6da8f2ccd5c9f82 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Mon, 16 Jan 2017 18:34:57 +0100 Subject: [PATCH] [tests] Use a different bundle id for different apps that can be installed on the same device. (#1509) * [tests] Use a different bundle id for different apps that can be installed on the same device. * [xharness] Add workaround for radar #29847128. --- tests/monotouch-test/CoreFoundation/BundleTest.cs | 2 +- tests/xharness/WatchOSTarget.cs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/monotouch-test/CoreFoundation/BundleTest.cs b/tests/monotouch-test/CoreFoundation/BundleTest.cs index 612a7bb683..536c9a78d1 100644 --- a/tests/monotouch-test/CoreFoundation/BundleTest.cs +++ b/tests/monotouch-test/CoreFoundation/BundleTest.cs @@ -74,7 +74,7 @@ namespace MonoTouchFixtures.CoreFoundation { { var main = CFBundle.GetMain (); #if __WATCHOS__ - var expectedBundleId = "com.xamarin.monotouch-test.watchkitapp.watchkitextension"; + var expectedBundleId = "com.xamarin.monotouch-test-watch.watchkitapp.watchkitextension"; #elif MONOMAC var expectedBundleId = "com.xamarin.xammac_tests"; #else diff --git a/tests/xharness/WatchOSTarget.cs b/tests/xharness/WatchOSTarget.cs index 743d0a4626..6644cc6220 100644 --- a/tests/xharness/WatchOSTarget.cs +++ b/tests/xharness/WatchOSTarget.cs @@ -90,7 +90,9 @@ namespace xharness XmlDocument info_plist = new XmlDocument (); var target_info_plist = Path.Combine (TargetDirectory, "Info-watchos-extension.plist"); info_plist.LoadWithoutNetworkAccess (Path.Combine (TargetDirectory, "Info.plist")); - BundleIdentifier = info_plist.GetCFBundleIdentifier (); + BundleIdentifier = info_plist.GetCFBundleIdentifier () + "-watch"; + if (BundleIdentifier.Length >= 58) + BundleIdentifier = BundleIdentifier.Substring (0, 57); // If the main app's bundle id is 58 characters (or sometimes more), then the watch extension crashes at launch. radar #29847128. info_plist.SetCFBundleIdentifier (BundleIdentifier + ".watchkitapp.watchkitextension"); info_plist.SetMinimumOSVersion ("2.0"); info_plist.SetUIDeviceFamily (4);