From 8f44170007aa17484f534152ea21e9673639bec1 Mon Sep 17 00:00:00 2001 From: mwakizaka <21286384+mwakizaka@users.noreply.github.com> Date: Tue, 31 Oct 2023 17:48:07 +0900 Subject: [PATCH 1/2] fix: appropriately translate some system prompts on some environments such as iOS 16.1 simulator x Xcode 15.0 x CoreSimulator-932.2 x xcrun version 67 --- lib/simulator-xcode-9.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/simulator-xcode-9.js b/lib/simulator-xcode-9.js index 038fea4..5d51d67 100644 --- a/lib/simulator-xcode-9.js +++ b/lib/simulator-xcode-9.js @@ -579,9 +579,10 @@ class SimulatorXcode9 extends SimulatorXcode8 { } if (globalPrefs.AppleLanguages) { - // In order to translate com.apple.SpringBoard, system prompts - // for push notification and system prompts for location - await B.all(['com.apple.SpringBoard', 'com.apple.locationd'] + // com.apple.SpringBoard: translates com.apple.SpringBoard and system prompts for push notification + // com.apple.locationd: translates system prompts for location + // com.apple.tccd: translates system prompts for camera, microphone, contact, photos and app tracking transparency + await B.all(['com.apple.SpringBoard', 'com.apple.locationd', 'com.apple.tccd'] .map((arg) => this.simctl.spawnProcess([ 'launchctl', 'stop', arg ])) From 549e148380e31939503738cf29895d37e9d957b9 Mon Sep 17 00:00:00 2001 From: mwakizaka <21286384+mwakizaka@users.noreply.github.com> Date: Wed, 1 Nov 2023 07:30:20 +0900 Subject: [PATCH 2/2] refactor: introduce a constant for services --- lib/simulator-xcode-9.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/simulator-xcode-9.js b/lib/simulator-xcode-9.js index 5d51d67..b3578b1 100644 --- a/lib/simulator-xcode-9.js +++ b/lib/simulator-xcode-9.js @@ -19,6 +19,10 @@ const startupLock = new AsyncLock(); const preferencesPlistGuard = new AsyncLock(); const ENROLLMENT_NOTIFICATION_RECEIVER = 'com.apple.BiometricKit.enrollmentChanged'; const DOMAIN_KEYBOARD_PREFERENCES = 'com.apple.keyboard.preferences'; +// com.apple.SpringBoard: translates com.apple.SpringBoard and system prompts for push notification +// com.apple.locationd: translates system prompts for location +// com.apple.tccd: translates system prompts for camera, microphone, contact, photos and app tracking transparency +const SERVICES_FOR_TRANSLATION = ['com.apple.SpringBoard', 'com.apple.locationd', 'com.apple.tccd']; /** * Creates device and common Simulator preferences, which could @@ -579,14 +583,9 @@ class SimulatorXcode9 extends SimulatorXcode8 { } if (globalPrefs.AppleLanguages) { - // com.apple.SpringBoard: translates com.apple.SpringBoard and system prompts for push notification - // com.apple.locationd: translates system prompts for location - // com.apple.tccd: translates system prompts for camera, microphone, contact, photos and app tracking transparency - await B.all(['com.apple.SpringBoard', 'com.apple.locationd', 'com.apple.tccd'] - .map((arg) => this.simctl.spawnProcess([ - 'launchctl', 'stop', arg - ])) - ); + await B.all(SERVICES_FOR_TRANSLATION.map((arg) => this.simctl.spawnProcess([ + 'launchctl', 'stop', arg + ]))); } return true;