@@ -115,26 +115,28 @@ def ios
115
115
}
116
116
}
117
117
118
- xcode_org_id = ENV [ 'ORG_ID' ] || ''
118
+ xcode_org_id = ENV [ 'ORG_ID' ] || 'Simulator '
119
119
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 )
121
121
122
122
cap
123
123
end
124
124
125
125
private
126
126
127
127
# 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
+
129
131
derived_data_path = File . expand_path ( "tmp/#{ xcode_org_id } " )
130
132
FileUtils . mkdir_p ( derived_data_path ) unless File . exist? derived_data_path
131
133
caps [ :caps ] [ :derivedDataPath ] = derived_data_path
132
134
133
135
build_product = File . expand_path ( "#{ derived_data_path } /Build/Products/" )
134
136
xctestrun_path = if real_device
135
- "#{ build_product } /WebDriverAgentRunner_iphoneos#{ platform_version } -arm64.xctestrun"
137
+ "#{ build_product } /WebDriverAgentRunner_iphoneos#{ xcode_sdk_version } -arm64.xctestrun"
136
138
else
137
- "#{ build_product } /WebDriverAgentRunner_iphonesimulator#{ platform_version } -x86_64.xctestrun"
139
+ "#{ build_product } /WebDriverAgentRunner_iphonesimulator#{ xcode_sdk_version } -x86_64.xctestrun"
138
140
end
139
141
use_xctestrun_file = File . exist? ( xctestrun_path ) ? true : false
140
142
0 commit comments