Code Monkey home page Code Monkey logo

controlroom's Introduction

Control Room logo

Twitter: @twostraws

Control Room is a macOS app that lets you control the simulators for iOS, tvOS, and watchOS – their UI appearance, status bar configuration, and more. It wraps Apple’s own simctl command-line tool, so you’ll need Xcode installed.

You’ll need Xcode 14.0 or later to build and use Control Room on your Mac.

Installation

To try Control Room yourself, download the code and build it through Xcode. It’s built using SwiftUI, so you’ll need macOS Big Sur in order to run it. You will also need Xcode installed, because it relies on the simctl command being present – if you see an error that you’re missing the command line tools, go to Xcode's Preferences, choose the Locations tab, then make sure Xcode is selected for Command Line Tools.

Features

Control Room is packed with features to help you develop apps more effectively, including:

  • Taking screenshots and movies, optionally adding the device bezels to your screenshots.
  • Adjusting the system time and date to whatever you want, including Apple’s preferred 9:41.
  • Controlling status of WiFi, cellular service, and battery.
  • Opening the data folder for your app, or editing your UserDefaults entries.
  • Overriding dark or light mode, language, accessibility options, and Dynamic Type content size.
  • Picking a custom user location from anywhere in the world.
  • Starting, stopping, installing, and removing apps.
  • Sending test push notifications or triggering deep links.
  • Selecting colors from the simulator, converting them to UIKit or SwiftUI code, or even dragging directly into your asset catalog.

Plus there’s an optional menu bar icon adding quick actions such as re-sending the last push notification or re-opening your last deep link.

Contribution guide

Any help you can offer with this project is most welcome – there are opportunities big and small so that someone with only a small amount of Swift experience can help.

Some suggestions you might want to explore:

  • Handle errors in a meaningful way.
  • Add documentation in the code or here in the README.
  • Did I mention handling errors in a meaningful way?

You’re also welcome to try adding some tests, although given our underlying use of simctl that might be tricky.

If you spot any errors please open an issue and let us know which macOS and Xcode versions you’re using.

Please ensure that SwiftLint returns no errors or warnings before you send in changes.

Credits

Control Room was originally designed and built by Paul Hudson, and is copyright © Paul Hudson 2023. The icon was designed by Raphael Lopes.

Control Room is licensed under the MIT license; for the full license please see the LICENSE file. Many other folks have contributed features, fixes, and more to make Control Room what it is today. Control Room is built on top of Apple’s simctl command – the team who built that deserve the real credit here.

Swift, the Swift logo, and Xcode are trademarks of Apple Inc., registered in the U.S. and other countries.

If you find Control Room useful, you might find my website full of Swift tutorials equally useful: Hacking with Swift.

controlroom's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

controlroom's Issues

Some ideas regarding push notifications

Some ideas regarding push notifications:

  1. Since the payload is specified, we could use fields that directly set values, so we could construct a JSON with, avoiding any syntax errors or typos in the payload
  2. We could use two modes, one for the simplest notification (title, body) and an 'advanced' one that would support every possible type of payload. The benefit of this would be that in the first case we could have a much more intuitive way of creating simple test notifications by directly manipulating the information on a 'notification replica' view. I did some initial work and looks really nice imo (this is a working prototype where both title & body are directly editable)

Screen Shot 2020-02-15 at 1 37 06 PM

I would appreciate any feedback, if you guys think that this is something worth exploring I would be more than willing to work on it.

Open Container Folder Location

Hello and congrats for this tool that helps us a lot !

I wonder if it would be better for the "Show Container" button to open the folder the Temporary Application folder. It's the location that is used the most, imho.

What is your opinion about this?

Most of the stuff is not working. What am I doing wrong?

This tool looks very promising and I hope I can get it to work. Lately I had to test our app behaviour when the user revoke permissions (like Notifcation and Location). It would have saved me plenty of time, where I had to go into the Simulator settings and revoke these manually and then switch back to the app.

Unfortunatly most of the features don't work for me. My setup is

MacOS Catalina 10.15.3
Simulator iOS 12.4: not working at all
Simulator iOS 13.3:

  • Light/Dark: not working
  • App Permissions Revoke/Grant/Reset: not working
  • Uninstall App: working
  • Push: not working
  • Battery: working
  • Location: not tested
  • Network: not working

