Invalid device state error when trying to emulate ios


#1

Hey all,

My current dev machine is drying out after having water spilled on it. So I cloned my project to my secondary machine and have gone through the process of getting Ionic CL tools installed, as well as updating npm, node, and Xcode. My project works when I do ionic serve, and ionic build ios works successfully, but when I try to emulate ios, I get an ‘Invalid device state’ error.

Here’s my project repo: https://github.com/stewartmccoy/phone-signup

Node version: v4.2.2
Npm version: 2.14.7
Ionic version: 1.7.8
Xcode version: Version 7.1.1 (7B1005)
Mac OS X Yosmite 10.10.5 (14F1021)

I have also used npm-install-missing to install missing dependencies.

I saw this post: Invalid Device State iOS-Simulator and accordingly deleted Xcode and did a fresh install, but that didn’t help.

Here’s the error message (see full terminal output below):

** BUILD SUCCEEDED **

No target specified for emulator. Deploying to iPhone-6 simulator
An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=159):
Invalid device state
An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=159):
Invalid device state
ENOENT: no such file or directory, stat '/Users/stewartmccoy/Library/Logs/CoreSimulator/D2FFF2E1-C3D2-4D1A-ABE2-242D3EAEDFC7/system.log'
Error code 1 for command: ios-sim with args: launch,/Users/stewartmccoy/Code/phone-signup/platforms/ios/build/emulator/phone-signup.app,--devicetypeid,com.apple.CoreSimulator.SimDeviceType.iPhone-6,--stderr,/Users/stewartmccoy/Code/phone-signup/platforms/ios/cordova/console.log,--stdout,/Users/stewartmccoy/Code/phone-signup/platforms/ios/cordova/console.log,--exit
Error: /Users/stewartmccoy/Code/phone-signup/platforms/ios/cordova/run: Command failed with exit code 2

Here’s the entire output of my terminal from running ionic emulate ios:

mac-3c15c2c609cc:phone-signup stewartmccoy$ sudo ionic emulate ios
Running command: /Users/stewartmccoy/Code/phone-signup/hooks/after_prepare/010_add_platform_class.js /Users/stewartmccoy/Code/phone-signup
add to body class: platform-ios
Running command: /Users/stewartmccoy/Code/phone-signup/platforms/ios/cordova/run --emulator
Building project  : /Users/stewartmccoy/Code/phone-signup/platforms/ios/phone-signup.xcodeproj
	Configuration : Debug
	Platform      : emulator
Build settings from command line:
    ARCHS = i386
    CONFIGURATION_BUILD_DIR = /Users/stewartmccoy/Code/phone-signup/platforms/ios/build/emulator
    SDKROOT = iphonesimulator9.1
    SHARED_PRECOMPS_DIR = /Users/stewartmccoy/Code/phone-signup/platforms/ios/build/sharedpch
    VALID_ARCHS = i386

Build settings from configuration file '/Users/stewartmccoy/Code/phone-signup/platforms/ios/cordova/build-debug.xcconfig':
    CODE_SIGN_IDENTITY = iPhone Developer
    ENABLE_BITCODE = NO

=== BUILD TARGET CordovaLib OF PROJECT CordovaLib WITH CONFIGURATION Debug ===

Check dependencies

=== BUILD TARGET phone-signup OF PROJECT phone-signup WITH CONFIGURATION Debug ===

Check dependencies

PhaseScriptExecution Copy\ www\ directory build/phone-signup.build/Debug-iphonesimulator/phone-signup.build/Script-304B58A110DAC018002A0835.sh
    cd /Users/stewartmccoy/Code/phone-signup/platforms/ios
    /bin/sh -c /Users/stewartmccoy/Code/phone-signup/platforms/ios/build/phone-signup.build/Debug-iphonesimulator/phone-signup.build/Script-304B58A110DAC018002A0835.sh

CpResource phone-signup/Resources/icons/icon-76.png build/emulator/phone-signup.app/icon-76.png
    cd /Users/stewartmccoy/Code/phone-signup/platforms/ios
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448@global/bin:/Users/stewartmccoy/.rvm/rubies/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/bin:/Users/stewartmccoy/.rvm/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/stewartmccoy/Code/phone-signup/platforms/ios/phone-signup/Resources/icons/icon-76.png /Users/stewartmccoy/Code/phone-signup/platforms/ios/build/emulator/phone-signup.app

