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
17d89f3d
Commit
17d89f3d
authored
Aug 31, 2015
by
Ian Fischer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid crashing when an iOS device isn’t connected.
parent
5fb31769
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
33 deletions
+42
-33
sky_tool
packages/flutter/lib/sky_tool
+42
-33
No files found.
packages/flutter/lib/sky_tool
View file @
17d89f3d
...
...
@@ -465,50 +465,59 @@ class IOSDevice(object):
return
False
if
cls
.
_is_connected
:
return
True
cmd
=
[
'ios-deploy'
,
'--detect'
,
'--timeout'
,
'1'
]
logging
.
info
(
' '
.
join
(
cmd
))
out
=
subprocess
.
check_output
(
cmd
)
match
=
re
.
search
(
r'\[\.\.\.\.\] Found [^\)]*\) connected'
,
out
)
cls
.
_is_connected
=
match
is
not
None
try
:
cmd
=
[
'ios-deploy'
,
'--detect'
,
'--timeout'
,
'1'
]
logging
.
info
(
' '
.
join
(
cmd
))
out
=
subprocess
.
check_output
(
cmd
)
match
=
re
.
search
(
r'\[\.\.\.\.\] Found [^\)]*\) connected'
,
out
)
cls
.
_is_connected
=
match
is
not
None
except
subprocess
.
CalledProcessError
:
cls
.
_is_connected
=
False
return
cls
.
_is_connected
@
classmethod
def
install_app
(
cls
,
ios_app_path
):
if
not
cls
.
has_ios_deploy
():
return
cmd
=
[
'ios-deploy'
,
'--justlaunch'
,
'--timeout'
,
'10'
,
# Smaller timeouts cause it to exit before having launched the app
'--bundle'
,
ios_app_path
]
logging
.
info
(
' '
.
join
(
cmd
))
subprocess
.
check_call
(
cmd
)
try
:
cmd
=
[
'ios-deploy'
,
'--justlaunch'
,
'--timeout'
,
'10'
,
# Smaller timeouts cause it to exit before having launched the app
'--bundle'
,
ios_app_path
]
logging
.
info
(
' '
.
join
(
cmd
))
subprocess
.
check_call
(
cmd
)
except
subprocess
.
CalledProcessError
:
pass
@
classmethod
def
copy_file
(
cls
,
bundle_id
,
local_path
,
device_path
):
if
not
cls
.
has_ios_deploy
():
return
cmd
=
[
'ios-deploy'
,
'-t'
,
'1'
,
'--bundle_id'
,
bundle_id
,
'--upload'
,
local_path
,
'--to'
,
device_path
]
logging
.
info
(
' '
.
join
(
cmd
))
subprocess
.
check_call
(
cmd
)
try
:
cmd
=
[
'ios-deploy'
,
'-t'
,
'1'
,
'--bundle_id'
,
bundle_id
,
'--upload'
,
local_path
,
'--to'
,
device_path
]
logging
.
info
(
' '
.
join
(
cmd
))
subprocess
.
check_call
(
cmd
)
except
subprocess
.
CalledProcessError
:
pass
class
IOSSimulator
(
object
):
...
...
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