Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] Update simctl command in device_manager.rb [21893] #21894

Merged
merged 2 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion fastlane_core/lib/fastlane_core/device_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def all(requested_os_type = "")

def runtime_build_os_versions
@runtime_build_os_versions ||= begin
output, status = Open3.capture2('xcrun simctl list runtimes -j')
output, status = Open3.capture2('xcrun simctl list -j runtimes')
raise status unless status.success?
json = JSON.parse(output)
json['runtimes'].map { |h| [h['buildversion'], h['version']] }.to_h
Expand Down
4 changes: 2 additions & 2 deletions fastlane_core/spec/device_manager_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

it 'raises an error if broken xcrun simctl list runtimes' do
status = double('status', "success?": true)
expect(Open3).to receive(:capture2).with("xcrun simctl list runtimes -j").and_return(['garbage', status])
expect(Open3).to receive(:capture2).with("xcrun simctl list -j runtimes").and_return(['garbage', status])

expect do
FastlaneCore::DeviceManager.runtime_build_os_versions
Expand Down Expand Up @@ -439,7 +439,7 @@
it 'properly parses `xcrun simctl list runtimes` to associate runtime builds with their exact OS version' do
status = double('status', "success?": true)
runtime_output = File.read('./fastlane_core/spec/fixtures/XcrunSimctlListRuntimesOutput')
expect(Open3).to receive(:capture2).with("xcrun simctl list runtimes -j").and_return([runtime_output, status])
expect(Open3).to receive(:capture2).with("xcrun simctl list -j runtimes").and_return([runtime_output, status])

expect(FastlaneCore::DeviceManager.runtime_build_os_versions['21A328']).to eq('17.0')
expect(FastlaneCore::DeviceManager.runtime_build_os_versions['21A342']).to eq('17.0.1')
Expand Down