Skip to content

Commit 0f608a0

Browse files
committed
tweak xctestrun
1 parent 9deda0e commit 0f608a0

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

test/test_helper.rb

+7-5
Original file line numberDiff line numberDiff line change
@@ -115,26 +115,28 @@ def ios
115115
}
116116
}
117117

118-
xcode_org_id = ENV['ORG_ID'] || ''
118+
xcode_org_id = ENV['ORG_ID'] || 'Simulator'
119119
cap = add_ios_real_device(cap.dup, xcode_org_id) if real_device
120-
cap = add_xctestrun(real_device, cap.dup, xcode_org_id, platform_version)
120+
cap = add_xctestrun(real_device, cap.dup, xcode_org_id)
121121

122122
cap
123123
end
124124

125125
private
126126

127127
# for use_xctestrun_file
128-
def add_xctestrun(real_device, caps, xcode_org_id, platform_version)
128+
def add_xctestrun(real_device, caps, xcode_org_id)
129+
xcode_sdk_version = /iPhoneOS([0-9\.]+)\.sdk/.match(`xcodebuild -version -sdk`)[1]
130+
129131
derived_data_path = File.expand_path("tmp/#{xcode_org_id}")
130132
FileUtils.mkdir_p(derived_data_path) unless File.exist? derived_data_path
131133
caps[:caps][:derivedDataPath] = derived_data_path
132134

133135
build_product = File.expand_path("#{derived_data_path}/Build/Products/")
134136
xctestrun_path = if real_device
135-
"#{build_product}/WebDriverAgentRunner_iphoneos#{platform_version}-arm64.xctestrun"
137+
"#{build_product}/WebDriverAgentRunner_iphoneos#{xcode_sdk_version}-arm64.xctestrun"
136138
else
137-
"#{build_product}/WebDriverAgentRunner_iphonesimulator#{platform_version}-x86_64.xctestrun"
139+
"#{build_product}/WebDriverAgentRunner_iphonesimulator#{xcode_sdk_version}-x86_64.xctestrun"
138140
end
139141
use_xctestrun_file = File.exist?(xctestrun_path) ? true : false
140142

0 commit comments

Comments
 (0)