CpResource phone-signup/Resources/icons/icon-40@2x.png build/emulator/phone-signup.app/icon-40@2x.png
    cd /Users/stewartmccoy/Code/phone-signup/platforms/ios
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448@global/bin:/Users/stewartmccoy/.rvm/rubies/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/bin:/Users/stewartmccoy/.rvm/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/stewartmccoy/Code/phone-signup/platforms/ios/phone-signup/Resources/icons/icon-40@2x.png /Users/stewartmccoy/Code/phone-signup/platforms/ios/build/emulator/phone-signup.app

CpResource phone-signup/Resources/icons/icon-72.png build/emulator/phone-signup.app/icon-72.png
    cd /Users/stewartmccoy/Code/phone-signup/platforms/ios
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448@global/bin:/Users/stewartmccoy/.rvm/rubies/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/bin:/Users/stewartmccoy/.rvm/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/stewartmccoy/Code/phone-signup/platforms/ios/phone-signup/Resources/icons/icon-72.png /Users/stewartmccoy/Code/phone-signup/platforms/ios/build/emulator/phone-signup.app

CpResource phone-signup/Resources/splash/Default-736h.png build/emulator/phone-signup.app/Default-736h.png
    cd /Users/stewartmccoy/Code/phone-signup/platforms/ios
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448@global/bin:/Users/stewartmccoy/.rvm/rubies/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/bin:/Users/stewartmccoy/.rvm/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/stewartmccoy/Code/phone-signup/platforms/ios/phone-signup/Resources/splash/Default-736h.png /Users/stewartmccoy/Code/phone-signup/platforms/ios/build/emulator/phone-signup.app

CpResource phone-signup/Resources/icons/icon@2x.png build/emulator/phone-signup.app/icon@2x.png
    cd /Users/stewartmccoy/Code/phone-signup/platforms/ios
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448@global/bin:/Users/stewartmccoy/.rvm/rubies/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/bin:/Users/stewartmccoy/.rvm/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/stewartmccoy/Code/phone-signup/platforms/ios/phone-signup/Resources/icons/icon@2x.png /Users/stewartmccoy/Code/phone-signup/platforms/ios/build/emulator/phone-signup.app

CpResource phone-signup/Resources/icons/icon.png build/emulator/phone-signup.app/icon.png
    cd /Users/stewartmccoy/Code/phone-signup/platforms/ios
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448@global/bin:/Users/stewartmccoy/.rvm/rubies/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/bin:/Users/stewartmccoy/.rvm/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/stewartmccoy/Code/phone-signup/platforms/ios/phone-signup/Resources/icons/icon.png /Users/stewartmccoy/Code/phone-signup/platforms/ios/build/emulator/phone-signup.app

CpResource phone-signup/Resources/icons/icon-50.png build/emulator/phone-signup.app/icon-50.png
    cd /Users/stewartmccoy/Code/phone-signup/platforms/ios
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448@global/bin:/Users/stewartmccoy/.rvm/rubies/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/bin:/Users/stewartmccoy/.rvm/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/stewartmccoy/Code/phone-signup/platforms/ios/phone-signup/Resources/icons/icon-50.png /Users/stewartmccoy/Code/phone-signup/platforms/ios/build/emulator/phone-signup.app

CpResource phone-signup/Resources/icons/icon-60@2x.png build/emulator/phone-signup.app/icon-60@2x.png
    cd /Users/stewartmccoy/Code/phone-signup/platforms/ios
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448@global/bin:/Users/stewartmccoy/.rvm/rubies/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/bin:/Users/stewartmccoy/.rvm/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/stewartmccoy/Code/phone-signup/platforms/ios/phone-signup/Resources/icons/icon-60@2x.png /Users/stewartmccoy/Code/phone-signup/platforms/ios/build/emulator/phone-signup.app

CpResource phone-signup/Resources/splash/Default-Landscape@2x~ipad.png build/emulator/phone-signup.app/Default-Landscape@2x~ipad.png
    cd /Users/stewartmccoy/Code/phone-signup/platforms/ios
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448@global/bin:/Users/stewartmccoy/.rvm/rubies/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/bin:/Users/stewartmccoy/.rvm/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/stewartmccoy/Code/phone-signup/platforms/ios/phone-signup/Resources/splash/Default-Landscape@2x~ipad.png /Users/stewartmccoy/Code/phone-signup/platforms/ios/build/emulator/phone-signup.app

