lib/snapshot/test_command_generator.rb in snapshot-1.3.0 vs lib/snapshot/test_command_generator.rb in snapshot-1.4.0
- old
+ new
@@ -33,13 +33,10 @@
options = []
options += project_path_array
options << "-configuration '#{config[:configuration]}'" if config[:configuration]
options << "-sdk '#{config[:sdk]}'" if config[:sdk]
options << "-derivedDataPath '#{derived_data_path}'"
- # options << "-xcconfig '#{config[:xcconfig]}'" if config[:xcconfig]
- # options << "-archivePath '#{archive_path}'"
- # options << config[:xcargs] if config[:xcargs]
options
end
def actions
@@ -57,11 +54,11 @@
def pipe
["| tee '#{xcodebuild_log_path}' | xcpretty"]
end
- def destination(device)
+ def device_udid(device)
# we now fetch the device's udid. Why? Because we might get this error message
# > The requested device could not be found because multiple devices matched the request.
#
# This happens when you have multiple simulators for a given device type / iOS combination
# { platform:iOS Simulator, id:1685B071-AFB2-4DC1-BE29-8370BA4A6EBD, OS:9.0, name:iPhone 5 }
@@ -71,10 +68,14 @@
device_udid = nil
FastlaneCore::Simulator.all.each do |sim|
device_udid = sim.udid if sim.name.strip == device.strip and sim.ios_version == Snapshot.config[:ios_version]
end
- value = "platform=iOS Simulator,id=#{device_udid},OS=#{Snapshot.config[:ios_version]}"
+ return device_udid
+ end
+
+ def destination(device)
+ value = "platform=iOS Simulator,id=#{device_udid(device)},OS=#{Snapshot.config[:ios_version]}"
return ["-destination '#{value}'"]
end
def xcodebuild_log_path