Skip to content

Commit

Permalink
Merge branch 'fix-list-ios-devices' of github.com:adamTrz/cli into fi…
Browse files Browse the repository at this point in the history
…x-list-ios-devices
  • Loading branch information
adamTrz committed Feb 7, 2023
2 parents 58c705c + 9f7dd19 commit 6dcd752
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 40 deletions.
2 changes: 1 addition & 1 deletion packages/cli-platform-ios/src/commands/runIOS/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ async function runIOS(_: Array<string>, ctx: Config, args: FlagsT) {
}
} else if (modifiedArgs.device) {
const physicalDevices = availableDevices.filter(
(d) => d.type !== 'simulator',
({type}) => type !== 'simulator',
);
const device = matchingDevice(physicalDevices, modifiedArgs.device);
if (device) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -888,43 +888,6 @@ describe('findMatchingSimulator', () => {
).toEqual(null);
});

it('should return AppleTV devices if in the list', () => {
expect(
findMatchingSimulator(
{
devices: {
'com.apple.CoreSimulator.SimRuntime.tvOS-11-2': [
{
state: 'Booted',
availability: '(available)',
name: 'Apple TV',
udid: '816C30EA-38EA-41AC-BFDA-96FB632D522E',
},
{
state: 'Shutdown',
availability: '(available)',
name: 'Apple TV 4K',
udid: 'BCBB7E4B-D872-4D61-BC61-7C9805551075',
},
{
state: 'Shutdown',
availability: '(available)',
name: 'Apple TV 4K (at 1080p)',
udid: '1DE12308-1C14-4F0F-991E-A3ADC41BDFFC',
},
],
},
},
{simulator: 'Apple TV'},
),
).toEqual({
udid: '816C30EA-38EA-41AC-BFDA-96FB632D522E',
name: 'Apple TV',
booted: true,
version: 'tvOS 11.2',
});
});

it('should return a simulator by UDID', () => {
expect(
findMatchingSimulator(
Expand Down
3 changes: 1 addition & 2 deletions packages/cli-platform-ios/src/tools/listIOSDevices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ const parseXcdeviceList = (text: string): Device[] => {

async function listIOSDevices(): Promise<Device[]> {
const out = execa.sync('xcrun', ['xcdevice', 'list']).stdout;
const devices = parseXcdeviceList(out);
return devices;
return parseXcdeviceList(out);
}

export default listIOSDevices;

0 comments on commit 6dcd752

Please sign in to comment.