xcrun simctl status_bar not working in xcode 12 - xcode

I have just upgraded my Xcode to 12 beta. I have tried to override the status bar on the simulator using this command:
xcrun simctl status_bar 52B135BF-F549-4684-A959-914499AB3296 override --time '9:41' --batteryState charged --batteryLevel 100;
This command works on the previous version. However, it doesn't work anymore.
Does anyone know how to fix this?

From Xcode 12b3 Release Notes: "simctl status bar overrides don’t work properly on simulated devices running iOS or iPadOS 13.6 or earlier. (63958080)"
Just got burned by this myself.

Related

XCode 10 shows no simulators or devices

I just reinstalled XCode 10 and now navigating to XCode -> XCode -> Open Developer Tool -> Simulator -> Hardware -> Device -> Manage Devices shows no devices or simulators:
Does anyone know what might cause that behavior, or what I can do to install a simulator version (e.g. iOS 6s)? Any help would be greatly appreciated!
So this machine had a previous version of XCode installed, and had some legacy simulators that were left over from that earlier XCode installation. Step one was to remove those simulators:
xcrun simctl delete unavailable
Then I manually created a new simulator:
xcrun simctl create duhaime-6s com.apple.CoreSimulator.SimDeviceType.iPhone-6s com.apple.CoreSimulator.SimRuntime.iOS-12-0
Those arguments are: xcrun simctl NAME DEVICE_TYPE RUNTIME. You make up the simulator name, and can select a device type and runtime from the list of options displayed if you run xcrun simctl list. After creating the simulator, you can start it:
xcrun simctl boot 4A6368C3-A94C-4D83-8AA3-9E9900ABCC74
That GUID / simulator ID will be displayed if you rerun xcrun simctl list.

When launching an iOS simulator it closes straight away but still runs in the background

When I try to run a project (even a default single view app) in Xcode 10.2 (also occoured on Xcode 10.3 and beta 11 build 3) the simulator launches but then closes but Xcode still thinks it's running (looks like it is running headless). Any ideas on how I can see the simulator?
I have tried the following so far but the only time I can see the Simulator is on its first launch after that it disappears after launching.
Uninstalling and re-installing Xcode (making sure to delete all related directories and doing a system restart)
Adding and removing simulators from window -> Devices and simulators from within Xcode
Tried clearing the simulator cache xcrun simctl erase all
Tried running the following sudo killall -10 com.apple.CoreSimulator.CoreSimulatorService
Clearing Derived data ~/Library/Developer/Xcode/DerivedData/
Another thing I noticed is if I run: /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator I get the following error:
Bus error: 10
But if I run: sudo/Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator the Simulator launches fine.
Thanks for any help.

DVTCoreSimulatorAdditionsErrorDomain Xcode 10GM

When I update Xcode to Version 10 GM, build success, but Simulator can't work! with error:
The operation couldn’t be completed. (DVTCoreSimulatorAdditionsErrorDomain error 0.)
run xcrun simctl erase all in Terminal. It should solve the issue.
i think its a bug from Apple.
I had the same issue. Not 1 simulator worked and the UIStoryboard was not rendering any graphics. The solution was to restart my mac. Not just Xcode but your Mac (laptop, mac mini, whatever you might be using)

Weird Strings for iOS version in Xcode simulator list

As you can see in the screenshot, I am getting this weird string for some simulators. How can I fix this?
It happened to me,when there were both Xcode7-beta and Xcode6 in my Mac.
As you see,UDID-like strings are UDIDs (Unique Device IDentification numbers) for the iOS Simulator devices. As they are duplicated devices with unique UDIDs,to there are two ways to solve this problem,:
I suspect the issue will go away if you restart the service:
Quit Xcode, Instruments, and the iOS Simulator and then run this in Terminal.app:
sudo killall -9 Xcode 'iOS Simulator' com.apple.CoreSimulator.CoreSimulatorService
Then
rm -rf ~/Library/Developer/CoreSimulator/Devices
Just change and rename your simulators: In xCode go to Window -> Devices and press the plus in the bottom corner and add the simulators that you wish or minus to remove.
Then it'll be ok:
Thanks to #stevechen for pointing me in the right direction, I finally solved this problem :
Xcode Menu > Open Developer Tools > Open iOS Simulator
iOS Simulator Menu > Hardware > Device > Manage Devices
Delete all the bad entries
Add then back
Enjoy!
I ended up running this:
killall Xcode
sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService
rm -rf ~/Library/Developer/CoreSimulator/Devices
open /Applications/Xcode.app
Per this SO answer: https://stackoverflow.com/a/31421158/406
It worked great for me!
Xcode 6.4

Error running playground. Unable to find suitable target device. (iOS Swift)

I created a new project in XCode.
File > New > Playground (option+shift+cmd+N)
I restarted my XCode and also rebooted my system, but still same error.
From the developer forums, this worked for me:
Quit Xcode
Delete the folder /Users/<username>/Library/Developer/CoreSimulator/Devices. For example, in Terminal: rm -rf ~/Library/Developer/CoreSimulator/Devices
In Terminal: killall -9 com.apple.CoreSimulator.CoreSimulatorService (or just reboot).
Fox Xcode 7, I had to install iPad Air or iPad Air 2 for the playground to work.
Another possible way to encounter that issue is to get Xcode being auto-updated, while the simulator was launched.
The solution is like mentioned above but more polite:
Quit Xcode and Simulator app
Run in Terminal: killall -9 com.apple.CoreSimulator.CoreSimulatorService
Launch Xcode and find that all fixed now.
Sure, you can just reboot instead.
Try navigating to the Xcode Menu
Window >> devices (shift+cmd+2) a new window will pop up.
On the bottom left, add a new simulator, specifically one running on iOS 8.0 to the existing list.
Restart Xcode.
As referred by #Mayank Gupta , It worked on adding new simulator and restarting the XCode.

Resources