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
93b1f100
Commit
93b1f100
authored
Dec 03, 2015
by
Eric Seidel
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #708 from eseidelGoogle/trace_path
Make it possible to specify the saved path for trace --stop
parents
1a5639d3
5e2bc90d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
trace.dart
packages/flutter_tools/lib/src/commands/trace.dart
+2
-1
device.dart
packages/flutter_tools/lib/src/device.dart
+4
-3
No files found.
packages/flutter_tools/lib/src/commands/trace.dart
View file @
93b1f100
...
@@ -20,6 +20,7 @@ class TraceCommand extends FlutterCommand {
...
@@ -20,6 +20,7 @@ class TraceCommand extends FlutterCommand {
TraceCommand
()
{
TraceCommand
()
{
argParser
.
addFlag
(
'start'
,
negatable:
false
,
help:
'Start tracing.'
);
argParser
.
addFlag
(
'start'
,
negatable:
false
,
help:
'Start tracing.'
);
argParser
.
addFlag
(
'stop'
,
negatable:
false
,
help:
'Stop tracing.'
);
argParser
.
addFlag
(
'stop'
,
negatable:
false
,
help:
'Stop tracing.'
);
argParser
.
addOption
(
'out'
,
help:
'Specify the path of the saved trace file.'
);
argParser
.
addOption
(
'duration'
,
argParser
.
addOption
(
'duration'
,
defaultsTo:
'10'
,
abbr:
'd'
,
help:
'Duration in seconds to trace.'
);
defaultsTo:
'10'
,
abbr:
'd'
,
help:
'Duration in seconds to trace.'
);
}
}
...
@@ -52,7 +53,7 @@ class TraceCommand extends FlutterCommand {
...
@@ -52,7 +53,7 @@ class TraceCommand extends FlutterCommand {
}
}
void
_stopTracing
(
AndroidDevice
android
,
AndroidApk
androidApp
)
{
void
_stopTracing
(
AndroidDevice
android
,
AndroidApk
androidApp
)
{
String
tracePath
=
android
.
stopTracing
(
androidApp
);
String
tracePath
=
android
.
stopTracing
(
androidApp
,
outPath:
argResults
[
'out'
]
);
if
(
tracePath
==
null
)
{
if
(
tracePath
==
null
)
{
logging
.
warning
(
'No trace file saved.'
);
logging
.
warning
(
'No trace file saved.'
);
}
else
{
}
else
{
...
...
packages/flutter_tools/lib/src/device.dart
View file @
93b1f100
...
@@ -853,7 +853,7 @@ class AndroidDevice extends Device {
...
@@ -853,7 +853,7 @@ class AndroidDevice extends Device {
]));
]));
}
}
String
stopTracing
(
AndroidApk
apk
)
{
String
stopTracing
(
AndroidApk
apk
,
{
String
outPath:
null
}
)
{
clearLogs
();
clearLogs
();
runCheckedSync
(
adbCommandForDevice
([
runCheckedSync
(
adbCommandForDevice
([
'shell'
,
'shell'
,
...
@@ -878,11 +878,12 @@ class AndroidDevice extends Device {
...
@@ -878,11 +878,12 @@ class AndroidDevice extends Device {
}
}
if
(
tracePath
!=
null
)
{
if
(
tracePath
!=
null
)
{
String
localPath
=
(
outPath
!=
null
)
?
outPath
:
path
.
basename
(
tracePath
);
runCheckedSync
(
adbCommandForDevice
([
'root'
]));
runCheckedSync
(
adbCommandForDevice
([
'root'
]));
runSync
(
adbCommandForDevice
([
'shell'
,
'run-as'
,
apk
.
id
,
'chmod'
,
'777'
,
tracePath
]));
runSync
(
adbCommandForDevice
([
'shell'
,
'run-as'
,
apk
.
id
,
'chmod'
,
'777'
,
tracePath
]));
runCheckedSync
(
adbCommandForDevice
([
'pull'
,
tracePath
]));
runCheckedSync
(
adbCommandForDevice
([
'pull'
,
tracePath
,
localPath
]));
runSync
(
adbCommandForDevice
([
'shell'
,
'rm'
,
tracePath
]));
runSync
(
adbCommandForDevice
([
'shell'
,
'rm'
,
tracePath
]));
return
path
.
basename
(
tracePath
)
;
return
localPath
;
}
}
logging
.
warning
(
'No trace file detected. '
logging
.
warning
(
'No trace file detected. '
'Did you remember to start the trace before stopping it?'
);
'Did you remember to start the trace before stopping 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