Failure to stop executing task in Xcode 4.3

2019-03-14 09:57发布

I just installed Xcode 4.3 and I'm having some issues with stopping my app while running in the iOS simulator. I'm able to quit the simulator, but I cannot stop the task from running, either by hitting the stop button, or using the keybinding. In order to stop the process, I literally have to quit Xcode and restart. This obviously makes any development at all very difficult. I found this bugreport: link, which sounds very similar to the issue I'm seeing.

Is this a known issue with 4.3, or has anyone else experienced this behavior? I haven't used Xcode for over a year now (v3), so I can't say if it was working with any other previous versions of Xcode 4.

5条回答
闹够了就滚
2楼-- · 2019-03-14 09:59

Found this post helpful XCode 4.3.2, issue with running on simulator

Strangely when it hangs, click on the simulator icon in the tray. Dont ask me why. This actually works

查看更多
Animai°情兽
3楼-- · 2019-03-14 10:04

I've noticed this a lot since updating. The cure seems to be to just try to remember to stop the application from within Xcode while the simulator is still running the app. It seems like when you kill the simulator out from under Xcode your simulator process hangs and doesn't pass the termination message on to Xcode like it is supposed to.

查看更多
神经病院院长
4楼-- · 2019-03-14 10:09

I can confirm this is still the case with Xcode 4.4 on Mountain Lion, unfortunately.

If I close the iOS simulator with Cmd+Q rather than leaving it open and stopping the simulation with the "Stop" button on the Xcode toolbar, the following things happen (although not systematically, but in 25% of the cases launching the same application - I believe this is related to application status but I have not understood how yet):

  • the "run" button in Xcode does not open a new iOS Simulator session; the "stop" button is still clickable but gives no result;
  • the toolbar continues to say "Running on iPhone simulator" no matter how many times you click "Stop";
  • if the iOS simulator is launched manually, it is not linked to the Xcode session;
  • not only does one have to re-start XCode: the restart has to be forced as the simple Xcode "Quit" command will not work.
查看更多
祖国的老花朵
5楼-- · 2019-03-14 10:20

I've been having a similar problem which can be resolved by restarting Xcode, but it's quite annoying. I've managed to get a workaround for this 'problem'.

  1. Go to ~/Applications/ and open the context menu for Xcode.app and select Show Package Contents

  2. Navigate to /Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/

  3. Copy iOS Simulator.app and paste it to (for instance) your Desktop

  4. Next start your OSX system preferences panel and navigate to Keyboard

  5. Select the second tab Keyboard Shortcuts

  6. Select Application Shortcuts on the left side

  7. Press the small + sign on the right side

  8. A small dialog appears.
    Select the copied iOS Simulator.app in the first selectbox > Other...

  9. As Menu Title fill in Home

  10. And for the menu shortcut 'type' COMMAND + Q

  11. Now hit Add and close your system preferences

  12. Delete iOS Simulator.app from your Desktop.

If you now start the simulator through Xcode and (accidentally) want to quit the simulator while it's running and attached to Xcode > you can't.

I know it doesn't fix the problem itself, but for those pro-users who use keyboard shortcuts for everything this might help a bit.

查看更多
该账号已被封号
6楼-- · 2019-03-14 10:24

Not really a solution, but I just overrode the “Quit iOS Simulator” keyboard shortcut in System Preferences to something I’m unlikely to type impulsively, like ⌘⌥Q.

查看更多
登录 后发表回答