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
782f505f
Commit
782f505f
authored
Jan 05, 2016
by
Devon Carew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clear logs on app launch
parent
ad170378
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
12 deletions
+26
-12
listen.dart
packages/flutter_tools/lib/src/commands/listen.dart
+2
-2
start.dart
packages/flutter_tools/lib/src/commands/start.dart
+15
-5
device.dart
packages/flutter_tools/lib/src/device.dart
+9
-5
No files found.
packages/flutter_tools/lib/src/commands/listen.dart
View file @
782f505f
...
@@ -11,8 +11,8 @@ import 'start.dart';
...
@@ -11,8 +11,8 @@ import 'start.dart';
class
ListenCommand
extends
StartCommandBase
{
class
ListenCommand
extends
StartCommandBase
{
final
String
name
=
'listen'
;
final
String
name
=
'listen'
;
final
String
description
=
'Listen for changes to files and reload the running app on all connected devices
. (Android only.)
'
final
String
description
=
'Listen for changes to files and reload the running app on all connected devices
(Android only).
'
'By default, only listens to "./" and "./lib/". To listen to additional directories, list them on the command line.'
;
'
By default, only listens to "./" and "./lib/". To listen to additional directories, list them on the command line.'
;
/// Only run once. Used for testing.
/// Only run once. Used for testing.
final
bool
singleRun
;
final
bool
singleRun
;
...
...
packages/flutter_tools/lib/src/commands/start.dart
View file @
782f505f
...
@@ -46,7 +46,12 @@ abstract class StartCommandBase extends FlutterCommand {
...
@@ -46,7 +46,12 @@ abstract class StartCommandBase extends FlutterCommand {
}
}
}
}
Future
<
int
>
startApp
({
bool
stop:
true
,
bool
install:
true
,
bool
poke:
false
})
async
{
Future
<
int
>
startApp
({
bool
stop:
true
,
bool
install:
true
,
bool
poke:
false
,
bool
clearLogs:
false
})
async
{
String
mainPath
=
findMainDartFile
(
argResults
[
'target'
]);
String
mainPath
=
findMainDartFile
(
argResults
[
'target'
]);
if
(!
FileSystemEntity
.
isFileSync
(
mainPath
))
{
if
(!
FileSystemEntity
.
isFileSync
(
mainPath
))
{
...
@@ -63,7 +68,7 @@ abstract class StartCommandBase extends FlutterCommand {
...
@@ -63,7 +68,7 @@ abstract class StartCommandBase extends FlutterCommand {
stopper
.
inheritFromParent
(
this
);
stopper
.
inheritFromParent
(
this
);
stopper
.
stop
();
stopper
.
stop
();
}
}
if
(
install
)
{
if
(
install
)
{
logging
.
fine
(
'Running install command.'
);
logging
.
fine
(
'Running install command.'
);
InstallCommand
installer
=
new
InstallCommand
();
InstallCommand
installer
=
new
InstallCommand
();
...
@@ -90,7 +95,8 @@ abstract class StartCommandBase extends FlutterCommand {
...
@@ -90,7 +95,8 @@ abstract class StartCommandBase extends FlutterCommand {
poke:
poke
,
poke:
poke
,
checked:
argResults
[
'checked'
],
checked:
argResults
[
'checked'
],
traceStartup:
argResults
[
'trace-startup'
],
traceStartup:
argResults
[
'trace-startup'
],
route:
argResults
[
'route'
]))
route:
argResults
[
'route'
],
clearLogs:
clearLogs
))
startedSomething
=
true
;
startedSomething
=
true
;
}
}
);
);
...
@@ -110,12 +116,15 @@ abstract class StartCommandBase extends FlutterCommand {
...
@@ -110,12 +116,15 @@ abstract class StartCommandBase extends FlutterCommand {
class
StartCommand
extends
StartCommandBase
{
class
StartCommand
extends
StartCommandBase
{
final
String
name
=
'start'
;
final
String
name
=
'start'
;
final
String
description
=
'Start your Flutter app on attached devices
. (Android only.)
'
;
final
String
description
=
'Start your Flutter app on attached devices
(Android only).
'
;
StartCommand
()
{
StartCommand
()
{
argParser
.
addFlag
(
'poke'
,
argParser
.
addFlag
(
'poke'
,
negatable:
false
,
negatable:
false
,
help:
'Restart the connection to the server.'
);
help:
'Restart the connection to the server.'
);
argParser
.
addFlag
(
'clear-logs'
,
defaultsTo:
true
,
help:
'Clear log history before starting the app.'
);
}
}
@override
@override
...
@@ -128,9 +137,10 @@ class StartCommand extends StartCommandBase {
...
@@ -128,9 +137,10 @@ class StartCommand extends StartCommandBase {
]);
]);
bool
poke
=
argResults
[
'poke'
];
bool
poke
=
argResults
[
'poke'
];
bool
clearLogs
=
argResults
[
'clear-logs'
];
// Only stop and reinstall if the user did not specify a poke
// Only stop and reinstall if the user did not specify a poke
int
result
=
await
startApp
(
stop:
!
poke
,
install:
!
poke
,
poke:
poke
);
int
result
=
await
startApp
(
stop:
!
poke
,
install:
!
poke
,
poke:
poke
,
clearLogs:
clearLogs
);
logging
.
fine
(
'Finished start command.'
);
logging
.
fine
(
'Finished start command.'
);
return
result
;
return
result
;
...
...
packages/flutter_tools/lib/src/device.dart
View file @
782f505f
...
@@ -776,10 +776,11 @@ class AndroidDevice extends Device {
...
@@ -776,10 +776,11 @@ class AndroidDevice extends Device {
}
}
bool
startBundle
(
AndroidApk
apk
,
String
bundlePath
,
{
bool
startBundle
(
AndroidApk
apk
,
String
bundlePath
,
{
bool
poke
,
bool
poke:
false
,
bool
checked
,
bool
checked:
true
,
bool
traceStartup
,
bool
traceStartup:
false
,
String
route
String
route
,
bool
clearLogs:
false
})
{
})
{
logging
.
fine
(
'
$this
startBundle'
);
logging
.
fine
(
'
$this
startBundle'
);
...
@@ -791,6 +792,9 @@ class AndroidDevice extends Device {
...
@@ -791,6 +792,9 @@ class AndroidDevice extends Device {
if
(!
poke
)
if
(!
poke
)
_forwardObservatoryPort
();
_forwardObservatoryPort
();
if
(
clearLogs
)
this
.
clearLogs
();
String
deviceTmpPath
=
'/data/local/tmp/dev.flx'
;
String
deviceTmpPath
=
'/data/local/tmp/dev.flx'
;
runCheckedSync
(
adbCommandForDevice
([
'push'
,
bundlePath
,
deviceTmpPath
]));
runCheckedSync
(
adbCommandForDevice
([
'push'
,
bundlePath
,
deviceTmpPath
]));
List
<
String
>
cmd
=
adbCommandForDevice
([
List
<
String
>
cmd
=
adbCommandForDevice
([
...
@@ -801,7 +805,7 @@ class AndroidDevice extends Device {
...
@@ -801,7 +805,7 @@ class AndroidDevice extends Device {
if
(
checked
)
if
(
checked
)
cmd
.
addAll
([
'--ez'
,
'enable-checked-mode'
,
'true'
]);
cmd
.
addAll
([
'--ez'
,
'enable-checked-mode'
,
'true'
]);
if
(
traceStartup
)
if
(
traceStartup
)
cmd
.
addAll
([
'--ez'
,
'trace-startup'
,
'true'
]);
cmd
.
addAll
([
'--ez'
,
'trace-startup'
,
'true'
]);
if
(
route
!=
null
)
if
(
route
!=
null
)
cmd
.
addAll
([
'--es'
,
'route'
,
route
]);
cmd
.
addAll
([
'--es'
,
'route'
,
route
]);
cmd
.
add
(
apk
.
launchActivity
);
cmd
.
add
(
apk
.
launchActivity
);
...
...
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