Questions tagged [simctl]

Introduced in Xcode 6 (by Apple), simctl is a tool that allows you to create, boot, launch and then shutdown and destroy iOS simulators on the fly, and provides commands to install and launch specific apps.

Introduced in Xcode 6 (by Apple), simctl is a tool that allows you to create, boot, launch and then shutdown and destroy iOS simulators on the fly, and provides commands to install and launch specific apps.

If you ever used Genymotion you might have created Android simulators using VirtualBox command line utility, Apple works towards the same flexibility with simctl.

In context of this article, to see a list of available devices, run this command

xcrun simctl list

You will get the list of device types, runtimes and devices. Device types and runtimes will be handy if you need to create new simulators. You can tell simctl to filter output, for example, list devices only

xcrun simctl list devices

Source

43 questions
15
votes
2 answers

how to get list of available ios simulators?

i want to list available ios simulators as in below format ( iOS version should take from JSON key ) { "name": "iPhone 5s (11.4)", "udid": "FB6B3F7F-E6CD-4F64-8EC4-6C07C86A25C8" } { "name": "iPhone 6 Plus (11.4)", "udid":…
kumara
  • 171
  • 1
  • 1
  • 6
8
votes
0 answers

Run XCTest bundle with simctl

I have a XCTest bundle which I can run through xcode on a simulator by using simctl. I am using the iPhone 6 iOS 9.1 simulator with the following environment variables: export…
JFoulkes
  • 2,429
  • 1
  • 21
  • 24
8
votes
1 answer

Simctl install can't find Bundle Identifier in .app when installing app in simulator

When I try to install my app in the booted simulator, like this: xcrun simctl install booted /build/iphone/build/Debug-iphonesimulator/foo.app I get the following result: An error was encountered processing the command (code=22): Failed to install…
6
votes
3 answers

How to know bundle identifiers of all apps on iOS simulator

How do I get the bundle identifiers of all the apps installed on an iOS simulator? I want to automate uninstallation of a specific app called WebDriverAgent (used by Appium) via a script. e.g. xcrun simctl uninstall booted…
the_prole
  • 8,275
  • 16
  • 78
  • 163
5
votes
0 answers

iOS Simulator, recording video and audio via the command line?

I'm trying to create an app preview video using the iOS command line simulator tool, which produces video, like so. xcrun simctl io booted recordVideo However, videos don't include audio. I have seen that videos aren't possible unless you have…
Jules
  • 7,568
  • 14
  • 102
  • 186
5
votes
1 answer

simctl delete, Unable to delete device in current state: Creating

I am trying to delete a Simulator but it is in a state which simctl delete will not delete it. I removed it from all the places I can think, but a reference to it is preserved somewhere. First, the listing: $ xcrun simctl list devices | grep…
Jeff
  • 3,829
  • 1
  • 31
  • 49
4
votes
1 answer

iPhone simulator screenshot not capturing device bezel

I'm trying to capture a simulator screenshot using Xcode 12. Right now, even though the "Show Device Bezels" option is enabled (and it shows the bezels on the screen), when I take the screenshot, the bezel isn't part of the resulting screenshot.…
Z S
  • 7,039
  • 12
  • 53
  • 105
4
votes
4 answers

Xcodebuild: Unable to find a destination matching the provided destination specifier

I want to test same unit test on various platform versions. However, I can't due to a xcodebuild error. I built my project xcodebuild build-for-testing \ -configuration Debug \ -scheme UnitTest \ -sdk iphonesimulator \ …
John
  • 1,139
  • 3
  • 16
  • 33
4
votes
1 answer

Is there a command to restart the Xcode iOS simulator from command line?

I have found a command to killall simulators but does not fit my needs. I need to be able to restart a particular simulator given the udid. I have tried shutdown and then boot the simulator using $ xcrun simctl shutdown $ xcrun simctl boot…
PR3DATO
  • 75
  • 1
  • 8
4
votes
1 answer

How to launch lldb as a Standalone Debugger on an app running on a simulator?

My question is a follow-up to How can I use Swift REPL with iOS SDK: I'd like to be able to drop into a REPL in an iOS project and use the classes defined there. I've already built the project and it's running on a simulator: Now, I'd like to start…
Kurt Peek
  • 52,165
  • 91
  • 301
  • 526
4
votes
1 answer

xcrun: Is there a way to set environment variable via "xcrun simctl" cli

I am looking for a way to set environment while using xcrun. We could set environment via xcrun simctl setenv prior to Xcode 7.0. Now we can only view environment using xcrun simctl getenv . I have seen a reference of…
RKS
  • 1,333
  • 2
  • 12
  • 12
4
votes
1 answer

How to set iOS Simulator Language when launching via simctl

I am launching my app in the simulator using xcrun simctl. I would like to be able to set the language that the simulator launches with (ie. switch to French on one run, to Englash on another). Is there an option to do that? It used to be possible…
Michael Teper
  • 4,591
  • 2
  • 32
  • 49
3
votes
0 answers

How to install *.app file to real device by script?

Get device list xcrun xctrace list devices => 'Simson’s iPhone 11 (14.4.2) (00008030-00122CD62291802E)' Install app file xcrun simctl install 00008030-00122CD62291802E app/ios/test.app Then I get error: stderr: 'Invalid device:…
Tuan Nguyen
  • 2,542
  • 19
  • 29
3
votes
1 answer

appium - XCUITest does not always start with error ECONNREFUSED

I am trying to run some appium tests on iOS and it seems about half the time the WebDriverAgent never starts up. I get this error over and over again in the appium logs: [debug] [simctl] WD Proxy Matched '/status' to command name…
kroe761
  • 3,296
  • 9
  • 52
  • 81
3
votes
1 answer

xcrun simctl status_bar not working in xcode 12

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…
Kelvin Tan
  • 982
  • 1
  • 12
  • 33
1
2 3