Skip to content

Commit 59f6e1e

Browse files
committed
feat: update xcode permission by command - test
1 parent d2804db commit 59f6e1e

File tree

3 files changed

+47
-14
lines changed

3 files changed

+47
-14
lines changed

ABS.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,12 @@ def CreateTask(self,Args):
115115
Args.Clean = True
116116
Args.GenProject = True
117117
# Args.GenIOSProject = True
118+
119+
# [Fix] Generate IOS Project for Legacy UE versions to ensure correct Workspace configuration
120+
UBSHelper.Get().Init(Args)
121+
if not UBSHelper.Get().Is_UE53_Or_Later():
122+
Args.GenIOSProject = True
123+
118124
Args.BuildCookRun = True
119125
PyUnrealBuildSystem.Get().CreateTask(Args)
120126
Args.BuildCookRun = False

Platform/IOS.py

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,20 +289,35 @@ def PostPackaged_UseLegencyXcodeProject(self):
289289
# UnrealProjectManager.ReplaceXcodeProject(path_project_root,src_root_path_resource,"ProjectFilesIOS")
290290
path_py_sys_root = Path(__file__).parent.parent
291291
path_ue_config_resources = path_py_sys_root / "Config" / "UEConfig" / "Resources"
292-
UnrealProjectManager.AddIOSBroadcastExtension(path_project_root, path_ue_config_resources)
292+
293+
# [Fix] Pass Signing Info to Ruby Script
294+
ioscert_tag_name = self.Params['ioscert']
295+
OneIOSCert:IOSCertInfo = ConfigParser.Get().GetOneIOSCertificate(ioscert_tag_name)
296+
team_id = ""
297+
provisioning_profile_specifier = ""
298+
if OneIOSCert != None:
299+
team_id = OneIOSCert.get_team_id
300+
provisioning_profile_specifier = OneIOSCert.get_provisioning_profile_specifier
301+
302+
UnrealProjectManager.AddIOSBroadcastExtension(path_project_root, path_ue_config_resources, team_id, provisioning_profile_specifier)
293303

294304
OneXcodeCommand = XcodeCommand()
295305

296306
params = ParamsXcodebuild()
297307

298308
# Legacy UE4 Workspace Logic
299-
# Try to find valid workspace in root first (UE4 convention)
300-
# Or Intermediate/ProjectFiles
309+
# Check for _IOS.xcworkspace first (Created by GenIOSProject, specific for iOS)
310+
name_workspace_ios = uproject_name + "_IOS.xcworkspace"
311+
path_workspace_ios = path_project_root / name_workspace_ios
301312

302313
name_workspace_root = uproject_name + ".xcworkspace"
303314
path_workspace_root = path_project_root / name_workspace_root
304315

305-
if path_workspace_root.exists():
316+
if path_workspace_ios.exists():
317+
PrintLog(f"Found iOS specific workspace: {path_workspace_ios}")
318+
params.workspace = path_workspace_ios
319+
elif path_workspace_root.exists():
320+
PrintLog(f"Found standard workspace: {path_workspace_root}")
306321
params.workspace = path_workspace_root
307322
else:
308323
PrintLog(f"Cannot find workspace in root path {path_workspace_root}")

Utility/UnrealProjectManager.py

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -237,16 +237,28 @@ def AddIOSBroadcastExtension(path_project_root, src_root_path_resource, team_id
237237
PrintLog("[AddIOSBroadcastExtension] Configuring Xcode Project via Ruby...")
238238

239239
# Find .xcodeproj
240-
# Assuming UE structure: [ProjectRoot]/Intermediate/ProjectFiles/[ProjectName].xcodeproj
241-
# Or checking what exists.
242240
project_name = UBSHelper.Get().GetName_ProjectName()
243-
path_xcodeproj = path_project / "Intermediate" / "ProjectFiles" / (project_name + "_IOS.xcodeproj")
241+
path_xcodeproj = None # Reset
244242

245-
# In UE5 Modern Xcode, it might be different structure or name?
246-
# Based on logs: "UnrealGame (IOS).xcodeproj" or "AgoraExample_IOS.xcworkspace"
247-
# Since we are modifying the project file that generates the workspace logic or the one used inside it.
248-
# But UE often regenerates these.
249-
# If modern Xcode: [ProjectRoot]/Intermediate/ProjectFiles/[ProjectName].xcodeproj matches?
243+
# Priority Check: ProjectFilesIOS (Legacy IOS specific)
244+
# This is where GenIOSProject (-XcodeProjectFiles -platforms=IOS) typically puts the project in older UE versions.
245+
# Check this BEFORE standard ProjectFiles to avoid picking up the Mac-only project.
246+
path_legacy_ios_folder = path_project / "Intermediate" / "ProjectFilesIOS"
247+
if path_legacy_ios_folder.exists():
248+
# Try [ProjectName].xcodeproj
249+
path_temp = path_legacy_ios_folder / (project_name + ".xcodeproj")
250+
if path_temp.exists():
251+
path_xcodeproj = path_temp
252+
253+
# Try [ProjectName]_IOS.xcodeproj
254+
if not path_xcodeproj:
255+
path_temp = path_legacy_ios_folder / (project_name + "_IOS.xcodeproj")
256+
if path_temp.exists():
257+
path_xcodeproj = path_temp
258+
259+
if not path_xcodeproj:
260+
# Fallback to standard locations
261+
path_xcodeproj = path_project / "Intermediate" / "ProjectFiles" / (project_name + "_IOS.xcodeproj")
250262

251263
# Fallback check
252264
if not path_xcodeproj.exists():
@@ -265,13 +277,13 @@ def AddIOSBroadcastExtension(path_project_root, src_root_path_resource, team_id
265277
if path_temp.exists():
266278
path_xcodeproj = path_temp
267279

268-
# Check ProjectFilesIOS folder (Legacy IOS project structure)
280+
# Check ProjectFilesIOS folder (Legacy IOS project structure) - Redundant if Priority Check worked, but kept for safety
269281
if not path_xcodeproj.exists():
270282
path_temp = path_project / "Intermediate" / "ProjectFilesIOS" / (project_name + "_IOS.xcodeproj")
271283
if path_temp.exists():
272284
path_xcodeproj = path_temp
273285

274-
if path_xcodeproj.exists():
286+
if path_xcodeproj and path_xcodeproj.exists():
275287
# Params
276288
script_path = Path("Tools/ios_extension_setup.rb").resolve()
277289
# Targets

0 commit comments

Comments
 (0)