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 logic to check for available ios devices for log-ios to work #1675

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/cli-platform-ios/src/commands/logIOS/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ import {Device} from '../../types';
function findAvailableDevice(devices: {[index: string]: Array<Device>}) {
for (const key of Object.keys(devices)) {
for (const device of devices[key]) {
if (device.availability === '(available)' && device.state === 'Booted') {
if (
(device.availability === '(available)' ||
device.isAvailable === true) &&
device.state === 'Booted'
) {
Copy link
Collaborator

@adamTrz adamTrz Aug 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @esthor thanks for the fix! 💪
Question - is there a chance that device is "Booted" and not available? 🤔
If not then I think this logic could be simplified a bit and we won't care anymore about availability v isAvailable mismatch :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you're probably right in this case. Will have to double-check, but it doesn't really make sense to be unavailable but Booted for a simulator, but similar logic was there before. Maybe there is an edge case 🤷

return device;
}
}
Expand Down