Xcode playground gets stuck on 'Running playground' or 'Launching simulator' and won't run the code, what to do?

前端 未结 22 933
情歌与酒
情歌与酒 2020-12-22 16:03

Every time I create a new playground in order to test some code, Xcode gets stuck and won\'t run the code. It simply presents \'Running playground\' or \'Launching simulator

22条回答
  •  伪装坚强ぢ
    2020-12-22 16:21

    Ans. Switch to macOS platform

    When you create a Playground, by default it select iOS platform and automatically imports UIKit. It's the UIKit which crashes and stuck all the time. If your (practice) code does not use UIKit then you can switch to MacOS platform. As major (not exact though) difference between iOS and macOS is in APPKit and UIKit.

    In the upper right corner of your Xcode Playground, click on show/hide Utilities--> file inspector --> Playground Setting--> Platform--> macOS

    See screenShot below:

提交回复
热议问题