Just tell me which information you need and I will gladly send it

Show iOS version for simulator device

In the list of simulators, there's multiple devices of the same model though no distinction about which version of iOS the device is relating to.

Record simulator video

Is it possible to add the functionality to record a video from the simulator?

In the terminal it's possible to do it with the following command:

xcrun simctl io booted recordVideo .

To stop the recording in terminal "cartel + c" needs to be clicked

Network issue

If I set the following:

image

It does not seem to change anything:

image

Every other option in Control Room works perfectly.

Be able to change simulator language

It would be great to be able to change simulator language via ControlRoom! If there is an underlaying command available already, I could take over the implementation!

Location button not working properly.

In the "Location" tab, the "activate" button is not currently working.

This is probably due to an error in my previous implementation (inspired by Lyft work here), I omitted the simulator id array and seemed to work properly on my side.

I've re-introduced the array with only the current simulator id and the location simulation is back to work.
PR coming.

User Profiles

It would beneficial if there was an option to set multiple user profiles.

[FR] Create a new simulator

⌘N should roll down a sheet where you can select a device type, a runtime, and enter a name to create a simulator.

simctl create <name> <device type id> [<runtime id>]

[FR] Rename a simulator

Rename a simulator.

Not sure what the UX here would be. Maybe the giant name in the detail area can be editable?

[FR] Clone a simulator

This would be an easy thing to add in the contextual menu

simctl clone [device id] [new name]

Ability to remove carrier

One of Apple's marketing and identity guidelines is "Don’t show the name or identity of a carrier." Changing the Operator text field to blank does nothing, and it would be better if it instead removes the carrier text from the status bar. If you set it to be a space and then view it on say an iPhone 8 Plus, then there will be a space in the status bar.

Dependency on SwiftLint 0.39.1

It should be noted there is a compiler dependency on swiftlint 0.39.1

If you have the prior version installed (0.39.0) you will get many compile errors like this one:

Type Name Violation: Type name should only contain alphanumeric characters: 'DataView_Previews' (type_name)

Feature Request: Simulator Management

Managing simulators in Xcode is unfortunately quite a pain. The biggest issue is that every version of Xcode, all of the simulators are reinstalled, and you can only remove them one by one. The less time-consuming (yet time-consuming) approach is usually to delete them all and add them back one by one.

It'd be great to have a way to do this through ControlRoom to batch up requests, rather than doing it one by one every few months.

Upon suggestion from @twostraws, one idea would be to add an Edit/Done button for the current sidebar to show a list of checkboxes, with a delete button in that context to formalize the action.

An alternative idea I'd propose would be to provide identifiers for the simulators you'd like to install.

Thanks a lot!

Precompiled releases?

This project looks cool!

Would be great if there was a precompiled release in the Releases tab I could download without compiling it myself. Ideally, it would also be available on Homebrew so I could run brew cask install controlroom

It was pretty easy to get it to run though -- I expected to have to deal with Cocoapods or something, and instead, it worked on the first run.

Location simulation doesn't work on Default simulator

The Default simulator has some issues with Location simulation (the tab with the map).
The hack we're using to toggle current user's simulated position is based on simulator's udid property, which is booted for the Default one.

We can work around this by checking if selected simulator's id is booted and then broadcast the location notification to all booted devices.

I'll try to put together a PR

note: related to #43 .

Mac App Store?

Any chance this could be distributed through the Mac App Store?

Feature "Always on top"

Is it possible to add feature always on top?.
I remember this feature was in old ios simulator.

App crashes when selecting the default simulator

Steps to reproduce:

  • Make sure "Show default simulator" option is turned on in the preference
  • Launch the app
  • Select the very first simulator item from the sidebar, i.e. the one reads "Default"
  • App crashes

It seems that the selectedSimulators property in SimulatorsController is unable to locate the selected simulator(s) when a simulator has "booted" as its udid.

Add DerivedData directory to .gitignore

In my opinion DerivedData data directory should be excluded from source control. Please think about improving the .gitignore file for this project. I can provide a PR if you desire. Thanks!

Option to show only active simulators in sidebar

