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

After fresh install, react-native run-ios fails with Command failed: xcrun instruments -s #1309

Closed
ThomasGHenry opened this issue Aug 23, 2018 · 5 comments

Comments

@ThomasGHenry
Copy link

ThomasGHenry commented Aug 23, 2018


What's going on?

react-native run-ios fails with "Command failed: xcrun instruments -s" on clean install of Andross (max, or custom). react-native run-ios works for a fresh CRNA install. run-android works for ignite.

First, in Terminal 1...

$ npm start

> [email protected] start /Users/thomasghenry/ignite_do_over/PTM_App
> node node_modules/react-native/local-cli/cli.js start

Scanning folders for symlinks in /Users/thomasghenry/ignite_do_over/PTM_App/node_modules (29ms)
┌──────────────────────────────────────────────────────────────────────────────┐
│                                                                              │
│  Running Metro Bundler on port 8081.                                         │
│                                                                              │
│  Keep Metro running while developing on any JS projects. Feel free to        │
│  close this tab and run your own Metro instance if you prefer.               │
│                                                                              │
│  https://github.com/facebook/react-native                                    │
│                                                                              │
└──────────────────────────────────────────────────────────────────────────────┘

Looking for JS files in
   /Users/thomasghenry/ignite_do_over/PTM_App 


Metro Bundler ready.

Loading dependency graph, done.

Then in Terminal 2...

$ react-native run-ios
Scanning folders for symlinks in /Users/thomasghenry/ignite_do_over/PTM_App/node_modules (17ms)
Found Xcode project PTM_App.xcodeproj

Command failed: xcrun instruments -s

Steps to reproduce

install node from here: https://nodejs.org/en/download/
then....

brew install watchman
brew install yarn --without-node
npm install -g ignite-cli
npm i -g react-native-cli
ignite new PTM_App      # take defaults, same results with --max, or a mix
cd PTM_App/
npm start

react-native run-ios


ignite doctor results:

$ ignite doctor
System
  platform           darwin                                                                                            
  arch               x64                                                                                               
  cpu                8 cores                                      Intel(R) Core(TM) i7-3740QM CPU @ 2.70GHz  
  directory          /Users/thomasghenry/ignite_do_over/PTM_App                                                        

JavaScript
  node               8.11.4       /usr/local/bin/node  
  npm                5.6.0        /usr/local/bin/npm   
  yarn               1.9.4        /usr/local/bin/yarn  

React Native
  react-native-cli   2.0.1       
  app rn version     0.55.4      

Ignite
  ignite             2.1.1        /usr/local/bin/ignite  

Android
  java               1.8.0_181    /usr/bin/java                            
  android home       -            /Users/thomasghenry/Library/Android/sdk  

iOS
  xcode              9.4.1     


Things that haven't helped:
npm install [email protected] (to match working CRNA install, no difference)

npm i -g [email protected] (to match level mentioned in the doc) gets me this....

$ react-native run-ios
Scanning folders for symlinks in /Users/thomasghenry/ignite_do_over/PTM_App/node_modules (25ms)
Found Xcode project PTM_App.xcodeproj
Launching iPhone 6 (iOS 11.4)...
Building using "xcodebuild -project PTM_App.xcodeproj -configuration Debug -scheme PTM_App -destination id=8F3BDDE4-43AF-4806-A9E3-0755F6705BD8 -derivedDataPath build"
User defaults from command line:

    IDEDerivedDataPathOverride = /Users/thomasghenry/ignite_do_over/PTM_App/ios/build


Installing build/Build/Products/Debug-iphonesimulator/PTM_App.app
An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=164):
Unable to lookup in current state: Shutdown
Print: Entry, ":CFBundleIdentifier", Does Not Exist

Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/PTM_App.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

Similar deal with the simulator already up at the level above (iPhone 6 iOS 11.4)

$ react-native run-ios
Scanning folders for symlinks in /Users/thomasghenry/ignite_do_over/PTM_App/node_modules (78ms)
Found Xcode project PTM_App.xcodeproj
Building using "xcodebuild -project PTM_App.xcodeproj -configuration Debug -scheme PTM_App -destination id=8F3BDDE4-43AF-4806-A9E3-0755F6705BD8 -derivedDataPath build"
Installing build/Build/Products/Debug-iphonesimulator/PTM_App.app
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, ":CFBundleIdentifier", Does Not Exist

Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/PTM_App.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

... which looks like this facebook/react-native#14423, but none of what I tried from that discussion (not exhaustive, just exhausted) hasn't worked. It's somewhat beside the point since I'd rather not be so far back-level anyway (Yarn complains, etc...).

Thanks!

@ThomasGHenry
Copy link
Author

🏏

@heberuriegas
Copy link

Facing the same issue

@ThomasGHenry
Copy link
Author

@woohoou, It's super sleazy and I'm not jazzed about it, but I got a little farther by running react-native run-ios as root.... sudo react-native run-ios. I don't know why that's necessary, and it's probably a bad idea (generated files will be owned by root and could cause other stuff to choke down the line, which is probably how we got here in the first place), but if you're stuck and feeling adventurous, it might move you a bit forward.

Since the script was complaining about xcrun instruments -s, I tried that directly and it was seg faulting (code 11, rc 139; limited/no info in my google results). Running xcrun with sudo works though (no seg fault, verbose output, rc 0). I ended up getting hella jammed up chmoding and chowning the wrong things in an attempt to understand why xcrun needed sudo.

Just curious... do you use Bitdefender? I'm beginning to wonder whether the file system protections from that nightmare program are causing weirdness, but that's very speculative at this point, and Bitdefender is "impossible" to uninstall, so I'm content to run with sudo for now until I get time to dig into that.

Another thing I noticed is that running xcrun --verbose spits out some environment variables that are different when running with/without sudo, in particular the paths to xcrun_db. I thought maybe the xcrun_db used by the non-root user might be corrupted or something, and ran without sudo after setting it export xcrun_db=/path/to/working/xcrun_db, but the result was the same. I didn't try it the other way, as root with the non-root xcrun_db. I don't know what that is, where it's from or what it's for. I'm guessing it's something to do with storing info about ios simulators and devices. Googling was no help. Apple forums were no help. The man page for xcrun wasn't super helpful (or xcrun help or whatever). Next would be to try swizzling the permission on it and the dirs on the path to it, or even deleting/renaming it to see if a new working one gets generated, but since sudo react-native run-ios inched me forward, my enthusiasm for solving this immediately waned.

Good luck and please follow up if you try things I haven't, or resolve it. Thanks

@ThomasGHenry
Copy link
Author

Oh! After sudo react-native run-ios, open xcode manually to launch the simulator from there.
open /Applications/Xcode.app /path/to/your/ignite_app/ios/ignite_app.xcodeproj

In xcode open the Product menu and select Run (or Cmd-R).

@heberuriegas
Copy link

Thanks @ThomasGHenry I just fix the problems with the first answer here https://stackoverflow.com/questions/37461703/print-entry-cfbundleidentifier-does-not-exist.

Hope it help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants