title: CFBundleIdentifier does not exist on react-native
body: <p>Easy bounty here for grabs. Does not necessarily require any react-native experience. Problem seems to be in open source code, which is available out there:</p>
  <p>Updated xcode, and now when I try to run my react-native app by issuing following command: <code>react-native run-ios</code> I get an error:</p>
  <blockquote>
  <p>An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
  Failed to install the requested application
  An application bundle was not found at the provided path.
  Provide a valid path to the desired application bundle.
  Print: Entry, &quot;:CFBundleIdentifier&quot;, Does Not Exist
  error Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier DerivedData/Build/Products/Debug-iphonesimulator/MyAppName.app/Info.plist
  Print: Entry, &quot;:CFBundleIdentifier&quot;, Does Not Exist</p>
  </blockquote>
  <blockquote>
  <p>debug Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier DerivedData/Build/Products/Debug-iphonesimulator/MyAppName.app/Info.plist
  Print: Entry, &quot;:CFBundleIdentifier&quot;, Does Not Exist
  at checkExecSyncError (child_process.js:616:11)
  at Object.execFileSync (child_process.js:634:13)
  at runOnSimulator (project-root-dir/node_modules/@react-native-community/cli/build/commands/runIOS/runIOS.js:181:45)</p>
  </blockquote>
  <p>Before those errors, the command prints out info about successful build, and that it is about to install the build:</p>
  <blockquote>
  <p>info ** BUILD SUCCEEDED **</p>
  </blockquote>
  <blockquote>
  <p>info Installing DerivedData/Build/Products/Debug-iphonesimulator/MyAppName.app</p>
  </blockquote>
  <p>So it seems the build is ok, but when it tries to install the app it fails?</p>
  <p>Think I've tried &quot;everything&quot; I found from other questions with this similar error message, but nothing has worked for me.</p>
  <p>Some specs:</p>
  <p>react-native: 0.59.10 <br>
  react: 16.8.3 <br>
  xcode-version: Version 12.2 (12B45b)</p>
  <p>I know there are similar questions on stackoverflow. But since none of the solutions provided there worked for me, and I wish to get it fixed, I made this separate question.</p>
  <p>I do not know where the Info.plist file is that it tries to find: <em>DerivedData/Build/Products/Debug-iphonesimulator/MyAppName.app/Info.plist</em></p>
  <p>Inside my ios folder, there is a folder called DerivedData, but inside that there are no folder with a name <em>Build</em>. So I think it might be looking from a wrong location?</p>
  <p>UPDATE:</p>
  <p>I've been able to pinpoint where the cli launch goes wrong:
  <a href="https://github.com/react-native-community/cli/blob/ba298d9c47af522f0377325bebc6c2075d41790a/packages/platform-ios/src/commands/runIOS/index.ts#L378" rel="nofollow noreferrer">https://github.com/react-native-community/cli/blob/ba298d9c47af522f0377325bebc6c2075d41790a/packages/platform-ios/src/commands/runIOS/index.ts#L378</a></p>
  <p>If I change that line <code>let buildPath = build/${scheme}/Build/Products/${configuration}-${device}/${appName}.app</code></p>
  <p>to -&gt; <code>build/${scheme}/Build/Products/${configuration}-${device}/MyAppRealName.app</code>;</p>
  <p>Then the dev launch works nicely, there's no problem. So it seems that getting the appName goes wrong. The appName is resolved here: <a href="https://github.com/react-native-community/cli/blob/ba298d9c47af522f0377325bebc6c2075d41790a/packages/platform-ios/src/commands/runIOS/index.ts#L387" rel="nofollow noreferrer">https://github.com/react-native-community/cli/blob/ba298d9c47af522f0377325bebc6c2075d41790a/packages/platform-ios/src/commands/runIOS/index.ts#L387</a></p>
  <p><code>const productNameMatch = /export FULL_PRODUCT_NAME=&quot;?(.+).app&quot;?$/m.exec(buildOutput);</code></p>
  <p>I could do a post install npm script that just sets the name of the app correct and call it a day. But that's pretty hacky way. I wonder if there's an alternative that works better? I see that the runIOS file has been updated from the version that I have quite much, but the function getProductName still remains the same. So Im not sure if updating just the cli would work, or if it would even be possible, because it might require a newer react-native version, which is not an option for me right now.</p>