Skip to content

Commit 72d9657

Browse files
fix issue with getting list of apple devices and launching (tvos)
1 parent 613c291 commit 72d9657

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
{
22
"overrides": {
33
"build/tools/listDevices.js": {
4-
"const parsedSimctlOutput = Object.keys(simctlOutput.devices).map(key => simctlOutput.devices[key]).reduce((acc, val) => acc.concat(val), []);": "const parsedSimctlOutput = Object.keys(simctlOutput.devices)\n .map(key => {\n const runtimeVersionMatch = key.match(/-(\\d+-\\d+)/);\n const runtimeVersion = runtimeVersionMatch ? runtimeVersionMatch[1].replace('-', '.') : null;\n return simctlOutput.devices[key].map(sim => ({ ...sim, version: runtimeVersion, }));\n }).reduce((acc, val) => acc.concat(val), []); // <= PATCHED BY RENATIVE"
5-
}
4+
"const parsedSimctlOutput = Object.keys(simctlOutput.devices).map(key => simctlOutput.devices[key]).reduce((acc, val) => acc.concat(val), []);": "const parsedSimctlOutput = Object.keys(simctlOutput.devices)\n .map(key => {\n const runtimeVersionMatch = key.match(/-(\\d+-\\d+)/);\n const runtimeVersion = runtimeVersionMatch ? runtimeVersionMatch[1].replace('-', '.') : null;\n return simctlOutput.devices[key].map(sim => ({ ...sim, version: runtimeVersion, }));\n }).reduce((acc, val) => acc.concat(val), []); // <= PATCHED BY RENATIVE",
5+
"rawOutput.filter(device => sdkNames.includes(stripPlatform(device === null || device === void 0 ? void 0 : device.platform))).sort(device => device.simulator ? 1 : -1).map(device => {":"rawOutput.sort(device => device.simulator ? 1 : -1).map(device => { // <= PATCHED BY RENATIVE"
6+
},
7+
"build/commands/runCommand/installApp.js": {
8+
"}).trim();":"\n _child_process().default.spawnSync('xcrun', ['simctl', 'terminate', udid, bundleID]); // <= PATCHED BY RENATIVE"
9+
}
610
}
711
}
812

packages/sdk-apple/src/deviceManager.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,18 @@ export const getAppleDevices = async (ignoreDevices?: boolean, ignoreSimulators?
5656

5757
const _parseNewIOSDevicesList = (rawDevices: Array<DeviceType>) => {
5858
const decideIcon = (device: DeviceType) => {
59-
const { name } = device;
60-
if (name?.includes('iPhone') || name?.includes('iPod')) {
59+
const { name, sdk } = device;
60+
if (
61+
name?.includes('iPhone') ||
62+
name?.includes('iPod') ||
63+
sdk?.replace('com.apple.platform.', '') === 'iphoneos'
64+
) {
6165
return 'Phone 📱';
6266
}
6367
if (name?.includes('iPad')) {
6468
return 'Tablet 💊';
6569
}
66-
if (name?.includes('Apple TV')) {
70+
if (name?.includes('Apple TV') || sdk?.replace('com.apple.platform.', '') === 'appletvos') {
6771
return 'TV 📺';
6872
}
6973
return 'Apple Device';
@@ -77,7 +81,6 @@ const _parseNewIOSDevicesList = (rawDevices: Array<DeviceType>) => {
7781
name,
7882
icon,
7983
version,
80-
// modelName,
8184
isDevice: type === 'device',
8285
};
8386
});

0 commit comments

Comments
 (0)