CpResource phone-signup/Resources/splash/Default-Landscape~ipad.png build/emulator/phone-signup.app/Default-Landscape~ipad.png
    cd /Users/stewartmccoy/Code/phone-signup/platforms/ios
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448@global/bin:/Users/stewartmccoy/.rvm/rubies/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/bin:/Users/stewartmccoy/.rvm/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/stewartmccoy/Code/phone-signup/platforms/ios/phone-signup/Resources/splash/Default-Landscape~ipad.png /Users/stewartmccoy/Code/phone-signup/platforms/ios/build/emulator/phone-signup.app

CpResource phone-signup/Resources/icons/icon-small.png build/emulator/phone-signup.app/icon-small.png
    cd /Users/stewartmccoy/Code/phone-signup/platforms/ios
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448@global/bin:/Users/stewartmccoy/.rvm/rubies/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/bin:/Users/stewartmccoy/.rvm/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/stewartmccoy/Code/phone-signup/platforms/ios/phone-signup/Resources/icons/icon-small.png /Users/stewartmccoy/Code/phone-signup/platforms/ios/build/emulator/phone-signup.app

CpResource phone-signup/Resources/splash/Default-Portrait@2x~ipad.png build/emulator/phone-signup.app/Default-Portrait@2x~ipad.png
    cd /Users/stewartmccoy/Code/phone-signup/platforms/ios
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448@global/bin:/Users/stewartmccoy/.rvm/rubies/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/bin:/Users/stewartmccoy/.rvm/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/stewartmccoy/Code/phone-signup/platforms/ios/phone-signup/Resources/splash/Default-Portrait@2x~ipad.png /Users/stewartmccoy/Code/phone-signup/platforms/ios/build/emulator/phone-signup.app

CpResource phone-signup/Resources/splash/Default-667h.png build/emulator/phone-signup.app/Default-667h.png
    cd /Users/stewartmccoy/Code/phone-signup/platforms/ios
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448@global/bin:/Users/stewartmccoy/.rvm/rubies/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/bin:/Users/stewartmccoy/.rvm/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/stewartmccoy/Code/phone-signup/platforms/ios/phone-signup/Resources/splash/Default-667h.png /Users/stewartmccoy/Code/phone-signup/platforms/ios/build/emulator/phone-signup.app

CpResource phone-signup/Resources/icons/icon-small@2x.png build/emulator/phone-signup.app/icon-small@2x.png
    cd /Users/stewartmccoy/Code/phone-signup/platforms/ios
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448@global/bin:/Users/stewartmccoy/.rvm/rubies/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/bin:/Users/stewartmccoy/.rvm/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/stewartmccoy/Code/phone-signup/platforms/ios/phone-signup/Resources/icons/icon-small@2x.png /Users/stewartmccoy/Code/phone-signup/platforms/ios/build/emulator/phone-signup.app

CpResource phone-signup/Resources/splash/Default-Portrait~ipad.png build/emulator/phone-signup.app/Default-Portrait~ipad.png
    cd /Users/stewartmccoy/Code/phone-signup/platforms/ios
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448@global/bin:/Users/stewartmccoy/.rvm/rubies/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/bin:/Users/stewartmccoy/.rvm/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/stewartmccoy/Code/phone-signup/platforms/ios/phone-signup/Resources/splash/Default-Portrait~ipad.png /Users/stewartmccoy/Code/phone-signup/platforms/ios/build/emulator/phone-signup.app

CpResource phone-signup/Resources/icons/icon-40.png build/emulator/phone-signup.app/icon-40.png
    cd /Users/stewartmccoy/Code/phone-signup/platforms/ios
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448@global/bin:/Users/stewartmccoy/.rvm/rubies/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/bin:/Users/stewartmccoy/.rvm/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/stewartmccoy/Code/phone-signup/platforms/ios/phone-signup/Resources/icons/icon-40.png /Users/stewartmccoy/Code/phone-signup/platforms/ios/build/emulator/phone-signup.app

