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
2065483a
Commit
2065483a
authored
Jan 28, 2016
by
Devon Carew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make --device-id work with ios devices too
parent
12419d6b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
19 deletions
+23
-19
start.dart
packages/flutter_tools/lib/src/commands/start.dart
+3
-3
device.dart
packages/flutter_tools/lib/src/device.dart
+2
-5
flutter_command_runner.dart
.../flutter_tools/lib/src/runner/flutter_command_runner.dart
+18
-11
No files found.
packages/flutter_tools/lib/src/commands/start.dart
View file @
2065483a
...
...
@@ -28,8 +28,6 @@ String findMainDartFile([String target]) {
}
}
// We don't yet support iOS here. https://github.com/flutter/flutter/issues/1036
abstract
class
StartCommandBase
extends
FlutterCommand
{
StartCommandBase
()
{
argParser
.
addFlag
(
'checked'
,
...
...
@@ -51,7 +49,7 @@ abstract class StartCommandBase extends FlutterCommand {
class
StartCommand
extends
StartCommandBase
{
final
String
name
=
'start'
;
final
String
description
=
'Start your Flutter app on an attached device '
'(defaults to checked/debug mode)
(Android only)
.'
;
'(defaults to checked/debug mode).'
;
StartCommand
()
{
argParser
.
addFlag
(
'full-restart'
,
...
...
@@ -139,6 +137,8 @@ Future<int> startApp(
if
(
clearLogs
!=
null
)
platformArgs
[
'clear-logs'
]
=
clearLogs
;
printStatus
(
'Starting
$mainPath
on
${device.name}
...'
);
bool
result
=
await
device
.
startApp
(
package
,
toolchain
,
...
...
packages/flutter_tools/lib/src/device.dart
View file @
2065483a
...
...
@@ -131,17 +131,14 @@ class DeviceStore {
device
=
devices
.
firstWhere
(
(
Device
dev
)
=>
(
dev
.
id
==
config
.
deviceId
),
orElse:
()
=>
null
);
if
(
device
==
null
)
{
printError
(
'Warning: Device ID
${config.deviceId}
not found'
);
}
}
else
if
(
devices
.
length
==
1
)
{
// Step 2: If no identifier is specified and there is only one connected
// device, pick that one.
device
=
devices
[
0
];
}
else
if
(
devices
.
length
>
1
)
{
// Step 3: D:
print
Trace
(
'Multiple devices are connected, but no device ID was specified.'
);
print
Trace
(
'Attempting to launch on all connected devices.'
);
print
Status
(
'Multiple devices are connected, but no device ID was specified.'
);
print
Status
(
'Attempting to launch on all connected devices.'
);
}
return
device
;
...
...
packages/flutter_tools/lib/src/runner/flutter_command_runner.dart
View file @
2065483a
...
...
@@ -42,8 +42,9 @@ class FlutterCommandRunner extends CommandRunner {
help:
'The root directory of the Flutter repository. Defaults to
\$
$kFlutterRootEnvironmentVariableName
if set,
\n
'
'otherwise defaults to a value derived from the location of this tool.'
,
defaultsTo:
_defaultFlutterRoot
);
argParser
.
addOption
(
'android-device-id'
,
help:
'Serial number of the target Android device.'
);
argParser
.
addOption
(
'device-id'
,
abbr:
'd'
,
help:
'Target device id.'
);
argParser
.
addSeparator
(
'Local build selection options (not normally required):'
);
argParser
.
addFlag
(
'debug'
,
...
...
@@ -208,7 +209,7 @@ class FlutterCommandRunner extends CommandRunner {
configs
.
add
(
new
BuildConfiguration
.
prebuilt
(
hostPlatform:
hostPlatform
,
targetPlatform:
TargetPlatform
.
android
,
deviceId:
globalResults
[
'
android-
device-id'
]
deviceId:
globalResults
[
'device-id'
]
));
if
(
hostPlatform
==
HostPlatform
.
linux
)
{
...
...
@@ -222,12 +223,14 @@ class FlutterCommandRunner extends CommandRunner {
if
(
hostPlatform
==
HostPlatform
.
mac
)
{
configs
.
add
(
new
BuildConfiguration
.
prebuilt
(
hostPlatform:
HostPlatform
.
mac
,
targetPlatform:
TargetPlatform
.
iOS
targetPlatform:
TargetPlatform
.
iOS
,
deviceId:
globalResults
[
'device-id'
]
));
configs
.
add
(
new
BuildConfiguration
.
prebuilt
(
hostPlatform:
HostPlatform
.
mac
,
targetPlatform:
TargetPlatform
.
iOSSimulator
targetPlatform:
TargetPlatform
.
iOSSimulator
,
deviceId:
globalResults
[
'device-id'
]
));
}
}
else
{
...
...
@@ -244,7 +247,7 @@ class FlutterCommandRunner extends CommandRunner {
targetPlatform:
TargetPlatform
.
android
,
enginePath:
enginePath
,
buildPath:
globalResults
[
'android-debug-build-path'
],
deviceId:
globalResults
[
'
android-
device-id'
]
deviceId:
globalResults
[
'device-id'
]
));
configs
.
add
(
new
BuildConfiguration
.
local
(
...
...
@@ -262,7 +265,8 @@ class FlutterCommandRunner extends CommandRunner {
hostPlatform:
hostPlatform
,
targetPlatform:
TargetPlatform
.
iOS
,
enginePath:
enginePath
,
buildPath:
globalResults
[
'ios-debug-build-path'
]
buildPath:
globalResults
[
'ios-debug-build-path'
],
deviceId:
globalResults
[
'device-id'
]
));
configs
.
add
(
new
BuildConfiguration
.
local
(
...
...
@@ -270,7 +274,8 @@ class FlutterCommandRunner extends CommandRunner {
hostPlatform:
hostPlatform
,
targetPlatform:
TargetPlatform
.
iOSSimulator
,
enginePath:
enginePath
,
buildPath:
globalResults
[
'ios-sim-debug-build-path'
]
buildPath:
globalResults
[
'ios-sim-debug-build-path'
],
deviceId:
globalResults
[
'device-id'
]
));
}
}
...
...
@@ -282,7 +287,7 @@ class FlutterCommandRunner extends CommandRunner {
targetPlatform:
TargetPlatform
.
android
,
enginePath:
enginePath
,
buildPath:
globalResults
[
'android-release-build-path'
],
deviceId:
globalResults
[
'
android-
device-id'
]
deviceId:
globalResults
[
'device-id'
]
));
configs
.
add
(
new
BuildConfiguration
.
local
(
...
...
@@ -300,7 +305,8 @@ class FlutterCommandRunner extends CommandRunner {
hostPlatform:
hostPlatform
,
targetPlatform:
TargetPlatform
.
iOS
,
enginePath:
enginePath
,
buildPath:
globalResults
[
'ios-release-build-path'
]
buildPath:
globalResults
[
'ios-release-build-path'
],
deviceId:
globalResults
[
'device-id'
]
));
configs
.
add
(
new
BuildConfiguration
.
local
(
...
...
@@ -308,7 +314,8 @@ class FlutterCommandRunner extends CommandRunner {
hostPlatform:
hostPlatform
,
targetPlatform:
TargetPlatform
.
iOSSimulator
,
enginePath:
enginePath
,
buildPath:
globalResults
[
'ios-sim-release-build-path'
]
buildPath:
globalResults
[
'ios-sim-release-build-path'
],
deviceId:
globalResults
[
'device-id'
]
));
}
}
...
...
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