Skip to content

Commit 710cb75

Browse files
committed
feat: update iOS project configuration for Flutter integration and LLDB support
1 parent bc51720 commit 710cb75

7 files changed

Lines changed: 81 additions & 14 deletions

File tree

example/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,5 @@
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
23-
<key>MinimumOSVersion</key>
24-
<string>11.0</string>
2523
</dict>
2624
</plist>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#
2+
# Generated file, do not edit.
3+
#
4+
5+
import lldb
6+
7+
def handle_new_rx_page(frame: lldb.SBFrame, bp_loc, extra_args, intern_dict):
8+
"""Intercept NOTIFY_DEBUGGER_ABOUT_RX_PAGES and touch the pages."""
9+
base = frame.register["x0"].GetValueAsAddress()
10+
page_len = frame.register["x1"].GetValueAsUnsigned()
11+
12+
# Note: NOTIFY_DEBUGGER_ABOUT_RX_PAGES will check contents of the
13+
# first page to see if handled it correctly. This makes diagnosing
14+
# misconfiguration (e.g. missing breakpoint) easier.
15+
data = bytearray(page_len)
16+
data[0:8] = b'IHELPED!'
17+
18+
error = lldb.SBError()
19+
frame.GetThread().GetProcess().WriteMemory(base, data, error)
20+
if not error.Success():
21+
print(f'Failed to write into {base}[+{page_len}]', error)
22+
return
23+
24+
def __lldb_init_module(debugger: lldb.SBDebugger, _):
25+
target = debugger.GetDummyTarget()
26+
# Caveat: must use BreakpointCreateByRegEx here and not
27+
# BreakpointCreateByName. For some reasons callback function does not
28+
# get carried over from dummy target for the later.
29+
bp = target.BreakpointCreateByRegex("^NOTIFY_DEBUGGER_ABOUT_RX_PAGES$")
30+
bp.SetScriptCallbackFunction('{}.handle_new_rx_page'.format(__name__))
31+
bp.SetAutoContinue(True)
32+
print("-- LLDB integration loaded --")
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#
2+
# Generated file, do not edit.
3+
#
4+
5+
command script import --relative-to-command-file flutter_lldb_helper.py

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 50;
6+
objectVersion = 54;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -135,7 +135,7 @@
135135
97C146E61CF9000F007C117D /* Project object */ = {
136136
isa = PBXProject;
137137
attributes = {
138-
LastUpgradeCheck = 1300;
138+
LastUpgradeCheck = 1510;
139139
ORGANIZATIONNAME = "The Chromium Authors";
140140
TargetAttributes = {
141141
97C146ED1CF9000F007C117D = {
@@ -180,10 +180,12 @@
180180
/* Begin PBXShellScriptBuildPhase section */
181181
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
182182
isa = PBXShellScriptBuildPhase;
183+
alwaysOutOfDate = 1;
183184
buildActionMask = 2147483647;
184185
files = (
185186
);
186187
inputPaths = (
188+
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
187189
);
188190
name = "Thin Binary";
189191
outputPaths = (
@@ -194,6 +196,7 @@
194196
};
195197
9740EEB61CF901F6004384FC /* Run Script */ = {
196198
isa = PBXShellScriptBuildPhase;
199+
alwaysOutOfDate = 1;
197200
buildActionMask = 2147483647;
198201
files = (
199202
);
@@ -281,7 +284,7 @@
281284
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
282285
GCC_WARN_UNUSED_FUNCTION = YES;
283286
GCC_WARN_UNUSED_VARIABLE = YES;
284-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
287+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
285288
MTL_ENABLE_DEBUG_INFO = NO;
286289
SDKROOT = iphoneos;
287290
SUPPORTED_PLATFORMS = iphoneos;
@@ -364,7 +367,7 @@
364367
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
365368
GCC_WARN_UNUSED_FUNCTION = YES;
366369
GCC_WARN_UNUSED_VARIABLE = YES;
367-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
370+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
368371
MTL_ENABLE_DEBUG_INFO = YES;
369372
ONLY_ACTIVE_ARCH = YES;
370373
SDKROOT = iphoneos;
@@ -413,7 +416,7 @@
413416
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
414417
GCC_WARN_UNUSED_FUNCTION = YES;
415418
GCC_WARN_UNUSED_VARIABLE = YES;
416-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
419+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
417420
MTL_ENABLE_DEBUG_INFO = NO;
418421
SDKROOT = iphoneos;
419422
SUPPORTED_PLATFORMS = iphoneos;

example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1300"
3+
LastUpgradeVersion = "1510"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,6 +26,7 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
2930
shouldUseLaunchSchemeArgsEnv = "YES">
3031
<Testables>
3132
</Testables>
@@ -45,11 +46,13 @@
4546
buildConfiguration = "Debug"
4647
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4748
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
49+
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
4850
launchStyle = "0"
4951
useCustomWorkingDirectory = "NO"
5052
ignoresPersistentStateOnLaunch = "NO"
5153
debugDocumentVersioning = "YES"
5254
debugServiceExtension = "internal"
55+
enableGPUValidationMode = "1"
5356
allowLocationSimulation = "YES">
5457
<BuildableProductRunnable
5558
runnableDebuggingMode = "0">
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
import UIKit
21
import Flutter
2+
import UIKit
33

4-
@UIApplicationMain
5-
@objc class AppDelegate: FlutterAppDelegate {
4+
@main
5+
@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate {
66
override func application(
77
_ application: UIApplication,
88
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
99
) -> Bool {
10-
GeneratedPluginRegistrant.register(with: self)
1110
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
1211
}
12+
13+
func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) {
14+
GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry)
15+
}
1316
}

example/ios/Runner/Info.plist

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5+
<key>CADisableMinimumFrameDurationOnPhone</key>
6+
<true/>
57
<key>CFBundleDevelopmentRegion</key>
68
<string>$(DEVELOPMENT_LANGUAGE)</string>
79
<key>CFBundleExecutable</key>
@@ -22,6 +24,29 @@
2224
<string>$(FLUTTER_BUILD_NUMBER)</string>
2325
<key>LSRequiresIPhoneOS</key>
2426
<true/>
27+
<key>UIApplicationSceneManifest</key>
28+
<dict>
29+
<key>UIApplicationSupportsMultipleScenes</key>
30+
<false/>
31+
<key>UISceneConfigurations</key>
32+
<dict>
33+
<key>UIWindowSceneSessionRoleApplication</key>
34+
<array>
35+
<dict>
36+
<key>UISceneClassName</key>
37+
<string>UIWindowScene</string>
38+
<key>UISceneConfigurationName</key>
39+
<string>flutter</string>
40+
<key>UISceneDelegateClassName</key>
41+
<string>FlutterSceneDelegate</string>
42+
<key>UISceneStoryboardFile</key>
43+
<string>Main</string>
44+
</dict>
45+
</array>
46+
</dict>
47+
</dict>
48+
<key>UIApplicationSupportsIndirectInputEvents</key>
49+
<true/>
2550
<key>UILaunchStoryboardName</key>
2651
<string>LaunchScreen</string>
2752
<key>UIMainStoryboardFile</key>
@@ -41,7 +66,5 @@
4166
</array>
4267
<key>UIViewControllerBasedStatusBarAppearance</key>
4368
<false/>
44-
<key>CADisableMinimumFrameDurationOnPhone</key>
45-
<true/>
4669
</dict>
4770
</plist>

0 commit comments

Comments
 (0)