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
f76b2926
Unverified
Commit
f76b2926
authored
Jun 30, 2021
by
Jenn Magder
Committed by
GitHub
Jun 30, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support iOS arm64 simulator (#85642)
parent
4013fe21
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
45 additions
and
28 deletions
+45
-28
build_ios_framework_module_test.dart
dev/devicelab/bin/tasks/build_ios_framework_module_test.dart
+6
-6
project.pbxproj
...gration_tests/ios_host_app/Host.xcodeproj/project.pbxproj
+0
-1
project.pbxproj
...n_tests/ios_host_app_swift/Host.xcodeproj/project.pbxproj
+0
-1
podhelper.rb
packages/flutter_tools/bin/podhelper.rb
+4
-3
artifacts.dart
packages/flutter_tools/lib/src/artifacts.dart
+2
-3
build_info.dart
packages/flutter_tools/lib/src/build_info.dart
+2
-2
build_ios_framework.dart
...s/flutter_tools/lib/src/commands/build_ios_framework.dart
+0
-1
xcode_build_settings.dart
packages/flutter_tools/lib/src/ios/xcode_build_settings.dart
+3
-3
xcodeproj_test.dart
.../flutter_tools/test/general.shard/ios/xcodeproj_test.dart
+28
-8
No files found.
dev/devicelab/bin/tasks/build_ios_framework_module_test.dart
View file @
f76b2926
...
...
@@ -147,7 +147,7 @@ Future<void> _testBuildIosFramework(Directory projectDir, { bool isModule = fals
outputPath
,
'Debug'
,
'App.xcframework'
,
'ios-x86_64-simulator'
,
'ios-
arm64_
x86_64-simulator'
,
'App.framework'
,
'flutter_assets'
,
'vm_snapshot_data'
,
...
...
@@ -210,7 +210,7 @@ Future<void> _testBuildIosFramework(Directory projectDir, { bool isModule = fals
outputPath
,
mode
,
'App.xcframework'
,
'ios-x86_64-simulator'
,
'ios-
arm64_
x86_64-simulator'
,
'App.framework'
,
'App'
,
));
...
...
@@ -219,7 +219,7 @@ Future<void> _testBuildIosFramework(Directory projectDir, { bool isModule = fals
outputPath
,
mode
,
'App.xcframework'
,
'ios-x86_64-simulator'
,
'ios-
arm64_
x86_64-simulator'
,
'App.framework'
,
'Info.plist'
,
));
...
...
@@ -312,7 +312,7 @@ Future<void> _testBuildIosFramework(Directory projectDir, { bool isModule = fals
outputPath
,
mode
,
'device_info.xcframework'
,
'ios-x86_64-simulator'
,
'ios-
arm64_
x86_64-simulator'
,
'device_info.framework'
,
'device_info'
,
);
...
...
@@ -321,7 +321,7 @@ Future<void> _testBuildIosFramework(Directory projectDir, { bool isModule = fals
outputPath
,
mode
,
'device_info.xcframework'
,
'ios-x86_64-simulator'
,
'ios-
arm64_
x86_64-simulator'
,
'device_info.framework'
,
'Headers'
,
'DeviceInfoPlugin.h'
,
...
...
@@ -368,7 +368,7 @@ Future<void> _testBuildIosFramework(Directory projectDir, { bool isModule = fals
outputPath
,
mode
,
'FlutterPluginRegistrant.xcframework'
,
'ios-x86_64-simulator'
,
'ios-
arm64_
x86_64-simulator'
,
'FlutterPluginRegistrant.framework'
,
'Headers'
,
'GeneratedPluginRegistrant.h'
,
...
...
dev/integration_tests/ios_host_app/Host.xcodeproj/project.pbxproj
View file @
f76b2926
...
...
@@ -447,7 +447,6 @@
DEBUG_INFORMATION_FORMAT
=
dwarf
;
ENABLE_STRICT_OBJC_MSGSEND
=
YES
;
ENABLE_TESTABILITY
=
YES
;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]"
=
arm64
;
GCC_C_LANGUAGE_STANDARD
=
gnu11
;
GCC_DYNAMIC_NO_PIC
=
NO
;
GCC_NO_COMMON_BLOCKS
=
YES
;
...
...
dev/integration_tests/ios_host_app_swift/Host.xcodeproj/project.pbxproj
View file @
f76b2926
...
...
@@ -390,7 +390,6 @@
buildSettings
=
{
ASSETCATALOG_COMPILER_APPICON_NAME
=
AppIcon
;
CODE_SIGN_STYLE
=
Automatic
;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]"
=
arm64
;
INFOPLIST_FILE
=
Host/Info.plist
;
LD_RUNPATH_SEARCH_PATHS
=
(
"$(inherited)"
,
...
...
packages/flutter_tools/bin/podhelper.rb
View file @
f76b2926
...
...
@@ -55,7 +55,7 @@ def flutter_additional_ios_build_settings(target)
# Profile can't be derived from the CocoaPods build configuration. Use release framework (for linking only).
configuration_engine_dir
=
build_configuration
.
type
==
:debug
?
debug_framework_dir
:
release_framework_dir
Dir
.
new
(
configuration_engine_dir
).
each_child
do
|
xcframework_file
|
if
xcframework_file
.
end_with?
(
"-simulator"
)
# ios-x86_64-simulator
if
xcframework_file
.
end_with?
(
"-simulator"
)
# ios-
arm64_
x86_64-simulator
build_configuration
.
build_settings
[
'FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*]'
]
=
"
\"
#{
configuration_engine_dir
}
/
#{
xcframework_file
}
\"
$(inherited)"
elsif
xcframework_file
.
start_with?
(
"ios-"
)
# ios-armv7_arm64
build_configuration
.
build_settings
[
'FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]'
]
=
"
\"
#{
configuration_engine_dir
}
/
#{
xcframework_file
}
\"
$(inherited)"
...
...
@@ -72,8 +72,9 @@ def flutter_additional_ios_build_settings(target)
# If the pod only supports a higher version, do not delete to correctly produce an error.
build_configuration
.
build_settings
.
delete
'IPHONEOS_DEPLOYMENT_TARGET'
if
inherit_deployment_target
# Apple Silicon ARM simulators not yet supported.
build_configuration
.
build_settings
[
'EXCLUDED_ARCHS[sdk=iphonesimulator*]'
]
=
'arm64 i386'
# Override legacy Xcode 11 style VALID_ARCHS[sdk=iphonesimulator*]=x86_64 and prefer Xcode 12 EXCLUDED_ARCHS.
build_configuration
.
build_settings
[
'VALID_ARCHS[sdk=iphonesimulator*]'
]
=
'$(ARCHS_STANDARD)'
build_configuration
.
build_settings
[
'EXCLUDED_ARCHS[sdk=iphonesimulator*]'
]
=
'i386'
end
end
...
...
packages/flutter_tools/lib/src/artifacts.dart
View file @
f76b2926
...
...
@@ -672,9 +672,8 @@ String _getIosEngineArtifactPath(String engineDirectory,
if
(!
platformDirectory
.
basename
.
startsWith
(
'ios-'
))
{
continue
;
}
// ios-x86_64-simulator, ios-armv7_arm64 (Xcode 11), or ios-arm64_armv7 (Xcode 12).
final
bool
simulatorDirectory
=
platformDirectory
.
basename
.
endsWith
(
'-simulator'
);
// ios-x86_64-simulator, ios-arm64_x86_64-simulator, ios-armv7_arm64 (Xcode 11), or ios-arm64_armv7 (Xcode 12).
final
bool
simulatorDirectory
=
platformDirectory
.
basename
.
endsWith
(
'-simulator'
);
if
((
environmentType
==
EnvironmentType
.
simulator
&&
simulatorDirectory
)
||
(
environmentType
==
EnvironmentType
.
physical
&&
!
simulatorDirectory
))
{
flutterFrameworkSource
=
platformDirectory
;
...
...
packages/flutter_tools/lib/src/build_info.dart
View file @
f76b2926
...
...
@@ -547,8 +547,8 @@ List<DarwinArch> defaultIOSArchsForEnvironment(
EnvironmentType
environmentType
)
{
if
(
environmentType
==
EnvironmentType
.
simulator
)
{
return
<
DarwinArch
>[
// Apple Silicon ARM simulators not yet supported.
DarwinArch
.
x86_64
,
DarwinArch
.
arm64
,
];
}
return
<
DarwinArch
>[
...
...
@@ -876,7 +876,7 @@ const String kIosArchs = 'IosArchs';
/// The define to control what macOS architectures are built for.
///
/// This is expected to be a space-delimited list of architectures. If not
/// provided, defau
tl
s to x86_64.
/// provided, defau
lt
s to x86_64.
///
/// Supported values are x86_64 and arm64.
const
String
kDarwinArchs
=
'DarwinArchs'
;
...
...
packages/flutter_tools/lib/src/commands/build_ios_framework.dart
View file @
f76b2926
...
...
@@ -454,7 +454,6 @@ end
simulatorConfiguration,
'
SYMROOT
=
$
{
simulatorBuildOutput
.
path
}
',
'
ENABLE_BITCODE
=
YES
', // Support host apps with bitcode enabled.
'
ARCHS
=
x86_64
',
'
ONLY_ACTIVE_ARCH
=
NO
', // No device targeted, so build all valid architectures.
'
BUILD_LIBRARY_FOR_DISTRIBUTION
=
YES
',
];
...
...
packages/flutter_tools/lib/src/ios/xcode_build_settings.dart
View file @
f76b2926
...
...
@@ -190,8 +190,9 @@ List<String> _xcodeBuildSettingsLines({
String
arch
;
if
(
localEngineName
.
endsWith
(
'_arm'
))
{
arch
=
'armv7'
;
}
else
if
(
localEngineName
.
contains
(
'_arm64'
))
{
arch
=
'arm64'
;
}
else
if
(
localEngineName
.
contains
(
'_sim'
))
{
// Apple Silicon ARM simulators not yet supported.
arch
=
'x86_64'
;
}
else
{
arch
=
'arm64'
;
...
...
@@ -203,8 +204,7 @@ List<String> _xcodeBuildSettingsLines({
// ARM not yet supported https://github.com/flutter/flutter/issues/69221
xcodeBuildSettings
.
add
(
'EXCLUDED_ARCHS=arm64'
);
}
else
{
// Apple Silicon ARM simulators not yet supported.
xcodeBuildSettings
.
add
(
'EXCLUDED_ARCHS[sdk=iphonesimulator*]=arm64 i386'
);
xcodeBuildSettings
.
add
(
'EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386'
);
}
for
(
final
MapEntry
<
String
,
String
>
config
in
buildInfo
.
toEnvironmentConfig
().
entries
)
{
...
...
packages/flutter_tools/test/general.shard/ios/xcodeproj_test.dart
View file @
f76b2926
...
...
@@ -698,7 +698,7 @@ Information about project "Runner":
final
String
contents
=
config
.
readAsStringSync
();
expect
(
contents
.
contains
(
'ARCHS=armv7'
),
isTrue
);
expect
(
contents
.
contains
(
'EXCLUDED_ARCHS[sdk=iphonesimulator*]=
arm64
i386'
),
isTrue
);
expect
(
contents
.
contains
(
'EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386'
),
isTrue
);
final
File
buildPhaseScript
=
fs
.
file
(
'path/to/project/ios/Flutter/flutter_export_environment.sh'
);
expect
(
buildPhaseScript
.
existsSync
(),
isTrue
);
...
...
@@ -751,13 +751,33 @@ Information about project "Runner":
});
group
(
'sim local engine'
,
()
{
Artifacts
localArtifacts
;
testUsingContext
(
'sets ARCHS=x86_64 when x86 sim local engine is set'
,
()
async
{
const
BuildInfo
buildInfo
=
BuildInfo
.
debug
;
final
FlutterProject
project
=
FlutterProject
.
fromDirectoryTest
(
fs
.
directory
(
'path/to/project'
));
await
updateGeneratedXcodeProperties
(
project:
project
,
buildInfo:
buildInfo
,
);
setUp
(()
{
localArtifacts
=
Artifacts
.
test
(
localEngine:
'out/ios_debug_sim_unopt'
);
final
File
config
=
fs
.
file
(
'path/to/project/ios/Flutter/Generated.xcconfig'
);
expect
(
config
.
existsSync
(),
isTrue
);
final
String
contents
=
config
.
readAsStringSync
();
expect
(
contents
.
contains
(
'ARCHS=x86_64'
),
isTrue
);
final
File
buildPhaseScript
=
fs
.
file
(
'path/to/project/ios/Flutter/flutter_export_environment.sh'
);
expect
(
buildPhaseScript
.
existsSync
(),
isTrue
);
final
String
buildPhaseScriptContents
=
buildPhaseScript
.
readAsStringSync
();
expect
(
buildPhaseScriptContents
.
contains
(
'ARCHS=x86_64'
),
isTrue
);
},
overrides:
<
Type
,
Generator
>{
Artifacts:
()
=>
Artifacts
.
test
(
localEngine:
'out/ios_debug_sim_unopt'
),
Platform:
()
=>
macOS
,
FileSystem:
()
=>
fs
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
testUsingContext
(
'sets ARCHS=
x86_64 when
sim local engine is set'
,
()
async
{
testUsingContext
(
'sets ARCHS=
arm64 when arm64
sim local engine is set'
,
()
async
{
const
BuildInfo
buildInfo
=
BuildInfo
.
debug
;
final
FlutterProject
project
=
FlutterProject
.
fromDirectoryTest
(
fs
.
directory
(
'path/to/project'
));
await
updateGeneratedXcodeProperties
(
...
...
@@ -769,15 +789,15 @@ Information about project "Runner":
expect
(
config
.
existsSync
(),
isTrue
);
final
String
contents
=
config
.
readAsStringSync
();
expect
(
contents
.
contains
(
'ARCHS=
x86_
64'
),
isTrue
);
expect
(
contents
.
contains
(
'ARCHS=
arm
64'
),
isTrue
);
final
File
buildPhaseScript
=
fs
.
file
(
'path/to/project/ios/Flutter/flutter_export_environment.sh'
);
expect
(
buildPhaseScript
.
existsSync
(),
isTrue
);
final
String
buildPhaseScriptContents
=
buildPhaseScript
.
readAsStringSync
();
expect
(
buildPhaseScriptContents
.
contains
(
'ARCHS=
x86_
64'
),
isTrue
);
expect
(
buildPhaseScriptContents
.
contains
(
'ARCHS=
arm
64'
),
isTrue
);
},
overrides:
<
Type
,
Generator
>{
Artifacts:
()
=>
localArtifacts
,
Artifacts:
()
=>
Artifacts
.
test
(
localEngine:
'out/ios_debug_sim_arm64'
)
,
Platform:
()
=>
macOS
,
FileSystem:
()
=>
fs
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
...
...
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