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
52687c79
Unverified
Commit
52687c79
authored
Feb 12, 2019
by
KyleWong
Committed by
GitHub
Feb 12, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimize flutter run logic for iOS by "ONLY_ACTIVE_ARCH=YES" if possible (#27817)
parent
963d69d8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
2 deletions
+15
-2
devices.dart
packages/flutter_tools/lib/src/ios/devices.dart
+4
-0
mac.dart
packages/flutter_tools/lib/src/ios/mac.dart
+10
-1
mac_test.dart
packages/flutter_tools/test/ios/mac_test.dart
+1
-1
No files found.
packages/flutter_tools/lib/src/ios/devices.dart
View file @
52687c79
...
...
@@ -243,6 +243,9 @@ class IOSDevice extends Device {
// TODO(chinmaygarde): Use mainPath, route.
printTrace
(
'Building
${package.name}
for
$id
'
);
final
String
cpuArchitecture
=
await
iMobileDevice
.
getInfoForDevice
(
id
,
'CPUArchitecture'
);
final
IOSArch
iosArch
=
getIOSArchForName
(
cpuArchitecture
);
// Step 1: Build the precompiled/DBC application if necessary.
final
XcodeBuildResult
buildResult
=
await
buildXcodeProject
(
app:
package
,
...
...
@@ -250,6 +253,7 @@ class IOSDevice extends Device {
targetOverride:
mainPath
,
buildForDevice:
true
,
usesTerminalUi:
usesTerminalUi
,
activeArch:
iosArch
);
if
(!
buildResult
.
success
)
{
printError
(
'Could not build the precompiled application for the device.'
);
...
...
packages/flutter_tools/lib/src/ios/mac.dart
View file @
52687c79
...
...
@@ -134,7 +134,7 @@ class IMobileDevice {
Future
<
String
>
getInfoForDevice
(
String
deviceID
,
String
key
)
async
{
try
{
final
ProcessResult
result
=
await
processManager
.
run
(<
String
>[
'ideviceinfo'
,
'-u'
,
deviceID
,
'-k'
,
key
,
'--simple'
]);
final
ProcessResult
result
=
await
processManager
.
run
(<
String
>[
'ideviceinfo'
,
'-u'
,
deviceID
,
'-k'
,
key
]);
if
(
result
.
exitCode
==
255
&&
result
.
stdout
!=
null
&&
result
.
stdout
.
contains
(
'No device found'
))
throw
IOSDeviceNotFoundError
(
'ideviceinfo could not find device:
\n
${result.stdout}
'
);
if
(
result
.
exitCode
!=
0
)
...
...
@@ -294,6 +294,7 @@ Future<XcodeBuildResult> buildXcodeProject({
BuildInfo
buildInfo
,
String
targetOverride
,
bool
buildForDevice
,
IOSArch
activeArch
,
bool
codesign
=
true
,
bool
usesTerminalUi
=
true
,
})
async
{
...
...
@@ -435,6 +436,14 @@ Future<XcodeBuildResult> buildXcodeProject({
buildCommands
.
addAll
(<
String
>[
'-sdk'
,
'iphonesimulator'
,
'-arch'
,
'x86_64'
]);
}
if
(
activeArch
!=
null
)
{
final
String
activeArchName
=
getNameForIOSArch
(
activeArch
);
if
(
activeArchName
!=
null
)
{
buildCommands
.
add
(
'ONLY_ACTIVE_ARCH=YES'
);
buildCommands
.
add
(
'ARCHS=
$activeArchName
'
);
}
}
if
(!
codesign
)
{
buildCommands
.
addAll
(
<
String
>[
...
...
packages/flutter_tools/test/ios/mac_test.dart
View file @
52687c79
...
...
@@ -130,7 +130,7 @@ void main() {
});
testUsingContext
(
'getInfoForDevice throws IOSDeviceNotFoundError when ideviceinfo returns specific error code and message'
,
()
async
{
when
(
mockProcessManager
.
run
(<
String
>[
'ideviceinfo'
,
'-u'
,
'foo'
,
'-k'
,
'bar'
,
'--simple'
]))
when
(
mockProcessManager
.
run
(<
String
>[
'ideviceinfo'
,
'-u'
,
'foo'
,
'-k'
,
'bar'
]))
.
thenAnswer
((
_
)
=>
Future
<
ProcessResult
>.
value
(
ProcessResult
(
1
,
255
,
'No device found with udid foo, is it plugged in?'
,
''
)));
expect
(()
async
=>
await
iMobileDevice
.
getInfoForDevice
(
'foo'
,
'bar'
),
throwsA
(
isInstanceOf
<
IOSDeviceNotFoundError
>()));
},
overrides:
<
Type
,
Generator
>{
...
...
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