title: Error: Cannot read property 'replace' of undefined when building iOS Cordova
body: <p>I created a cordova project using <code>cordova create project hello com.hello Hello</code>.</p>
  
  <p>And added iOS platform using <code>cordova platform add iOS</code>.
  And tried to do <code>cordova run ios</code> after <code>cordova build ios</code>.</p>
  
  <p>But it shows me this error(I used --d/ --verbose to get the details).</p>
  
  <blockquote>
    <p>/usr/bin/codesign --force --sign - --timestamp=none
    /Volumes/Untitled/Plot/PlotReel/platforms/ios/build/emulator/PlotReel.app
    /Volumes/Untitled/Plot/PlotReel/platforms/ios/build/emulator/PlotReel.app:
    replacing existing signature</p>
    
    <p>** BUILD SUCCEEDED **</p>
    
    <p>No scripts found for hook "before_deploy". Error: TypeError: Cannot
    read property 'replace' of undefined </p>
  
  <pre><code>at remove (/Volumes/Untitled/Plot/test/platforms/ios/cordova/node_modules/ios-sim/src/lib.js:282:70)
  at Array.forEach (native)
  at Object.getdevicetypes (/Volumes/Untitled/Plot/test/platforms/ios/cordova/node_modules/ios-sim/src/lib.js:292:22)
  at Object.listEmulatorImages [as run] (/Volumes/Untitled/Plot/test/platforms/ios/cordova/lib/list-emulator-images:34:29)
  at deployToSim (/Volumes/Untitled/Plot/test/platforms/ios/cordova/lib/run.js:146:50)
  at /Volumes/Untitled/Plot/test/platforms/ios/cordova/lib/run.js:88:20
  at _fulfilled (/Volumes/Untitled/Plot/test/platforms/ios/cordova/node_modules/q/q.js:834:54)
  at self.promiseDispatch.done (/Volumes/Untitled/Plot/test/platforms/ios/cordova/node_modules/q/q.js:863:30)
  at Promise.promise.promiseDispatch (/Volumes/Untitled/Plot/test/platforms/ios/cordova/node_modules/q/q.js:796:13)
  at /Volumes/Untitled/Plot/test/platforms/ios/cordova/node_modules/q/q.js:604:44
  </code></pre>
  </blockquote>
  
  <p>I have tried uninstalling and installing cordova again, but the problem is still remaining.</p>
  
  <p>Please help me.</p>