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
6f9ee13e
Unverified
Commit
6f9ee13e
authored
Apr 16, 2020
by
Jenn Magder
Committed by
GitHub
Apr 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass in runtime to ios_app_with_watch_companion simctl create (#54899)
parent
d537834b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
3 deletions
+54
-3
ios_app_with_watch_companion.dart
dev/devicelab/bin/tasks/ios_app_with_watch_companion.dart
+54
-3
No files found.
dev/devicelab/bin/tasks/ios_app_with_watch_companion.dart
View file @
6f9ee13e
...
...
@@ -74,7 +74,57 @@ Future<void> main() async {
section
(
'Create build for a simulator device'
);
// Create iOS simulator devices.
// Xcode 11.4 simctl create makes the runtime argument optional, and defaults to latest.
// TODO(jmagman): Remove runtime parsing when devicelab upgrades to Xcode 11.4 https://github.com/flutter/flutter/issues/54889
final
String
availableRuntimes
=
await
eval
(
'xcrun'
,
<
String
>[
'simctl'
,
'list'
,
'runtimes'
,
],
canFail:
false
,
workingDirectory:
flutterDirectory
.
path
,
);
// Example simctl list:
// == Runtimes ==
// iOS 10.3 (10.3.1 - 14E8301) - com.apple.CoreSimulator.SimRuntime.iOS-10-3
// iOS 13.4 (13.4 - 17E255) - com.apple.CoreSimulator.SimRuntime.iOS-13-4
// tvOS 13.4 (13.4 - 17L255) - com.apple.CoreSimulator.SimRuntime.tvOS-13-4
// watchOS 6.2 (6.2 - 17T256) - com.apple.CoreSimulator.SimRuntime.watchOS-6-2
String
iOSSimRuntime
;
String
watchSimRuntime
;
final
RegExp
iOSRuntimePattern
=
RegExp
(
r'iOS .*\) - (.*)'
);
final
RegExp
watchOSRuntimePattern
=
RegExp
(
r'watchOS .*\) - (.*)'
);
for
(
final
String
runtime
in
LineSplitter
.
split
(
availableRuntimes
))
{
// These seem to be in order, so allow matching multiple lines so it grabs
// the last (hopefully latest) one.
final
RegExpMatch
iOSRuntimeMatch
=
iOSRuntimePattern
.
firstMatch
(
runtime
);
if
(
iOSRuntimeMatch
!=
null
)
{
iOSSimRuntime
=
iOSRuntimeMatch
.
group
(
1
).
trim
();
continue
;
}
final
RegExpMatch
watchOSRuntimeMatch
=
watchOSRuntimePattern
.
firstMatch
(
runtime
);
if
(
watchOSRuntimeMatch
!=
null
)
{
watchSimRuntime
=
watchOSRuntimeMatch
.
group
(
1
).
trim
();
}
}
if
(
iOSSimRuntime
==
null
||
watchSimRuntime
==
null
)
{
String
message
;
if
(
iOSSimRuntime
!=
null
)
{
message
=
'Found "
$iOSSimRuntime
", but no watchOS simulator runtime found.'
;
}
else
if
(
watchSimRuntime
!=
null
)
{
message
=
'Found "
$watchSimRuntime
", but no iOS simulator runtime found.'
;
}
else
{
message
=
'watchOS and iOS simulator runtimes not found.'
;
}
return
TaskResult
.
failure
(
'
$message
Available runtimes:
\n
$availableRuntimes
'
);
}
// Create iOS simulator.
phoneDeviceID
=
await
eval
(
'xcrun'
,
<
String
>[
...
...
@@ -82,12 +132,13 @@ Future<void> main() async {
'create'
,
'TestFlutteriPhoneWithWatch'
,
'com.apple.CoreSimulator.SimDeviceType.iPhone-11'
,
'com.apple.CoreSimulator.SimRuntime.iOS-13-2'
,
iOSSimRuntime
,
],
canFail:
false
,
workingDirectory:
flutterDirectory
.
path
,
);
// Create watchOS simulator.
watchDeviceID
=
await
eval
(
'xcrun'
,
<
String
>[
...
...
@@ -95,7 +146,7 @@ Future<void> main() async {
'create'
,
'TestFlutterWatch'
,
'com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-5-44mm'
,
'com.apple.CoreSimulator.SimRuntime.watchOS-6-1'
watchSimRuntime
,
],
canFail:
false
,
workingDirectory:
flutterDirectory
.
path
,
...
...
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