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

simctl.extensions.start fails to start new simulator if simulator with different deviceId is already running #9

Closed
mattjoss opened this issue Mar 9, 2016 · 6 comments
Labels

Comments

@mattjoss
Copy link

mattjoss commented Mar 9, 2016

  1. Call simctl.extensions.start(deviceId1)
  2. Leave simulator running and call simctl.extensions.start(deviceId2)

Simulator does not switch to deviceId2.

When trying to call simctl.install() after second start, the following error is returned...

An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=159):
Invalid device state

The bug occurs in 0.0.8, but works correctly in 0.0.6

This can be seen with the attached node.js app.
simctl-test.zip

// To test, get list of deviceIds from 'xcrun simctl list' and then run the following command twice with diffeent device ids
//node ./index.js {PATH_TO_APP} {DEVICE_ID}
// e.g.
//node ./index.js ~/HelloWorld.app EAA544F1-D533-4168-9F4A-790AFE764DDA
//node ./index.js ~/HelloWorld.app 3F6912C6-1392-40B7-95CC-41A69EC07BCD
@shazron shazron added the bug label Mar 17, 2016
@shazron shazron added this to the 0.0.9 milestone Mar 17, 2016
mattjoss added a commit to mattjoss/ios-sim that referenced this issue Mar 18, 2016
@shazron
Copy link
Contributor

shazron commented Mar 18, 2016

Just checking, is Xcode 7 (Xcode.app) the only Xcode installed in your system?
Probably related to #10

@mattjoss
Copy link
Author

Yes, only Xcode 7 installed.

@shazron
Copy link
Contributor

shazron commented Mar 19, 2016

Confirmed. Investigating a fix.

@shazron
Copy link
Contributor

shazron commented Mar 19, 2016

Reverting back to using Instruments fixes this: 704b0f8

@shazron
Copy link
Contributor

shazron commented Mar 19, 2016

The iOS Simulator really doesn't like to have more than one instance "open"ed, which is probably causing the "Invalid Device State". Instruments intelligently shuts down the previous instance and launches the new one.

@shazron
Copy link
Contributor

shazron commented Mar 19, 2016

Fixed in 34426c7

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

No branches or pull requests

3 participants
@shazron @mattjoss and others