Dunfey · Hotel WWDC as data, est. 1983
Front desk everything
Years
Topics

2020 Developer Tools

WWDC20 · 20 min · Developer Tools

Become a Simulator expert

Simulator runs your iOS, iPadOS, tvOS, or watchOS apps directly on your Mac — no separate device required. We’ll give you a tour of the app’s latest tools and features and show you how to sharpen your Simulator skills. Discover how to test pointer and trackpad support, adjust Simulator preferences, and use command line tools like simctl to help you simulate push notifications in a development environment. While you can get a quick overview of Simulator in this session, for more detailed information about the tool you may want to refresh yourself on “Getting the Most Out of Simulator” from WWDC19.

Watch at developer.apple.com ↗

Transcript all transcripts

Code shown on screen · 11 snippets

Grant permission to protected resources bash · at 11:32 ↗
xcrun simctl privacy booted grant calendar com.example.MyApp

xcrun simctl privacy booted grant photos com.example.MyApp

xcrun simctl privacy booted grant contacts com.example.MyApp
Revoke permission to protected resources bash · at 11:54 ↗
xcrun simctl privacy booted revoke calendar com.example.MyApp

xcrun simctl privacy booted revoke all com.example.MyApp

xcrun simctl privacy booted reset all
Sample push notification for Simulator json · at 12:47 ↗
{
  "Simulator Target Bundle": "com.example.MyApp",
  "aps": {
       "alert": {
           "title": "Push Notification",
           "subtitle": "New fruit smoothies are available",
           "body": "We know you'll love these delicious concoctions 🥰"
       }
   }
}
Send a push notification to a specific Bundle ID bash · at 13:15 ↗
xcrun simctl push booted com.example.MyApp payload.json
Send a push notification to the Bundle ID in the payload bash · at 13:43 ↗
xcrun simctl push booted payload.json
Record a video bash · at 14:40 ↗
xcrun simctl io booted recordVideo video.mp4
Record a video in H.264 without the device mask bash · at 15:48 ↗
xcrun simctl io booted recordVideo --codec h264 --mask ignored video.mp4
Record a video of the external display bash · at 16:23 ↗
xcrun simctl io booted recordVideo --display external external.mp4
Override the status bar bash · at 18:00 ↗
xcrun simctl status_bar booted override --time 12:01 --cellularBars 1 --dataNetwork 3g --wifiMode failed
Clear status bar overrides bash · at 18:16 ↗
xcrun simctl status_bar booted clear
Add a certificate to the root store bash · at 18:47 ↗
xcrun simctl keychain booted add-root-cert myCA.pem