Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Fix" Print: Entry, ":CFBundleIdentifier", Does Not Exist error #18710

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions local-cli/runIOS/runIOS.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ function runOnDeviceByUdid(args, scheme, xcodeProject, devices) {
}

function runOnSimulator(xcodeProject, args, scheme) {
return new Promise((resolve) => {
return Promise.resolve()
.then(() => {
try {
var simulators = JSON.parse(
child_process.execFileSync('xcrun', ['simctl', 'list', '--json', 'devices'], {encoding: 'utf8'})
Expand Down Expand Up @@ -142,8 +143,8 @@ function runOnSimulator(xcodeProject, args, scheme) {
}
}

buildProject(xcodeProject, selectedSimulator.udid, scheme, args.configuration, args.packager, args.verbose, args.port)
.then((appName) => resolve({ udid: selectedSimulator.udid, appName }));
return buildProject(xcodeProject, selectedSimulator.udid, scheme, args.configuration, args.packager, args.verbose, args.port)
.then((appName) => ({ udid: selectedSimulator.udid, appName }));
})
.then(({udid, appName}) => {
if (!appName) {
Expand Down Expand Up @@ -213,19 +214,21 @@ function buildProject(xcodeProject, udid, scheme, configuration = 'Debug', launc
console.log(data.toString());
}
});
const errOutputChunks = [];
buildProcess.stderr.on('data', function(data) {
console.error(data.toString());
errOutputChunks.push(data.toString());
});
buildProcess.on('close', function(code) {
buildProcess.on('close', function(exitCode) {
if (xcpretty) {
xcpretty.stdin.end();
}
if (exitCode !== 0) {
return reject(errOutputChunks.join('\n'));
}
//FULL_PRODUCT_NAME is the actual file name of the app, which actually comes from the Product Name in the build config, which does not necessary match a scheme name, example output line: export FULL_PRODUCT_NAME="Super App Dev.app"
let productNameMatch = /export FULL_PRODUCT_NAME="?(.+).app"?$/m.exec(buildOutput);
if (productNameMatch && productNameMatch.length && productNameMatch.length > 1) {
return resolve(productNameMatch[1]);//0 is the full match, 1 is the app name
}
return buildProcess.error ? reject(buildProcess.error) : resolve();
//[0] of productNameMatch is the full match, [1] is the app name
return resolve(productNameMatch && productNameMatch.length && productNameMatch.length > 1 ? productNameMatch[1] : undefined);
});
});
}
Expand Down