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
ff84b3e6
Commit
ff84b3e6
authored
5 years ago
by
Christopher Fujino
Committed by
GitHub
5 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
catch IOSDeviceNotFoundError in IOSDevice.startApp() (#45011)
parent
01b0a629
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
devices.dart
packages/flutter_tools/lib/src/ios/devices.dart
+9
-1
devices_test.dart
...es/flutter_tools/test/general.shard/ios/devices_test.dart
+16
-0
No files found.
packages/flutter_tools/lib/src/ios/devices.dart
View file @
ff84b3e6
...
...
@@ -282,7 +282,15 @@ class IOSDevice extends Device {
// TODO(chinmaygarde): Use mainPath, route.
printTrace
(
'Building
${package.name}
for
$id
'
);
final
String
cpuArchitecture
=
await
iMobileDevice
.
getInfoForDevice
(
id
,
'CPUArchitecture'
);
String
cpuArchitecture
;
try
{
cpuArchitecture
=
await
iMobileDevice
.
getInfoForDevice
(
id
,
'CPUArchitecture'
);
}
on
IOSDeviceNotFoundError
catch
(
e
)
{
printError
(
e
.
message
);
return
LaunchResult
.
failed
();
}
final
DarwinArch
iosArch
=
getIOSArchForName
(
cpuArchitecture
);
// Step 1: Build the precompiled/DBC application if necessary.
...
...
This diff is collapsed.
Click to expand it.
packages/flutter_tools/test/general.shard/ios/devices_test.dart
View file @
ff84b3e6
...
...
@@ -249,6 +249,22 @@ void main() {
Cache
.
enableLocking
();
});
testUsingContext
(
'returns failed if the IOSDevice is not found'
,
()
async
{
final
IOSDevice
device
=
IOSDevice
(
'123'
);
when
(
mockIMobileDevice
.
getInfoForDevice
(
any
,
'CPUArchitecture'
)).
thenThrow
(
const
IOSDeviceNotFoundError
(
'ideviceinfo could not find device:
\n
'
'No device found with udid 123, is it plugged in?
\n
'
'Try unlocking attached devices.'
)
);
final
LaunchResult
result
=
await
device
.
startApp
(
mockApp
);
expect
(
result
.
started
,
false
);
},
overrides:
<
Type
,
Generator
>{
IMobileDevice:
()
=>
mockIMobileDevice
,
Platform:
()
=>
macPlatform
,
});
testUsingContext
(
' succeeds in debug mode via mDNS'
,
()
async
{
final
IOSDevice
device
=
IOSDevice
(
'123'
);
device
.
portForwarder
=
mockPortForwarder
;
...
...
This diff is collapsed.
Click to expand it.
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