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

local-cli/runIOS/runIOS.js uses incorrect values when building / installing iOS App #7806

Closed
chiavennasca opened this issue May 27, 2016 · 2 comments
Labels
Platform: iOS iOS applications. Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@chiavennasca
Copy link

Environment

  • Mac OS X 10.11.4
  • React Native 0.26.2
  • XCode 7.3 (7D175)

Issue

local-cli/runIOS/runIOS.js will error out with the following messages if the final build location of the app is not build/Build/Products/Debug-iphonesimulator/${inferredSchemeName}.app.

Installing the new app version on the running simulator fails

Line 96 (child_process.spawnSync('xcrun', ['simctl', 'install', 'booted', appPath], {stdio: 'inherit'});) results in the following:
Installing build/Build/Products/Debug-iphonesimulator/[IMPLICIT_SCHEME_NAME].app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application

Printing the CFBundleIndentifier fails because the path to the Plist is incorrect

Line 105 (child_process.spawnSync('xcrun', ['simctl', 'launch', 'booted', bundleID], {stdio: 'inherit'});) results in the following:
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/[IMPLICIT_SCHEME_NAME].app/Info.plist

Repro

  1. react-native init MyApp
  2. (Optional) Open MyApp.xcproj in Xcode and modify MyApp -> Build Settings -> Packaging -> Product Name to something else like My App.
  3. react-native run-ios

Root Causes & Possible Solutions

Modifying [APPLICATION_TARGET] -> Build Settings -> Packaging -> Product Name so it does not match inferredSchemeName

Get value of EXECUTABLE_NAME from xcodebuild with identical settings and -showBuildSettings flag and use that instead of implicitSchemeName in the appPath.

xcodebuild builds in Release by default for Xcode projects

Pass in -configuration Debug to xcodebuild when building

Related Issues

Perhaps this is what's causing #7786 and #7308?

@charpeni
Copy link
Contributor

@facebook-github-bot label iOS

@ghost ghost added Platform: iOS iOS applications. Ran Commands One of our bots successfully processed a command. labels May 29, 2016
@mkonicek
Copy link
Contributor

Hi there! This issue is being closed because it has been inactive for a while.

But don't worry, it will live on with ProductPains! Check out its new home: https://productpains.com/post/react-native/local-cliruniosruniosjs-uses-incorrect-values-when-building-installing-ios-app

Product Pains has been very useful in highlighting the top bugs and feature requests:
https://productpains.com/product/react-native?tab=top

Also, if this issue is a bug, please consider sending a pull request with a fix.

@facebook facebook locked as resolved and limited conversation to collaborators Jul 19, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: iOS iOS applications. Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants