📺 Fullscreen Xcode and Simulator
Tags: xcode, swift, objectivec, simulator
Published: 2018-08-08 08:48:19

---
title: 📺 Fullscreen Xcode and Simulator
published: true
description: The best way to debug applications during development is to run them in simulator and the best way to run simulator is right next to Xcode in fullscreen!
tags: xcode, swift, objective-c, simulator
cover_image: https://blg.zdnkt.com/content/images/2018/08/Screenshot-2018-08-01-at-23.33.06.png
---

The way you are switching between the apps, virtual desktops or fullscreen apps affects your workflow, efficiency, and focus. I have a tip how to run Xcode 9 or 10 with Simulator in a divided fullscreen mode so you can focus on the development without distractions.

__This article is also published on [my blog](https://blg.zdnkt.com/fullscreen-xcode-and-simulator/).__

# ☹️ The problem
I don't know about you, but I actually like (a lot) working with Xcode, or with any other IDE (and different apps) in fullscreen. It gives me the full usage of the screen and I can become easily more productive in the app. Also switching between 2 or more apps is easier thanks to macOS gestures. But there is one thing that used to be an issue for me. It was debugging an application. You have 2 options:

1. Real device
2. or Simulator

With the real device, you have to pick it up all the time, probably even unlock it for Xcode to be able to run the application. That's annoying. I used this approach for years because I was thinking "there's nothing like device", later I've got a little smarter and started using Simulator for most of my testing and debugging. It went fine, but had some pain points:
* every time I had to switch with a gesture to Simulator (and back)
* when Xcode hit breakpoint or app crashed, macOS transitioned me back to Xcode
* you could not look at the app and check console output at the same time

After a while a realized it bothers me, it is not productive and I lost focus many times.

# ✅ The Solution
An 💡 idea popped in my head, why don't I put it next to Xcode in fullscreen? Unfortunately, Simulator does not support fullscreen mode by default. I did a little research and figured there's a way, but that's not all we need, if we had Simulator running in one fullscreen and Xcode in second, it wouldn't almost any improvement. We need to merge them together to run in divided fullscreen mode. And luckily, that's enabled for both once they support fullscreen.

![Xcode 10 with Simulator in fullscreen](https://blg.zdnkt.com/content/images/2018/08/Screenshot-2018-08-02-at-20.27.34.png)
On the left side is Xcode 10 beta 5 running in fullscreen and on the right side we have Simulator running iPhone X with iOS 12.

# 💨 The easy way
To enable the fullscreen mode in Simulator, just open up Terminal app and **run the following command**:
```
defaults write com.apple.iphonesimulator AllowFullscreenMode -bool YES
```
**That's it!**

If you want to checkout other settings (the options are in the screenshot below) you can change in Simulator, keep reading and follow the steps.

# 📐 More customizations
If you want to do this for **Xcode 9**, then you are fine and **it is all you need**. However, if you are already using **Xcode 10**, you **need both versions** of Xcode (9 and 10) to make it work.

Apple has hidden features and settings all over the system and their apps. Some of those you can access when you have a directory called `AppleInternal` in the root of your main volume.

## ❓ What is `/AppleInternal`?
AFAIK it is empty directory Apple engineers use to enable development and debug features, menus, and settings. When you create the directory, a bunch of `Internal` menus might appear across different apps, I recommend to ignore it unless you know what are you doing. We will use it to enable the fullscreen mode for Simulator app.

## 👣 Steps
Let's get to it then!
### 1. Check if you need to disable SIP
Just **try** to do **step 3**. If it works, continue with step 4 to the end. **In case it fails** with message `mkdir: /AppleInternal: Operation not permitted`, **go to step 2**.

### 2. Disable SIP
SIP is [System Integrity Protection](https://support.apple.com/en-us/HT204899) introduced in El Capitan. It protects you from viruses and in many cases even from yourself 😜. We need to disable it because `/AppleInternal` is one of those protected areas.
* restart your computer and hold `⌘ CMD + R` until your Mac reboots to Recovery mode
* in top menu select `Utilities > Terminal`
* run `csrutil disable`
* restart it again using the  menu

### 3. Create `/AppleInternal`
You should be able to create `/AppleInternal` now.
* open Terminal app
* execute `sudo mkdir /AppleInternal`

### 4. Enjoy the music 🎉
Open the Simulator app thru Xcode 9 (`Xcode > Open Developer Tool > Simulator`). In the menu, you should now see a new item, `Internal`. 

![Simulator internal settings](https://blg.zdnkt.com/content/images/2018/08/Screenshot-2018-08-02-at-22.40.32.png)

Just go ahead and have a play with it. Don't forget to enable fullscreen mode (`Internal > Allow Fullscreen Mode`). The changes you make in Xcode 9 Simulator should be also reflected in Xcode 10 Simulator even if it does not show the `Internal` menu.

### 5. Enable SIP
When you are finished with your modifications, repeat step 2, but instead of running `csrutil disable`, **run `csrutil enable`** to be safe again.

I hope you were successful and enjoy the fullscreen mode!

Please feel free to reach me on [Twitter @zdnkt](https://twitter.com/zdnkt) for comments, feedback, ideas and discussion.

__This article is also published on [my blog](https://blg.zdnkt.com/fullscreen-xcode-and-simulator/).__