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
4eb4dab5
Commit
4eb4dab5
authored
Jan 22, 2016
by
Eric Seidel
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1350 from eseidelGoogle/list_linux
Make `flutter list` not crash on linux.
parents
ed346222
7f3ae43b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
28 deletions
+27
-28
list.dart
packages/flutter_tools/lib/src/commands/list.dart
+18
-15
device_ios.dart
packages/flutter_tools/lib/src/ios/device_ios.dart
+9
-13
No files found.
packages/flutter_tools/lib/src/commands/list.dart
View file @
4eb4dab5
...
...
@@ -3,6 +3,7 @@
// found in the LICENSE file.
import
'dart:async'
;
import
'dart:io'
;
import
'../android/device_android.dart'
;
import
'../ios/device_ios.dart'
;
...
...
@@ -43,25 +44,27 @@ class ListCommand extends FlutterCommand {
}
}
if
(
details
)
print
(
'iOS Devices:'
);
if
(
Platform
.
isMacOS
)
{
if
(
details
)
print
(
'iOS Devices:'
);
for
(
IOSDevice
device
in
IOSDevice
.
getAttachedDevices
(
devices
.
iOS
))
{
if
(
details
)
{
print
(
'
${device.id}
\t
${device.name}
'
);
}
else
{
print
(
device
.
id
);
for
(
IOSDevice
device
in
IOSDevice
.
getAttachedDevices
(
devices
.
iOS
))
{
if
(
details
)
{
print
(
'
${device.id}
\t
${device.name}
'
);
}
else
{
print
(
device
.
id
);
}
}
}
if
(
details
)
print
(
'iOS Simulators:'
);
if
(
details
)
print
(
'iOS Simulators:'
);
for
(
IOSSimulator
device
in
IOSSimulator
.
getAttachedDevices
(
devices
.
iOSSimulator
))
{
if
(
details
)
{
print
(
'
${device.id}
\t
${device.name}
'
);
}
else
{
print
(
device
.
id
);
for
(
IOSSimulator
device
in
IOSSimulator
.
getAttachedDevices
(
devices
.
iOSSimulator
))
{
if
(
details
)
{
print
(
'
${device.id}
\t
${device.name}
'
);
}
else
{
print
(
device
.
id
);
}
}
}
...
...
packages/flutter_tools/lib/src/ios/device_ios.dart
View file @
4eb4dab5
...
...
@@ -21,10 +21,6 @@ class IOSDevice extends Device {
'To work with iOS devices, please install ideviceinstaller. '
'If you use homebrew, you can install it with '
'"
\$
brew install ideviceinstaller".'
;
static
const
String
_linuxInstructions
=
'To work with iOS devices, please install ideviceinstaller. '
'On Ubuntu or Debian, you can install it with '
'"
\$
apt-get install ideviceinstaller".'
;
String
_installerPath
;
String
get
installerPath
=>
_installerPath
;
...
...
@@ -100,19 +96,16 @@ class IOSDevice extends Device {
static
final
Map
<
String
,
String
>
_commandMap
=
{};
static
String
_checkForCommand
(
String
command
,
[
String
macInstructions
=
_macInstructions
,
String
linuxInstructions
=
_linuxInstructions
String
macInstructions
=
_macInstructions
])
{
return
_commandMap
.
putIfAbsent
(
command
,
()
{
try
{
command
=
runCheckedSync
([
'which'
,
command
]).
trim
();
}
catch
(
e
)
{
if
(
Platform
.
isMacOS
)
{
logging
.
severe
(
macInstructions
);
}
else
if
(
Platform
.
isLinux
)
{
logging
.
severe
(
linuxInstructions
);
logging
.
severe
(
'
$command
not found.
$macInstructions
'
);
}
else
{
logging
.
severe
(
'
$command
is not available on your platform.'
);
logging
.
severe
(
'
Cannot control iOS devices or simulators.
$command
is not available on your platform.'
);
}
}
return
command
;
...
...
@@ -331,9 +324,12 @@ class IOSSimulator extends Device {
static
List
<
IOSSimulator
>
getAttachedDevices
([
IOSSimulator
mockIOS
])
{
List
<
IOSSimulator
>
devices
=
[];
_IOSSimulatorInfo
deviceInfo
=
_getRunningSimulatorInfo
(
mockIOS
);
if
(
deviceInfo
!=
null
)
devices
.
add
(
new
IOSSimulator
(
id:
deviceInfo
.
id
,
name:
deviceInfo
.
name
));
try
{
_IOSSimulatorInfo
deviceInfo
=
_getRunningSimulatorInfo
(
mockIOS
);
if
(
deviceInfo
!=
null
)
devices
.
add
(
new
IOSSimulator
(
id:
deviceInfo
.
id
,
name:
deviceInfo
.
name
));
}
catch
(
e
)
{
}
return
devices
;
}
...
...
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