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
15e69441
Unverified
Commit
15e69441
authored
Oct 27, 2022
by
Jenn Magder
Committed by
GitHub
Oct 27, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Terminate simulator app on "q" (#114114)
parent
8aad1190
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
4 deletions
+55
-4
hot_mode_dev_cycle_ios_simulator.dart
...devicelab/bin/tasks/hot_mode_dev_cycle_ios_simulator.dart
+1
-1
simulators.dart
packages/flutter_tools/lib/src/ios/simulators.dart
+24
-3
simulators_test.dart
...flutter_tools/test/general.shard/ios/simulators_test.dart
+30
-0
No files found.
dev/devicelab/bin/tasks/hot_mode_dev_cycle_ios_simulator.dart
View file @
15e69441
...
...
@@ -16,7 +16,7 @@ Future<void> main() async {
await
testWithNewIOSSimulator
(
'TestHotReloadSim'
,
(
String
deviceId
)
async
{
simulatorDeviceId
=
deviceId
;
// This isn't actually a benchmark test, so do not use the returned `benchmarkScoreKeys` result.
await
createHotModeTest
(
deviceIdOverride:
deviceId
)();
await
createHotModeTest
(
deviceIdOverride:
deviceId
,
checkAppRunningOnLocalDevice:
true
)();
});
}
finally
{
await
removeIOSimulator
(
simulatorDeviceId
);
...
...
packages/flutter_tools/lib/src/ios/simulators.dart
View file @
15e69441
...
...
@@ -257,6 +257,25 @@ class SimControl {
return
result
;
}
Future
<
RunResult
>
stopApp
(
String
deviceId
,
String
appIdentifier
)
async
{
RunResult
result
;
try
{
result
=
await
_processUtils
.
run
(
<
String
>[
...
_xcode
.
xcrunCommand
(),
'simctl'
,
'terminate'
,
deviceId
,
appIdentifier
,
],
throwOnError:
true
,
);
}
on
ProcessException
catch
(
exception
)
{
throwToolExit
(
'Unable to terminate
$appIdentifier
on
$deviceId
:
\n
$exception
'
);
}
return
result
;
}
Future
<
void
>
takeScreenshot
(
String
deviceId
,
String
outputPath
)
async
{
try
{
await
_processUtils
.
run
(
...
...
@@ -533,11 +552,13 @@ class IOSSimulator extends Device {
@override
Future
<
bool
>
stopApp
(
ApplicationPackage
app
,
{
ApplicationPackage
?
app
,
{
String
?
userIdentifier
,
})
async
{
// Currently we don't have a way to stop an app running on iOS.
return
false
;
if
(
app
==
null
)
{
return
false
;
}
return
(
await
_simControl
.
stopApp
(
id
,
app
.
id
)).
exitCode
==
0
;
}
String
get
logFilePath
{
...
...
packages/flutter_tools/test/general.shard/ios/simulators_test.dart
View file @
15e69441
...
...
@@ -901,6 +901,36 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text'''
throwsToolExit
(
message:
r'Unable to launch'
),
);
});
testWithoutContext
(
'.stopApp() handles exceptions'
,
()
async
{
fakeProcessManager
.
addCommand
(
const
FakeCommand
(
command:
<
String
>[
'xcrun'
,
'simctl'
,
'terminate'
,
deviceId
,
appId
,
],
exception:
ProcessException
(
'xcrun'
,
<
String
>[]),
));
expect
(
()
async
=>
simControl
.
stopApp
(
deviceId
,
appId
),
throwsToolExit
(
message:
'Unable to terminate'
),
);
expect
(
fakeProcessManager
,
hasNoRemainingExpectations
);
});
testWithoutContext
(
'simulator stopApp handles null app package'
,
()
async
{
final
IOSSimulator
iosSimulator
=
IOSSimulator
(
'x'
,
name:
'Testo'
,
simulatorCategory:
'NaN'
,
simControl:
simControl
,
);
expect
(
await
iosSimulator
.
stopApp
(
null
),
isFalse
);
});
});
group
(
'startApp'
,
()
{
...
...
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