Solved: Ionic ENOENT Invalid device state error when using sudo on Mac
I was trying to launch a sample app on the newly released Ionic 2 Release Canditate. When I ran the command sudo ionic run ios --emulator, I encountered an error similar to this one which I shorted for display here:
After searching the internet for solutions, I was able to overcome the error by taking the following steps:An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=163):Invalid device stateError: ENOENT: no such file or directory, stat '/Users/.../Library/Logs/CoreSimulator/.../system.log'
- Install the latest update to Xcode.
- Run xcode-select --install to make sure that Xcode command line tools is installed (as recommended by Mike Hartington on the Ionic Github page.)
- Run sudo chown -R username /Users/username to update my permissions which makes it so that I don't have to run sudo when running ionic commands (as recommended by Zac Vineyard on his blog.)
- Run ionic run ios --emulator (this time without using sudo).
Thank you for the help guys!