CpResource phone-signup/Resources/splash/Default@2x~iphone.png build/emulator/phone-signup.app/Default@2x~iphone.png
    cd /Users/stewartmccoy/Code/phone-signup/platforms/ios
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448@global/bin:/Users/stewartmccoy/.rvm/rubies/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/bin:/Users/stewartmccoy/.rvm/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/stewartmccoy/Code/phone-signup/platforms/ios/phone-signup/Resources/splash/Default@2x~iphone.png /Users/stewartmccoy/Code/phone-signup/platforms/ios/build/emulator/phone-signup.app

CpResource phone-signup/Resources/icons/icon-60.png build/emulator/phone-signup.app/icon-60.png
    cd /Users/stewartmccoy/Code/phone-signup/platforms/ios
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448@global/bin:/Users/stewartmccoy/.rvm/rubies/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/bin:/Users/stewartmccoy/.rvm/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/stewartmccoy/Code/phone-signup/platforms/ios/phone-signup/Resources/icons/icon-60.png /Users/stewartmccoy/Code/phone-signup/platforms/ios/build/emulator/phone-signup.app

CpResource phone-signup/Resources/splash/Default~iphone.png build/emulator/phone-signup.app/Default~iphone.png
    cd /Users/stewartmccoy/Code/phone-signup/platforms/ios
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448@global/bin:/Users/stewartmccoy/.rvm/rubies/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/bin:/Users/stewartmccoy/.rvm/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/stewartmccoy/Code/phone-signup/platforms/ios/phone-signup/Resources/splash/Default~iphone.png /Users/stewartmccoy/Code/phone-signup/platforms/ios/build/emulator/phone-signup.app

CpResource phone-signup/Resources/splash/Default-568h@2x~iphone.png build/emulator/phone-signup.app/Default-568h@2x~iphone.png
    cd /Users/stewartmccoy/Code/phone-signup/platforms/ios
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448@global/bin:/Users/stewartmccoy/.rvm/rubies/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/bin:/Users/stewartmccoy/.rvm/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/stewartmccoy/Code/phone-signup/platforms/ios/phone-signup/Resources/splash/Default-568h@2x~iphone.png /Users/stewartmccoy/Code/phone-signup/platforms/ios/build/emulator/phone-signup.app

CpResource phone-signup/Resources/splash/Default-Landscape-736h.png build/emulator/phone-signup.app/Default-Landscape-736h.png
    cd /Users/stewartmccoy/Code/phone-signup/platforms/ios
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448@global/bin:/Users/stewartmccoy/.rvm/rubies/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/bin:/Users/stewartmccoy/.rvm/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/stewartmccoy/Code/phone-signup/platforms/ios/phone-signup/Resources/splash/Default-Landscape-736h.png /Users/stewartmccoy/Code/phone-signup/platforms/ios/build/emulator/phone-signup.app

CpResource phone-signup/Resources/icons/icon-50@2x.png build/emulator/phone-signup.app/icon-50@2x.png
    cd /Users/stewartmccoy/Code/phone-signup/platforms/ios
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448@global/bin:/Users/stewartmccoy/.rvm/rubies/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/bin:/Users/stewartmccoy/.rvm/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/stewartmccoy/Code/phone-signup/platforms/ios/phone-signup/Resources/icons/icon-50@2x.png /Users/stewartmccoy/Code/phone-signup/platforms/ios/build/emulator/phone-signup.app

CpResource phone-signup/Resources/icons/icon-60@3x.png build/emulator/phone-signup.app/icon-60@3x.png
    cd /Users/stewartmccoy/Code/phone-signup/platforms/ios
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448@global/bin:/Users/stewartmccoy/.rvm/rubies/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/bin:/Users/stewartmccoy/.rvm/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/stewartmccoy/Code/phone-signup/platforms/ios/phone-signup/Resources/icons/icon-60@3x.png /Users/stewartmccoy/Code/phone-signup/platforms/ios/build/emulator/phone-signup.app

CpResource phone-signup/Resources/icons/icon-76@2x.png build/emulator/phone-signup.app/icon-76@2x.png
    cd /Users/stewartmccoy/Code/phone-signup/platforms/ios
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448@global/bin:/Users/stewartmccoy/.rvm/rubies/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/bin:/Users/stewartmccoy/.rvm/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/stewartmccoy/Code/phone-signup/platforms/ios/phone-signup/Resources/icons/icon-76@2x.png /Users/stewartmccoy/Code/phone-signup/platforms/ios/build/emulator/phone-signup.app