In Xcode Project Navigator, besides filter field there are other small buttons, like to show files with git changes.
Maybe we can add such icon in this filter field, to show all active(booted) simulators?

Will require some designer help to come up with nice icon as well.

Expressive API for communicating with simctl

Mostly adding this because it's something I want to take a stab at!

The goal would be to take something like our current:

execute(["status_bar", simulator, "override", "--batteryLevel", "\(level)", "--batteryState", "charging"])

and turn it into something like:

execute(.statusBar(deviceId: simulator, operation: .override([.batteryLevel(level), .batteryState(.charging)])))

Hoping this will also simplify some of the iterating cases in the ui, turning for example:

let resetPermissions = [
    "All",
    "Calendar",
    "Contacts",
    "Location",
    "Microphone",
    "Motion",
    "Photos",
    "Reminders",
    "Siri"
 ]

Picker("Permissions:", selection: $resetPermission) {
    ForEach(resetPermissions, id: \.self) {
        Text($0)
    }
}

into:

Picker("Permissions:", selection: $resetPermission) {
    ForEach(SimCtl.Privacy.Permission.allCases, id: \.self) {
        Text($0.displayName)
    }
}

Feature Request: Utilize GitHub Releases

Heya @twostraws, moving the suggestion I provided here, with more details.

This is a feature request to begin using GitHub's Releases to more easily keep up with the progress of ControlRoom. Since using the app is currently predicated on building from source, there's no easy way to know how far from master you are, and what new features have been released since you last updated.

An bigger improvement would be to support prebuilt binaries with each release, but the ideal implementation for me would be to leverage GitHub's Releases API to show an alert in the app whenever there's a new release available.

An alternative approach (and maybe in conjunction with the above) would be to use GitHub's Commits API to see the commits on this repository, so the user can see what work has been done without having to go to GitHub.

Thanks a lot!

Odd overlaying issue

I often get:

image

However if I click the system tab a few times it comes right again.

The "Default" simulator needs special handling/removal

The "Default" simulator refers to "which ever simulator happens to be booted".

But... this simulator can't technically be deleted or renamed. You can perform these actions, but they forward on to apply to the booted simulator.

We should guard against this, or just remove the default simulator.

A lot of previews are crashing

I'm seeing a lot of previews crashing, mainly due to missing environmentObject injection (for example AppView is missing UIState and NetworkView is missing Preferences - this was pointed out by the crash logs at ~/Library/Logs/DiagnosticReports and verified by manually adding the objects at the respective previews).

I guess this is due to the assumption that injection happens at AppDelegate (?) and thus "inherited" (by silently launching the app) by every preview or this assumption should be valid and this is something that is failing due to my system setup (latest production version of Xcode)? Is anyone else having these problems?

Simulator logs

It'd be convenient if there was a button to generate logs through xcrun simctl diagnose.

Overlapping views bug

I think I've found a small bug with the following steps:

  1. Select Device Simulator (e.g. iPhone 11)
  2. Select "App" tab
  3. Click into the APS notification json/text block
  4. Select a different tab (Where the bugs appear)
  • You should notice that the selected tab isn't changed correctly on first select
  • If you select another tab, not "App" or current tab selected, two views/settings pages will overlap.

Screenshot:
Screen Shot 2020-05-25 at 5 17 48 PM

Push Notification Payload Editor Automatically Swaps " for ”

When typing in the push notification payload text view, if you edit something within "" they automatically change to "smart quotes" which causes the notification to not be able to be sent (since it's no longer valid JSON).

If you use the notification editor, the JSON uses correct quotes.

Control Room was built on:
Xcode: 12.4
macOS: 11.1 (20C69)

Used the debug scheme (Release scheme had an error: "The linked framework 'CoreSimulator.framework' is missing one or more architectures required by this target: arm64.", will raise a separate issue for that.

Camera

Is it possible that there's a way to make the simulator camera work, similar to how Android does?

Feature Request and issue: No command line tools set --> App stuck

This is just an issue when building a release version of the app and not running it from Xcode.

If in Xcode --> Preferences --> Locations --> Commandline Tools is not set the App is stuck at "Loading simulators".

Reason: The app does not find the simctrl tool

Feature request: give feedback/error message when the simctrl tool can not be found with a short explanation how to enable it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.