Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
d5225a56
Unverified
Commit
d5225a56
authored
Jun 29, 2020
by
Jenn Magder
Committed by
GitHub
Jun 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix daemon device discovery crash when Xcode isn't installed (#60546)
parent
09cca73a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
devices.dart
packages/flutter_tools/lib/src/ios/devices.dart
+4
-1
devices_test.dart
...es/flutter_tools/test/general.shard/ios/devices_test.dart
+13
-0
No files found.
packages/flutter_tools/lib/src/ios/devices.dart
View file @
d5225a56
...
@@ -64,6 +64,9 @@ class IOSDevices extends PollingDeviceDiscovery {
...
@@ -64,6 +64,9 @@ class IOSDevices extends PollingDeviceDiscovery {
'Control of iOS devices or simulators only supported on macOS.'
'Control of iOS devices or simulators only supported on macOS.'
);
);
}
}
if
(!
_xcdevice
.
isInstalled
)
{
return
;
}
deviceNotifier
??=
ItemListNotifier
<
Device
>();
deviceNotifier
??=
ItemListNotifier
<
Device
>();
...
@@ -72,7 +75,7 @@ class IOSDevices extends PollingDeviceDiscovery {
...
@@ -72,7 +75,7 @@ class IOSDevices extends PollingDeviceDiscovery {
// cancel any outstanding subscriptions.
// cancel any outstanding subscriptions.
await
_observedDeviceEventsSubscription
?.
cancel
();
await
_observedDeviceEventsSubscription
?.
cancel
();
_observedDeviceEventsSubscription
=
_xcdevice
.
observedDeviceEvents
().
listen
(
_observedDeviceEventsSubscription
=
_xcdevice
.
observedDeviceEvents
()
?
.
listen
(
_onDeviceEvent
,
_onDeviceEvent
,
onError:
(
dynamic
error
,
StackTrace
stack
)
{
onError:
(
dynamic
error
,
StackTrace
stack
)
{
_logger
.
printTrace
(
'Process exception running xcdevice observe:
\n
$error
\n
$stack
'
);
_logger
.
printTrace
(
'Process exception running xcdevice observe:
\n
$error
\n
$stack
'
);
...
...
packages/flutter_tools/test/general.shard/ios/devices_test.dart
View file @
d5225a56
...
@@ -370,6 +370,19 @@ void main() {
...
@@ -370,6 +370,19 @@ void main() {
);
);
});
});
testWithoutContext
(
'start polling without Xcode'
,
()
async
{
final
IOSDevices
iosDevices
=
IOSDevices
(
platform:
macPlatform
,
xcdevice:
mockXcdevice
,
iosWorkflow:
mockIosWorkflow
,
logger:
logger
,
);
when
(
mockXcdevice
.
isInstalled
).
thenReturn
(
false
);
await
iosDevices
.
startPolling
();
verifyNever
(
mockXcdevice
.
getAvailableIOSDevices
());
});
testWithoutContext
(
'start polling'
,
()
async
{
testWithoutContext
(
'start polling'
,
()
async
{
final
IOSDevices
iosDevices
=
IOSDevices
(
final
IOSDevices
iosDevices
=
IOSDevices
(
platform:
macPlatform
,
platform:
macPlatform
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment