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
d00a39cb
Unverified
Commit
d00a39cb
authored
Feb 04, 2020
by
Jenn Magder
Committed by
GitHub
Feb 04, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove dead code IMobileDevice.isWorking (#50084)
parent
6e605f3f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
67 deletions
+0
-67
artifacts.dart
packages/flutter_tools/lib/src/artifacts.dart
+0
-5
mac.dart
packages/flutter_tools/lib/src/ios/mac.dart
+0
-52
mac_test.dart
packages/flutter_tools/test/general.shard/ios/mac_test.dart
+0
-10
No files found.
packages/flutter_tools/lib/src/artifacts.dart
View file @
d00a39cb
...
...
@@ -45,7 +45,6 @@ enum Artifact {
iosDeploy
,
ideviceinfo
,
ideviceId
,
idevicename
,
idevicesyslog
,
idevicescreenshot
,
ideviceinstaller
,
...
...
@@ -113,8 +112,6 @@ String _artifactToFileName(Artifact artifact, [ TargetPlatform platform, BuildMo
return
'ideviceinfo'
;
case
Artifact
.
ideviceId
:
return
'idevice_id'
;
case
Artifact
.
idevicename
:
return
'idevicename'
;
case
Artifact
.
idevicesyslog
:
return
'idevicesyslog'
;
case
Artifact
.
idevicescreenshot
:
...
...
@@ -263,7 +260,6 @@ class CachedArtifacts extends Artifacts {
case
Artifact
.
ideviceinfo
:
case
Artifact
.
idevicescreenshot
:
case
Artifact
.
idevicesyslog
:
case
Artifact
.
idevicename
:
final
String
artifactFileName
=
_artifactToFileName
(
artifact
);
return
_cache
.
getArtifactDirectory
(
'libimobiledevice'
).
childFile
(
artifactFileName
).
path
;
case
Artifact
.
iosDeploy
:
...
...
@@ -515,7 +511,6 @@ class LocalEngineArtifacts extends Artifacts {
return
_fileSystem
.
path
.
join
(
_hostEngineOutPath
,
'dart-sdk'
,
'bin'
,
'snapshots'
,
artifactFileName
);
case
Artifact
.
ideviceId
:
case
Artifact
.
ideviceinfo
:
case
Artifact
.
idevicename
:
case
Artifact
.
idevicescreenshot
:
case
Artifact
.
idevicesyslog
:
return
_cache
.
getArtifactDirectory
(
'libimobiledevice'
).
childFile
(
artifactFileName
).
path
;
...
...
packages/flutter_tools/lib/src/ios/mac.dart
View file @
d00a39cb
...
...
@@ -89,13 +89,11 @@ class IMobileDevice {
IMobileDevice
()
:
_ideviceIdPath
=
globals
.
artifacts
.
getArtifactPath
(
Artifact
.
ideviceId
,
platform:
TargetPlatform
.
ios
),
_ideviceinfoPath
=
globals
.
artifacts
.
getArtifactPath
(
Artifact
.
ideviceinfo
,
platform:
TargetPlatform
.
ios
),
_idevicenamePath
=
globals
.
artifacts
.
getArtifactPath
(
Artifact
.
idevicename
,
platform:
TargetPlatform
.
ios
),
_idevicesyslogPath
=
globals
.
artifacts
.
getArtifactPath
(
Artifact
.
idevicesyslog
,
platform:
TargetPlatform
.
ios
),
_idevicescreenshotPath
=
globals
.
artifacts
.
getArtifactPath
(
Artifact
.
idevicescreenshot
,
platform:
TargetPlatform
.
ios
);
final
String
_ideviceIdPath
;
final
String
_ideviceinfoPath
;
final
String
_idevicenamePath
;
final
String
_idevicesyslogPath
;
final
String
_idevicescreenshotPath
;
...
...
@@ -113,56 +111,6 @@ class IMobileDevice {
}
bool
_isInstalled
;
/// Returns true if libimobiledevice is installed and working as expected.
///
/// Older releases of libimobiledevice fail to work with iOS 10.3 and above.
Future
<
bool
>
get
isWorking
async
{
if
(
_isWorking
!=
null
)
{
return
_isWorking
;
}
if
(!
isInstalled
)
{
_isWorking
=
false
;
return
_isWorking
;
}
// If usage info is printed in a hyphenated id, we need to update.
const
String
fakeIphoneId
=
'00008020-001C2D903C42002E'
;
final
Map
<
String
,
String
>
executionEnv
=
Map
<
String
,
String
>.
fromEntries
(
<
MapEntry
<
String
,
String
>>[
globals
.
cache
.
dyLdLibEntry
]
);
final
ProcessResult
ideviceResult
=
(
await
processUtils
.
run
(
<
String
>[
_ideviceinfoPath
,
'-u'
,
fakeIphoneId
,
],
environment:
executionEnv
,
)).
processResult
;
if
((
ideviceResult
.
stdout
as
String
).
contains
(
'Usage: ideviceinfo'
))
{
_isWorking
=
false
;
return
_isWorking
;
}
// If no device is attached, we're unable to detect any problems. Assume all is well.
final
ProcessResult
result
=
(
await
processUtils
.
run
(
<
String
>[
_ideviceIdPath
,
'-l'
,
],
environment:
executionEnv
,
)).
processResult
;
if
(
result
.
exitCode
==
0
&&
(
result
.
stdout
as
String
).
isEmpty
)
{
_isWorking
=
true
;
}
else
{
// Check that we can look up the names of any attached devices.
_isWorking
=
await
processUtils
.
exitsHappy
(
<
String
>[
_idevicenamePath
],
environment:
executionEnv
,
);
}
return
_isWorking
;
}
bool
_isWorking
;
Future
<
String
>
getAvailableDeviceIDs
()
async
{
try
{
final
ProcessResult
result
=
await
globals
.
processManager
.
run
(
...
...
packages/flutter_tools/test/general.shard/ios/mac_test.dart
View file @
d00a39cb
...
...
@@ -56,16 +56,6 @@ void main() {
);
});
testUsingContext
(
'isWorking returns false if libimobiledevice is not installed'
,
()
async
{
when
(
mockProcessManager
.
runSync
(
<
String
>[
ideviceIdPath
,
'-h'
],
environment:
anyNamed
(
'environment'
),
)).
thenReturn
(
ProcessResult
(
123
,
1
,
''
,
''
));
expect
(
await
globals
.
iMobileDevice
.
isWorking
,
false
);
},
overrides:
<
Type
,
Generator
>{
ProcessManager:
()
=>
mockProcessManager
,
Artifacts:
()
=>
mockArtifacts
,
});
testUsingContext
(
'getAvailableDeviceIDs throws ToolExit when libimobiledevice is not installed'
,
()
async
{
when
(
mockProcessManager
.
run
(
<
String
>[
ideviceIdPath
,
'-l'
],
...
...
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