Skip to content

Commit ae3d5c0

Browse files
committed
Create main target scheme before installing pods.
1 parent 191a7a5 commit ae3d5c0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/services/ios-project-service.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,14 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
347347
if(firstPostInstallIndex !== -1 && firstPostInstallIndex !== projectPodfileContent.lastIndexOf(IOSProjectService.PODFILE_POST_INSTALL_SECTION_NAME)) {
348348
this.$logger.warn(`Podfile contains more than one post_install sections. You need to open ${this.projectPodFilePath} file and manually resolve this issue.`);
349349
}
350-
350+
351+
let pbxprojFilePath = path.join(this.platformData.projectRoot, this.$projectData.projectName + IOSProjectService.XCODE_PROJECT_EXT_NAME, "xcuserdata");
352+
if(!this.$fs.exists(pbxprojFilePath).wait()) {
353+
this.$logger.info("Creating project scheme...");
354+
let createScheme_rb = `echo \"require 'xcodeproj'; xcproj = Xcodeproj::Project.open('${this.$projectData.projectName}.xcodeproj'); xcproj.recreate_user_schemes; xcproj.save\" | ruby`;
355+
this.$childProcess.exec(createScheme_rb, { cwd: this.platformData.projectRoot }).wait();
356+
}
357+
351358
this.$logger.info("Installing pods...");
352359
this.$childProcess.exec("pod install", { cwd: this.platformData.projectRoot }).wait();
353360
}

0 commit comments

Comments
 (0)