diff --git a/CHANGELOG.md b/CHANGELOG.md index e69de29bb2d..c80e975be87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -0,0 +1 @@ +- Fixed issue where MCP server didn't detect if iOS app uses Crashlytics in projects that use `project.pbxproj` (#9515) diff --git a/src/mcp/util/crashlytics/availability.spec.ts b/src/mcp/util/crashlytics/availability.spec.ts index 3f1cd5c277a..3c96a534705 100644 --- a/src/mcp/util/crashlytics/availability.spec.ts +++ b/src/mcp/util/crashlytics/availability.spec.ts @@ -236,6 +236,23 @@ describe("isCrashlyticsAvailable", () => { expect(result).to.be.false; }); + it("should return true for an iOS project with Crashlytics in project.pbxproj", async () => { + mockfs({ + "/test-dir": { + ios: { + "Project.xcodeproj": { + "project.pbxproj": + "/* Begin PBXBuildFile section */ /* FirebaseCore in Frameworks */ = {isa = PBXBuildFile; /* FirebaseCore */; }; /* FirebaseCrashlytics in Frameworks */ = {isa = PBXBuildFile; /* FirebaseCrashlytics */; }; /* End PBXBuildFile section */", + }, + }, + }, + }); + + const result = await isCrashlyticsAvailable(mockContext("/test-dir")); + + expect(result).to.be.true; + }); + it("should return true for a Flutter project with Crashlytics in pubspec.yaml", async () => { mockfs({ "/test-dir": { diff --git a/src/mcp/util/crashlytics/availability.ts b/src/mcp/util/crashlytics/availability.ts index 8a68741b23a..780339c7907 100644 --- a/src/mcp/util/crashlytics/availability.ts +++ b/src/mcp/util/crashlytics/availability.ts @@ -80,6 +80,13 @@ async function iosAppUsesCrashlytics(appPath: string): Promise { return true; } } + const xcodeProjectFiles = await detectFiles(appPath, "project.pbxproj"); + for (const file of xcodeProjectFiles) { + const content = await fs.readFile(path.join(appPath, file), "utf8"); + if (content.includes("Crashlytics")) { + return true; + } + } return false; }