Skip to content

Commit e8cd1ba

Browse files
authored
[mcp] fix issue where crashlytics isn't detected for ios apps that use project.pbxproj (#9515)
* fix issue where crashlytics isn't detected for ios apps that use project.pbxproj * update changelog
1 parent 804c2ee commit e8cd1ba

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Fixed issue where MCP server didn't detect if iOS app uses Crashlytics in projects that use `project.pbxproj` (#9515)

src/mcp/util/crashlytics/availability.spec.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,23 @@ describe("isCrashlyticsAvailable", () => {
236236
expect(result).to.be.false;
237237
});
238238

239+
it("should return true for an iOS project with Crashlytics in project.pbxproj", async () => {
240+
mockfs({
241+
"/test-dir": {
242+
ios: {
243+
"Project.xcodeproj": {
244+
"project.pbxproj":
245+
"/* Begin PBXBuildFile section */ /* FirebaseCore in Frameworks */ = {isa = PBXBuildFile; /* FirebaseCore */; }; /* FirebaseCrashlytics in Frameworks */ = {isa = PBXBuildFile; /* FirebaseCrashlytics */; }; /* End PBXBuildFile section */",
246+
},
247+
},
248+
},
249+
});
250+
251+
const result = await isCrashlyticsAvailable(mockContext("/test-dir"));
252+
253+
expect(result).to.be.true;
254+
});
255+
239256
it("should return true for a Flutter project with Crashlytics in pubspec.yaml", async () => {
240257
mockfs({
241258
"/test-dir": {

src/mcp/util/crashlytics/availability.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,13 @@ async function iosAppUsesCrashlytics(appPath: string): Promise<boolean> {
8080
return true;
8181
}
8282
}
83+
const xcodeProjectFiles = await detectFiles(appPath, "project.pbxproj");
84+
for (const file of xcodeProjectFiles) {
85+
const content = await fs.readFile(path.join(appPath, file), "utf8");
86+
if (content.includes("Crashlytics")) {
87+
return true;
88+
}
89+
}
8390
return false;
8491
}
8592

0 commit comments

Comments
 (0)