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.
☹️ 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:
- Real device
- 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.
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
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
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.
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 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 + Runtil your Mac reboots to Recovery mode
- in top menu select
Utilities > Terminal
- restart it again using the menu
You should be able to create
- open Terminal app
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,
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
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 for comments, feedback, ideas and discussion.