How to run multiple simulators on Xcode 12 and 13? - xcode

I've seen this post for running multiple simulators on Xcode 9: How to run multiple simulators on Xcode 9?
The working solution was to go to Hardware > Devices and choose a simulator from there. But I'm currently using Xcode 13 and many developers may have the same version now. In version 12^/13, we won't find Hardware up top. So how do we run another simulator from there?

In order to open another simulator, you'll need to go to File > Open Simulator and then choose from the devices there like this:
You're all set! I just want to share this to everyone to help save their time and avoid getting headaches (like what I've experienced) just to run another simulator on Mac.

Related

Xcode 13: Build hangs with "iPhone is busy: making Apple Watch ready for development"

Issue: The build hangs with "iPhone is busy: making Apple Watch ready for development"
Further facts:
iOS 14.8
iPhone 8
watchOS 7.6.2
Xcode 13
Apple Watch Series 3 + Cellular (42mm)
Does anyone know a solution for that issue?
Many of the developers have the same issue:
https://developer.apple.com/forums/thread/691452
I have been struggling with this for some time now. If you don't need the Apple Watch, instead of turning it off completely, you can also turn on airplane mode if configured correctly.
On your watch, go to Settings App → Airplane Mode. Make sure that both WIFI and Bluetooth switches are turned off!
When the bluetooth switch is turned on, a connection will still be established even if your watch is in airplane mode AND bluetooth is turned off on the phone from Control Center. It took me some time to figure this out...
Update: The Bluetooth setting seems to turn itself on again after some time! No idea why... 🤷🏼‍♂️ Keep that in mind and check the setting again if flight mode does not fix your issue.
Using Flutter?
When running flutter doctor, it will give you a clear hint, that your watch is causing the issue.
When trying to build your app e.g. from Android Studio, you might instead find these messages in your log:
The requested device could not be found because no available devices matched the request.
Available destinations for the "dev" scheme:
[list of devices]
Could not build the precompiled application for the device.
Building a deployable iOS app requires a selected Development Team with a Provisioning Profile. Please ensure that a Development Team is selected by:
[instructions how to set the development team]
Ineligible destinations for the "dev" scheme:
[list of devices]
I put these messages here for people googling them. If you have an Apple Watch, then run flutter doctor to check if this is the root cause.
This is what works for me:
Turn off the Bluetooth from settings in your iPhone from Settings -> Bluetooth (Don't turn it off from the control center)
Quit Xcode
Launch it again
Build and Run
The solution is:
Waiting for 5-20 mins
Let your iPhone and Apple Watch on
I think all answers are overlooked, you don't need 5-20 mins if you let it finish the preparing process, it'll take just a few minutes, 5 mins top..
But regarding fixing this with an upgrade, that's not the case, and I would love to see it fixed, or offered with an option to exclude watch from the dev purpose unless really needed.
I facing this issue too. This is because the latest xcode only support until iOS 15.2 sdk, but my phone's iOS version is 15.3. Thus, xcode is downloading the iOS 15.3 sdk from your phone that's why takes time (I knew the message is not saying that)
However, I do some testing and it works for me.
Get the iOS 15.3 sdk (is 10BG!!!) from my friend xcode's Devices Support iOS folder /Users/XXX/Library/Developer/Xcode/iOS DeviceSupport and paste it to yours one.
Downloading the iphone OS device support file from https://github.com/filsv/iPhoneOSDeviceSupport/blob/0e8ef7bc51b982304ed3258454f88ae2d5615ac7/15.3.zip unzip it and paste it in /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
Restart Xcode.
Build success without waiting.
Origin From: https://developer.apple.com/forums/thread/691452?answerId=704424022#704424022
The Apple Watch configuration takes around 5 minutes. It's way better to postpone everything and let it run for 5 minutes then the other workarounds - such as disconnecting your watch, turning on/off your iphone, etc
In my case:
If my Apple Watch is turned on - then from Xcode I'm still able build and run the app just fine.
But when I'm using Flutter - it fails.
flutter devices shows my iphone as "Busy".
As soon as I turn off the Apple Watch, and then disconnect and reconnect the iPhone USB cable - all is good.
Since it's one of the earliest Apple Watch modules, the latest WatchOS that I can install is v6.3, although the latest available is WatchOS v8.x.
I suppose this issue doesn't occur with the latest WatchOS.
(I'm using iOS v15.2)
This still happens from time to time. The solution that has worked for me every time is to reboot the phone
Make sure you're running a version of Xcode that supports the SDK versions of your iOS/watchOS device. If you've recently updated either OS versions, you may need a matching Xcode update for this to work properly.
The real solution is:
If you don't need the apple watch you can just power off the Apple Watch and unplug/plug the iPhone. That's a quick fix. No need to unpair the watch no need to wait 5 - 20 mins
According to this post, this issue is fixed with an upgrade to iOS 15.0.2 / watchOS 8.0.1: https://developer.apple.com/forums/thread/691452

Trouble running multiple simulators with XCode

I'm running XCode 8 and I've followed a few of the resources to run multiple simulators but, unfortunately, whenever I compile the code within XCode, it restarts all of the simulators to the same exact version and crashes all except for the primary that's displaying the application.
My approach was the open -n Simulator.app where I open up multiple simulators manually and then target the various devices within XCode.
Any better solutions out there?
Xcode 9 supports this out of the box, I would recommend that you upgrade unless you have a specific reason not to do this.

Run two simulators with the same device and iOS version concurrently

I want to run two iPhone SE's running iOS 10.3 at the same time to compare two version of my app conveniently. I've cloned the app repo twice with both repo's checkout on different commits. I specifically created two iPhone SE devices in Xcode's Window/Devices menu. When I run one app, I set the scheme to the one device, when I run the other app, I set the scheme to the other device. But when a second app runs, it cuts off the first app. I don't understand this. The projects are different, and the devices are different so what is the conflict?
If you grab Xcode 9 Beta, this should “just work” for you. This support was added in Xcode 9.

Xcode scheme craziness

I've been using essentially the same set of schemes for my app for several years with no problem. When selecting a scheme to build, for each simulator device there would be a choice of iOS reflecting what simulators were installed.
Trying to solve a problem, I deleted Derived Data per some suggestions here. Today, when I select a scheme to build, I get this:
This is not helpful! I cannot figure out how to get back to the Target/Scheme combinations I had before. Any and all help will be appreciated!
yes i got this when I installed Xcode 7 beta.
Went away when I downloaded XCode 7 from the mac app store.
But I had to run Xcode 6.4 to test swift 1.2 code and was fine for a while till i rang two simulators at once.
Then in Xcode 7 they all appeared again
I had also downloaded the 8.4 simulator in Xcode 7 today so this may also have caused it.
I believe both simulators were sharing this folder so they got merged:
/Users/gbxc/Library/Developer/CoreSimulator/Devices
/Users/gbxc/Library/Developer/CoreSimulator/Devices/device_set.plist
raised q:
https://stackoverflow.com/questions/32742962/xcode-devices-list-showing-50-devices

Resetting Xcode's device/version list to run

I want to test/run my app on different iOS versions in Xcode, but somehow I can't see any option to change iOS simulator version (I have both 6 and 7 SDK/Simulator installed) in run targets. I'm also seeing all of my attached devices twice (I have only ONE iPod, but when I connect something else, they all display twice):
There's probably a bug with the device list of Xcode. How can I reset this list? I've tried resetting the scheme, but scheme is project related anyway. The problem occurs in all projects, not only a single project.
First of all, you have to install the 6.1 Simulator.
After that, you can choose which simulator version to use:
I've figured out the problem. I was on the "Latest iOS SDK" which was 7.1 SDK (I also have XCode 5.1DP installed). I've changed the base SDK to 7.0 and I am again able to choose. I still have two entries for each physical device but I can live with that.

Resources