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
aba0c4e6
Unverified
Commit
aba0c4e6
authored
Jun 18, 2022
by
Jenn Magder
Committed by
GitHub
Jun 18, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not show diagnostic warning for disconnected iOS devices (#105971)
parent
a4f817c2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
1 deletion
+43
-1
xcdevice.dart
packages/flutter_tools/lib/src/macos/xcdevice.dart
+12
-1
xcode_test.dart
...es/flutter_tools/test/general.shard/macos/xcode_test.dart
+31
-0
No files found.
packages/flutter_tools/lib/src/macos/xcdevice.dart
View file @
aba0c4e6
...
...
@@ -354,7 +354,10 @@ class XCDevice {
return
error
is
Map
<
String
,
Object
?>
?
error
:
null
;
}
static
int
?
_errorCode
(
Map
<
String
,
Object
?>
errorProperties
)
{
static
int
?
_errorCode
(
Map
<
String
,
Object
?>?
errorProperties
)
{
if
(
errorProperties
==
null
)
{
return
null
;
}
final
Object
?
code
=
errorProperties
[
'code'
];
return
code
is
int
?
code
:
null
;
}
...
...
@@ -521,6 +524,14 @@ class XCDevice {
final
Map
<
String
,
Object
?>?
errorProperties
=
_errorProperties
(
deviceProperties
);
final
String
?
errorMessage
=
_parseErrorMessage
(
errorProperties
);
if
(
errorMessage
!=
null
)
{
final
int
?
code
=
_errorCode
(
errorProperties
);
// Error -13: iPhone is not connected. Xcode will continue when iPhone is connected.
// This error is confusing since the device is not connected and maybe has not been connected
// for a long time. Avoid showing it.
if
(
code
==
-
13
&&
errorMessage
.
contains
(
'not connected'
))
{
continue
;
}
diagnostics
.
add
(
errorMessage
);
}
}
...
...
packages/flutter_tools/test/general.shard/macos/xcode_test.dart
View file @
aba0c4e6
...
...
@@ -788,6 +788,35 @@ void main() {
"recoverySuggestion" : "Xcode will continue when iPhone is finished.",
"domain" : "com.apple.platform.iphoneos"
}
},
{
"modelCode" : "iPad8,5",
"simulator" : false,
"modelName" : "iPad Pro (12.9-inch) (3rd generation)",
"error" : {
"code" : -13,
"failureReason" : "",
"underlyingErrors" : [
{
"code" : 4,
"failureReason" : "",
"description" : "iPad is locked.",
"recoverySuggestion" : "To use iPad with Xcode, unlock it.",
"domain" : "DVTDeviceIneligibilityErrorDomain"
}
],
"description" : "iPad is not connected",
"recoverySuggestion" : "Xcode will continue when iPad is connected.",
"domain" : "com.apple.platform.iphoneos"
},
"operatingSystemVersion" : "15.6 (19G5027e)",
"identifier" : "00008027-0019253601068123",
"platform" : "com.apple.platform.iphoneos",
"architecture" : "arm64e",
"interface" : "usb",
"available" : false,
"name" : "iPad",
"modelUTI" : "com.apple.ipad-pro-12point9-1"
}
]
'''
;
...
...
@@ -799,10 +828,12 @@ void main() {
final
List
<
String
>
errors
=
await
xcdevice
.
getDiagnostics
();
expect
(
errors
,
hasLength
(
4
));
expect
(
errors
[
0
],
'Error: iPhone is not paired with your computer. To use iPhone with Xcode, unlock it and choose to trust this computer when prompted. (code -9)'
);
expect
(
errors
[
1
],
'Error: iPhone is not paired with your computer.'
);
expect
(
errors
[
2
],
'Error: Xcode pairing error. (code -13)'
);
expect
(
errors
[
3
],
'Error: iPhone is busy: Preparing debugger support for iPhone. Xcode will continue when iPhone is finished. (code -10)'
);
expect
(
errors
,
isNot
(
contains
(
'Xcode will continue'
)));
expect
(
fakeProcessManager
.
hasRemainingExpectations
,
isFalse
);
},
overrides:
<
Type
,
Generator
>{
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