async function updateProjectFile (agentPath, newBundleId) {
  let projectFilePath = `${agentPath}/${PROJECT_FILE}`;
  try {
    // Assuming projectFilePath is in the correct state, create .old from projectFilePath
    await fs.copyFile(projectFilePath, `${projectFilePath}.old`);
    await replaceInFile(projectFilePath, new RegExp(WDA_RUNNER_BUNDLE_ID.replace('.', '\.'), 'g'), newBundleId); // eslint-disable-line no-useless-escape
    log.debug(`Successfully updated '${projectFilePath}' with bundle id '${newBundleId}'`);
  } catch (err) {
    log.debug(`Error updating project file: ${err.message}`);
    log.warn(`Unable to update project file '${projectFilePath}' with ` +
             `bundle id '${newBundleId}'. WebDriverAgent may not start`);
  }
}
async function updateProjectFile (agentPath, newBundleId) {
  let projectFilePath = `${agentPath}/${PROJECT_FILE}`;
  try {
    // Assuming projectFilePath is in the correct state, create .old from projectFilePath
    await fs.copyFile(projectFilePath, `${projectFilePath}.old`);
    await replaceInFile(projectFilePath, new RegExp(WDA_RUNNER_BUNDLE_ID.replace('.', '\.'), 'g'), newBundleId); // eslint-disable-line no-useless-escape
    log.debug(`Successfully updated '${projectFilePath}' with bundle id '${newBundleId}'`);
  } catch (err) {
    log.debug(`Error updating project file: ${err.message}`);
    log.warn(`Unable to update project file '${projectFilePath}' with ` +
             `bundle id '${newBundleId}'. WebDriverAgent may not start`);
  }
}
async function updateProjectFile ( agentPath , newBundleId ) { let projectFilePath = ` ${ agentPath } ${ PROJECT_FILE } ` ; try { // Assuming projectFilePath is in the correct state, create .old from projectFilePath await fs . copyFile ( projectFilePath , ` ${ projectFilePath } ` ) ; await replaceInFile ( projectFilePath , new RegExp ( WDA_RUNNER_BUNDLE_ID . replace ( '.' , '\.' ) , 'g' ) , newBundleId ) ; // eslint-disable-line no-useless-escape log . debug ( ` ${ projectFilePath } ${ newBundleId } ` ) ; } catch ( err ) { log . debug ( ` ${ err . message } ` ) ; log . warn ( ` ${ projectFilePath } ` + ` ${ newBundleId } ` ) ; } }
Update WebDriverAgentRunner project bundle ID with newBundleId.
This method assumes project file is in the correct state.
@param {string} agentPath - Path to the .xcodeproj directory.
@param {string} newBundleId the new bundle ID used to update.
Update WebDriverAgentRunner project bundle ID with newBundleId . This method assumes project file is in the correct state .