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
48c3d015
Commit
48c3d015
authored
Oct 30, 2015
by
Devon Carew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix the stop command
parent
7115ff26
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
7 deletions
+14
-7
device.dart
packages/flutter_tools/lib/src/device.dart
+14
-7
No files found.
packages/flutter_tools/lib/src/device.dart
View file @
48c3d015
...
...
@@ -835,16 +835,23 @@ class AndroidDevice extends Device {
runSync
([
adbPath
,
'shell'
,
'am'
,
'force-stop'
,
apk
.
id
]);
// Kill the server
if
(
Platform
.
isMacOS
)
{
String
pid
=
runSync
([
'lsof'
,
'-i'
,
':
$_serverPort
'
,
'-t'
]
);
if
(
pid
.
isEmpty
)
{
String
pid
s
=
runSync
([
'lsof'
,
'-i'
,
':
$_serverPort
'
,
'-t'
]).
trim
(
);
if
(
pid
s
.
isEmpty
)
{
_logging
.
fine
(
'No process to kill for port
$_serverPort
'
);
return
true
;
}
// Killing a pid with a shell command from within dart is hard,
// so use a library command, but it's still nice to give the
// equivalent command when doing verbose logging.
_logging
.
info
(
'kill
$pid
'
);
Process
.
killPid
(
int
.
parse
(
pid
));
// Handle multiple returned pids.
for
(
String
pidString
in
pids
.
split
(
'
\n
'
))
{
// Killing a pid with a shell command from within dart is hard, so use a
// library command, but it's still nice to give the equivalent command
// when doing verbose logging.
_logging
.
info
(
'kill
$pidString
'
);
int
pid
=
int
.
parse
(
pidString
,
onError:
(
_
)
=>
null
);
if
(
pid
!=
null
)
Process
.
killPid
(
pid
);
}
}
else
if
(
Platform
.
isWindows
)
{
//Get list of network processes and split on newline
List
<
String
>
processes
=
runSync
([
'netstat.exe'
,
'-ano'
]).
split
(
"
\r
"
);
...
...
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