<commit_before>const path = require('path')
const chalk = require('chalk')
const child_process = require('child_process')
const inquirer = require('inquirer')
const fs = require('fs')
const utils = require('../utils')
const startJSServer = require('./server')
const {Config,iOSConfigResolver} = require('../utils/config')
/**
 * Run iOS app
 * @param {Object} options
 */
function runIOS(options) {
  utils.checkAndInstallForIosDeploy()
    .then(utils.buildJS)
    .then(()=>{
      return utils.exec('rsync  -r -q ./dist/* platforms/ios/bundlejs/')
    })
    .then(()=> {
      startJSServer()
      return {options}
    }).then(prepareIOS)
     .then(installDep)
    .then(findIOSDevice)
    .then(chooseDevice)
    .then(buildApp)
    .then(runApp)
    .catch((err) => {
      if (err) {
        try {
          console.log(err.stderr)
          console.log(err.output.join('\n'))
        }catch(e){
          console.log(e);
        }
      }
    })
}

/**<commit_msg>fix run ios log error<commit_after>const path = require('path')
const chalk = require('chalk')
const child_process = require('child_process')
const inquirer = require('inquirer')
const fs = require('fs')
const utils = require('../utils')
const startJSServer = require('./server')
const {Config,iOSConfigResolver} = require('../utils/config')
/**
 * Run iOS app
 * @param {Object} options
 */
function runIOS(options) {
  utils.checkAndInstallForIosDeploy()
    .then(utils.buildJS)
    .then(()=>{
      return utils.exec('rsync  -r -q ./dist/* platforms/ios/bundlejs/')
    })
    .then(()=> {
      startJSServer()
      return {options}
    }).then(prepareIOS)
     .then(installDep)
    .then(findIOSDevice)
    .then(chooseDevice)
    .then(buildApp)
    .then(runApp)
    .catch((err) => {
      if (err) {
        try {
          if(err.stderr){
            console.log(err.stderr)
          }
          else{
            console.log(err);
          }
          if(err.output)console.log(err.output.join('\n'))
        }catch(e){
          console.log(e);
        }
      }
    })
}

/**
{'fraction_non_alphanumeric': 0.17117988394584138, 'fraction_numerical': 0.0, 'mean_word_length': 2.500846023688663, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1250109', 'n_tokens_mistral': 690, 'n_tokens_neox': 683, 'n_words': 125}