Skip to content

Commit

Permalink
fix: use arm64 naming for xctestrun (#840)
Browse files Browse the repository at this point in the history
* fix: use arm64 naming for xctestrun

* tweak
  • Loading branch information
KazuCocoa authored Jan 24, 2024
1 parent e011c7e commit 429e154
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { WDA_RUNNER_BUNDLE_ID, PLATFORM_NAME_TVOS } from './constants';
import B from 'bluebird';
import _fs from 'fs';
import { waitForCondition } from 'asyncbox';
import { arch } from 'os';

const PROJECT_FILE = 'project.pbxproj';

Expand Down Expand Up @@ -168,9 +169,9 @@ async function setRealDeviceSecurity (keychainPath, keychainPassword) {
/**
* Creates xctestrun file per device & platform version.
* We expects to have WebDriverAgentRunner_iphoneos${sdkVersion|platformVersion}-arm64.xctestrun for real device
* and WebDriverAgentRunner_iphonesimulator${sdkVersion|platformVersion}-x86_64.xctestrun for simulator located @bootstrapPath
* and WebDriverAgentRunner_iphonesimulator${sdkVersion|platformVersion}-${x86_64|arm64}.xctestrun for simulator located @bootstrapPath
* Newer Xcode (Xcode 10.0 at least) generate xctestrun file following sdkVersion.
* e.g. Xcode which has iOS SDK Version 12.2 generate WebDriverAgentRunner_iphonesimulator.2-x86_64.xctestrun
* e.g. Xcode which has iOS SDK Version 12.2 on an intel Mac host machine generates WebDriverAgentRunner_iphonesimulator.2-x86_64.xctestrun
* even if the cap has platform version 11.4
*
* @param {DeviceInfo} deviceInfo
Expand Down Expand Up @@ -260,9 +261,10 @@ async function getXctestrunFilePath (deviceInfo, sdkVersion, bootstrapPath) {
* @return {string} returns xctestrunFilePath for given device
*/
function getXctestrunFileName (deviceInfo, version) {
return isTvOS(deviceInfo.platformName)
? `WebDriverAgentRunner_tvOS_appletv${deviceInfo.isRealDevice ? `os${version}-arm64` : `simulator${version}-x86_64`}.xctestrun`
: `WebDriverAgentRunner_iphone${deviceInfo.isRealDevice ? `os${version}-arm64` : `simulator${version}-x86_64`}.xctestrun`;
const archSuffix = deviceInfo.isRealDevice
? `os${version}-arm64`
: `simulator${version}-${arch() === 'arm64' ? 'arm64' : 'x86_64'}`;
return `WebDriverAgentRunner_${isTvOS(deviceInfo.platformName) ? 'tvOS_appletv' : 'iphone'}${archSuffix}.xctestrun`;
}

/**
Expand Down

0 comments on commit 429e154

Please sign in to comment.