CpResource phone-signup/Resources/icons/icon-72@2x.png build/emulator/phone-signup.app/icon-72@2x.png
    cd /Users/stewartmccoy/Code/phone-signup/platforms/ios
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448@global/bin:/Users/stewartmccoy/.rvm/rubies/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/bin:/Users/stewartmccoy/.rvm/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/stewartmccoy/Code/phone-signup/platforms/ios/phone-signup/Resources/icons/icon-72@2x.png /Users/stewartmccoy/Code/phone-signup/platforms/ios/build/emulator/phone-signup.app

ProcessInfoPlistFile build/emulator/phone-signup.app/Info.plist phone-signup/phone-signup-Info.plist
    cd /Users/stewartmccoy/Code/phone-signup/platforms/ios
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448@global/bin:/Users/stewartmccoy/.rvm/rubies/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/bin:/Users/stewartmccoy/.rvm/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    builtin-infoPlistUtility /Users/stewartmccoy/Code/phone-signup/platforms/ios/phone-signup/phone-signup-Info.plist -genpkginfo /Users/stewartmccoy/Code/phone-signup/platforms/ios/build/emulator/phone-signup.app/PkgInfo -expandbuildsettings -format binary -platform iphonesimulator -additionalcontentfile /Users/stewartmccoy/Code/phone-signup/platforms/ios/build/phone-signup.build/Debug-iphonesimulator/phone-signup.build/MainViewController-PartialInfo.plist -o /Users/stewartmccoy/Code/phone-signup/platforms/ios/build/emulator/phone-signup.app/Info.plist

GenerateDSYMFile build/emulator/phone-signup.app.dSYM build/emulator/phone-signup.app/phone-signup
    cd /Users/stewartmccoy/Code/phone-signup/platforms/ios
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448@global/bin:/Users/stewartmccoy/.rvm/rubies/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/bin:/Users/stewartmccoy/.rvm/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil /Users/stewartmccoy/Code/phone-signup/platforms/ios/build/emulator/phone-signup.app/phone-signup -o /Users/stewartmccoy/Code/phone-signup/platforms/ios/build/emulator/phone-signup.app.dSYM

Touch build/emulator/phone-signup.app
    cd /Users/stewartmccoy/Code/phone-signup/platforms/ios
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p448@global/bin:/Users/stewartmccoy/.rvm/rubies/ruby-1.9.3-p448/bin:/Users/stewartmccoy/.rvm/bin:/Users/stewartmccoy/.rvm/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /usr/bin/touch -c /Users/stewartmccoy/Code/phone-signup/platforms/ios/build/emulator/phone-signup.app

** BUILD SUCCEEDED **

No target specified for emulator. Deploying to iPhone-6 simulator
An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=159):
Invalid device state
An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=159):
Invalid device state
ENOENT: no such file or directory, stat '/Users/stewartmccoy/Library/Logs/CoreSimulator/D2FFF2E1-C3D2-4D1A-ABE2-242D3EAEDFC7/system.log'
Error code 1 for command: ios-sim with args: launch,/Users/stewartmccoy/Code/phone-signup/platforms/ios/build/emulator/phone-signup.app,--devicetypeid,com.apple.CoreSimulator.SimDeviceType.iPhone-6,--stderr,/Users/stewartmccoy/Code/phone-signup/platforms/ios/cordova/console.log,--stdout,/Users/stewartmccoy/Code/phone-signup/platforms/ios/cordova/console.log,--exit
Error: /Users/stewartmccoy/Code/phone-signup/platforms/ios/cordova/run: Command failed with exit code 2

Command failed with exit code 2 You may not have the required environment or OS to run this project
#2

The problem was that I created my Ionic project using sudo and it was throwing a permission error.

I just did the 2 following commands to give my user access to the projects:

sudo chown -R stewartmccoy ~/Code/phone-signup/
sudo chown -R stewartmccoy ~/.config

#3

I had the same problem and wrote a blog post about how to fix it: http://zacvineyard.com/blog/2015/11/ionic-invalid-device-state-error-with-xcode-7-solved. Really it came down to me misusing the sudo command in the terminal.


#4

Didn’t work for me just at .config/ folder level, had to add it to user root folder.

sudo chown -R username /Users/<username>

#5

thanks, this worked for me :slight_smile:


#6

In my case, my computer was slow to open the emulator, so ionic was unable to use. Once I waited to emulator come up in couple minutes and run another ionic emulate, it worked.