GameMaker Studio 2's Indie subscription (and above) comes with three desktop export platforms: Windows, Mac and Ubuntu.In this article we give the required steps to get the Windows platform up and running on both the Windows and Mac IDEs (see near the bottom of the page for Mac IDE setup). You can then use menu File → Open Folder to have two instances of Visual Studio Code with different folders in each window. ⌘ + Shift + N and ⌘ + K for Mac. List of helpful keyboard shortcuts can be found here.
- Installation and setup
- Creating projects
- Running and debugging
- Advanced debugging
- Editing tips for Flutter code
Installation and setup
Follow the Set up an editor instructions toinstall the Dart and Flutter extensions(also called plugins).
Updating the extension
Updates to the extensions are shipped on a regular basis.By default, VS Code automatically updates extensions whenupdates are available.
To install updates manually:
- Click the Extensions button in the Side Bar.
- If the Flutter extension is shown with an available update,click the update button and then the reload button.
- Restart VS Code.
There are a couple ways to create a new project.
Creating a new project
To create a new Flutter project from the Flutterstarter app template:
- Open the Command Palette(
- Select the Flutter: New Application Project command and press
- Enter your desired Project name.
- Select a Project location.
Opening a project from existing source code
Open 2 Visual Studio For Mac Download
To open an existing Flutter project:
- Click File > Open from the main IDE window.
- Browse to the directory holding your existingFlutter source code files.
- Click Open.
Editing code and viewing issues
The Flutter extension performs code analysis thatenables the following:
- Syntax highlighting
- Code completions based on rich type analysis
- Navigating to type declarations(Go to Definition or
F12),and finding type usages(Find All References or
- Viewing all current source code problems(View > Problems or
Mon macOS))Any analysis issues are shown in the Problems pane:
Running and debugging
Note: You can debug your app in a couple of ways.
- Using DevTools, a suite of debugging and profilingtools that run in a browser. DevTools replaces the previousbrowser-based profiling tool, Observatory, and includesfunctionality previously only available to Android Studioand IntelliJ, such as the Flutter inspector.
- Using VS Code’s built-in debugging features,such as setting breakpoints.
The instructions below describe features available in VS Code. For information on using launching DevTools, see Running DevTools from VS Code in the DevTools docs.
Start debugging by clicking Run > Start Debuggingfrom the main IDE window, or press
Selecting a target device
When a Flutter project is open in VS Code,you should see a set of Flutter specific entries in the status bar,including a Flutter SDK version and adevice name (or the message No Devices):
- If you do not see a Flutter version number or device info,your project might not have been detected as a Flutter project.Ensure that the folder that contains your
pubspec.yamlisinside a VS Code Workspace Folder.
- If the status bar reads No Devices, Flutter has not beenable to discover any connected iOS or Android devices or simulators.You need to connect a device, or start a simulator or emulator,to proceed.
The Flutter extension automatically selects the last device connected.However, if you have multiple devices/simulators connected, clickdevice in the status bar to see a pick-listat the top of the screen. Select the device you want to use forrunning or debugging.
Are you developing for macOS or iOS remotely using Visual Studio Code Remote? If so, you might need to manually unlock the keychain. For more information, see this question on StackExchange.
Run app without breakpoints
- Click Run > Start Without Debugging in themain IDE window, or press
F5.The status bar turns orange to show you are in a debug session.
Run app with breakpoints
- If desired, set breakpoints in your source code.
Click Run > Start Debugging in the main IDE window,or press
- The left Debug Sidebar shows stack frames and variables.
- The bottom Debug Console pane shows detailed logging output.
- Debugging is based on a default launch configuration.To customize, click the cog at the top of theDebug Sidebar to create a
launch.jsonfile.You can then modify the values.
Run app in debug, profile, or release mode
Open 2 Visual Studio For Mac Os
Flutter offers many different build modes to run your app in. You can read more about them in Flutter’s build modes.
launch.jsonfile in VS Code.
If you do not have a
launch.jsonfile, go to the Run view in VS Code and click create a launch.json file.
- In the
configurationssection, change the
flutterModeproperty to the build mode you want to target.
- For example, if you want to run in debug mode, your
launch.jsonmight look like this:
- For example, if you want to run in debug mode, your
- Run the app through the Run view.
Fast edit and refresh development cycle
Flutter offers a best-in-class developer cycle enabling youto see the effect of your changes almost instantly with theStateful Hot Reload feature. SeeUsing hot reload for details.
You might find the following advanced debugging tips useful:
Debugging visual layout issues
During a debug session,several additional debugging commands are added to theCommand Palette and to the Flutter inspector.When space is limited, the icon is used as the visualversion of the label.
- Toggle Baseline Painting
- Causes each RenderBox to paint a line at each of its baselines.
- Toggle Repaint Rainbow
- Shows rotating colors on layers when repainting.
- Toggle Slow Animations
- Slows down animations to enable visual inspection.
- Toggle Debug Mode Banner
- Hides the debug mode banner even when running a debug build.
Debugging external libraries
By default, debugging an external library is disabledin the Flutter extension. To enable:
- Select Settings > Extensions > Dart Configuration.
- Check the
Debug External Librariesoption.
Editing tips for Flutter code
If you have additional tips we should share, let us know!
Assists & quick fixes
Assists are code changes related to a certain code identifier.A number of these are available when the cursor is placed on aFlutter widget identifier, as indicated by the yellow lightbulb icon.The assist can be invoked by clicking the lightbulb, or by using thekeyboard shortcut
. on Mac), as illustrated here:
Quick fixes are similar,only they are shown with a piece of code has an error and theycan assist in correcting it.
- Wrap with new widget assist
- This can be used when you have a widget that you want to wrapin a surrounding widget, for example if you want to wrap awidget in a
- Wrap widget list with new widget assist
- Similar to the assist above, but for wrapping an existinglist of widgets rather than an individual widget.
- Convert child to children assist
- Changes a child argument to a children argument,and wraps the argument value in a list.
- Convert StatelessWidget to StatefulWidget assist
- Changes the implementation of a
StatelessWidgetto that ofa
StatefulWidget, by creating the
Stateclass and movingthe code there.
Snippets can be used to speed up entering typical code structures.They are invoked by typing their prefix,and then selecting from the code completion window:
The Flutter extension includes the following snippets:
stless: Create a new subclass of
stful: Create a new subclass of
StatefulWidgetand its associated State subclass.
stanim: Create a new subclass of
StatefulWidget,and its associated State subclass including a field initializedwith an
You can also define custom snippets by executingConfigure User Snippets from the Command Palette.
F5on macOS) performs a hot reload.
Keyboard mappings can be changed by executing theOpen Keyboard Shortcuts command from the Command Palette.
Hot reload vs. hot restart
Hot reload works by injecting updated source code files into therunning Dart VM (Virtual Machine). This includes not onlyadding new classes, but also adding methods and fields toexisting classes, and changing existing functions.A few types of code changes cannot be hot reloaded though:
- Global variable initializers
- Static field initializers
main()method of the app
For these changes, fully restart your application withouthaving to end your debugging session. To perform a hot restart,run the Flutter: Hot Restart command from the Command Palette,or press
F5 on macOS).
Known issues and feedback
All known bugs are tracked in the issue tracker:Dart and Flutter extensions GitHub issue tracker.
We welcome feedback,both on bugs/issues and feature requests.Prior to filing new issues:
- Do a quick search in the issue trackers to see if theissue is already tracked.
- Make sure you are up to date with the most recentversion of the plugin.
When filing new issues, include flutter doctor output.-->
To start developing native, cross-platform .NET apps on macOS, install Visual Studio 2019 for Mac following the steps below.
- A Mac with macOS High Sierra 10.13 or above.
To build Xamarin apps for iOS or macOS, you'll also need:
- A Mac that is compatible with the latest version of Xcode. See Apple's minimum requirements documentation
- The latest version of Xcode. It may be possible to use an older version of Xcode if your Mac is not compatible with the latest version.
- An Apple ID. If you don't have an Apple ID already you can create a new one at https://appleid.apple.com. It's necessary to have an Apple ID for installing and signing into Xcode.
Download the installer from the Visual Studio for Mac download page.
Once the download is complete, click the VisualStudioforMacInstaller.dmg to mount the installer, then run it by double-clicking the arrow logo:
You may be presented with a warning about the application being downloaded from the Internet. Click Open.
Wait while the installer checks your system:
An alert will appear asking you to acknowledge the privacy and license terms. Follow the links to read them, then press Continue if you agree:
The list of available workloads is displayed. Select the components you wish to use:
If you do not wish to install all platforms, use the guide below to help you decide which platforms to install:
Type of App Target Selection Notes Apps Using Xamarin Xamarin.Forms Select Android and iOS platforms You will need to install Xcode iOS only Select iOS platform You will need to install Xcode Android only Select Android platform Note that you should also select the relevant dependencies Mac only Select macOS (Cocoa) platform You will need to install Xcode .NET Core applications Select .NET Core platform. ASP.NET Core Web Applications Select .NET Core platform. Azure Functions Select .NET Core platform. Cross-platform Unity Game Development No additional platforms need to be installed beyond Visual Studio for Mac. Refer to the Unity setup guide for more information on installing the Unity extension.
After you have made your selections, press the Install button.
The installer will display progress as it downloads and installs Visual Studio for Mac and the selected workloads. You will be prompted to enter your password to grant the privileges necessary for installation.:
Once installed, Visual Studio for Mac will prompt you to personalize your installation by signing in and selecting the key bindings that you'd like to use:
If you have network trouble while installing in a corporate environment, review the installing behind a firewall or proxy instructions.
Learn more about the changes in the release notes.
If you chose not to install a platform or tool during the original installation (by unselecting it in step #6), you must run the installer again if you wish to add the components later.
Install Visual Studio for Mac behind a firewall or proxy server
To install Visual Studio for Mac behind a firewall, certain endpoints must be made accessible in order to allow downloads of the required tools and updates for your software.
Configure your network to allow access to the following locations:
Installing Visual Studio for Mac allows you to start writing code for your apps. The following guides are provided to guide you through the next steps of writing and deploying your projects.
- Device Provisioning(To run your application on device).
Build native cross-platform applications with Xamarin.Forms:
.NET Core apps, ASP.NET Core web apps, Unity game development
For other Workloads, refer to the Workloads page.