How To Start App On Mac With Command Line
The Desktop App 3.3.0 for Mac comes with a brand new Mac Command Line Interface (CLI) for Egnyte Admins and users. The CLI can be used to add, reconfigure, remove drives, setup Connected Folders, mark or unmark folders for offline access, adjust proxy settings, and more.It's easy and scriptable! Get started by opening your Terminal and typing in egnytecli. Mac Command Line Interface for Desktop App The Desktop App 3.3.0 for Mac comes with a brand new Mac Command Line Interface (CLI) for Egnyte Admins and users. The CLI can be used to add, reconfigure, remove drives, setup Connected Folders, mark or unmark folders for offline access, adjust proxy settings, and more.
Follow these steps to start using the Dart SDK to develop command-line and server apps.First you’ll play with the Dart language in your browser, no download required.Then you’ll install the Dart SDK, write a small program, and run that program using the Dart VM.Finally, you’ll use an AOT (ahead of time) compiler to compile your finished program to native machine code,which you’ll execute using the Dart runtime.
1. Play with Dart code in DartPad
With DartPad you can experiment with the Dart language andAPIs, no download necessary.
For example, here’s an embedded DartPad that lets you play with the code for asmall Hello World program. Click Run to run the app; output appears in theconsole view. Try editing the source code — perhaps you’d like to change thegreeting to use another language.
Note: If you see an empty box instead of code, go to theDartPad troubleshooting page.
More information:
2. Install Dart
Once you’re ready to move beyond DartPad and develop real apps,you need an SDK.You can either download the Dart SDK directly(as described below)or download the Flutter SDK,which (as of Flutter 1.21) includes the full Dart SDK.
- Windows
- Linux
- Mac
Use Chocolatey to install a stable release of the Dart SDK:
How To Start App On Mac With Command Lines
You can use Aptitude to install the Dart SDK on Linux.
- Perform the following one-time setup:
- Install the Dart SDK:
With Homebrew, installing Dart is easy.
Important: For more information, including how to adjust your PATH
, see Get the Dart SDK.
3. Create a small app
Use the dart create
command and the console-full
templateto create a command-line app:
This command creates a small Dart app that has the following:
- A main Dart source file,
bin/cli.dart
, that contains a top-levelmain()
function. This is the entrypoint for your app. - An additional Dart file,
lib/cli.dart
, that contains the functionality ofthe app and is imported by thecli.dart
file. - A pubspec file,
pubspec.yaml
, that contains the app’s metadata, includinginformation about which packages the app depends onand which versions of those packages are required.
4. Run the app
To run the app from the command line, use the Dart VM by running thedart run
command in the app’s top directory:
If you want to run the app with debugging support, seeDart DevTools.
5. Modify the app
Let’s customize the app you just created.
- Edit
lib/cli.dart
to calculate a different result. For example, divide theprevious value by two (for details about~/
, see Arithmetic operators): Save your changes.
Rerun the main entrypoint of your app:
More information:Write command-line apps
6. Compile for production
The steps above used the Dart VM (dart
) to run the app. The Dart VM isoptimized for fast, incremental compilation to provide instant feedbackduring development. Now that your small app is done,it’s time to AOT compile your Dart code to optimized native machine code.
Use the dart compile
tool to AOT compile the program to machine code:
Notice how the compiled program starts instantly, completing quickly:
What next?
Check out these resources:
- Additional tutorials and codelabs for Dart
- Dart language, libraries, and conventions
- Tools and libraries
If you get stuck, find help at Community and support.
Disclaimer: I am not on the .NET Core Team. I used the tools available publicly and have no insights into the future of .NET Core. It looks very bright though. :)
The working source code for this project can be found here.
Intro
A complete list of post in this series is included below :
In this post, we’re going to look at running the app from the command line and then the Mac.
Running the App in the Windows Command Prompt
While you can obviously run the app inside of Visual Studio with the F5 command. You should also know that you can run the app inside of the console. Before we begin, make sure you have the app found here. After opening the app or downloading it, open the folder containing the project in the command prompt.
You can run your application here by simply typing :
You will the following output :
How To Start Mac App From Command Line
The exact same result from running the console app in Visual Studio.
Using dotnet publish to get the app ready for Mac
Go ahead and type dotnet publish
on the command prompt and then type tree
to look at your directory listing as shown below :
You should see the publish directory. Navigate into it and list out the files in the directory :
Take note that the dlls listed below are related to the package reference that we added in the last blog post.
- Newtonsoft.Json.dll
- System.Runtime.Serialization.Primitives.dll
This only leaves the NetCoreConsoleApp.dll which is the Console application that we can run on a Mac (or any other platform that supports .NET Core).
Running the app on a Mac
Finally! It is about time you might say. I agree. Before you can run the app on your Mac, you’re going to need to head back over to the .NET Core downloads page and install OpenSSL and then the SDK (or runtime) if you remember the difference from the first post.
To run this on your Mac, you’ll need to copy the ‘publish’ folder to your Mac. Then open Terminal and you can run the app by just typing :
This is awesome! Now you have an app that run on another platform and you used your existing .NET skillset to create it. I’m LOVING .NET Core!
Wrap-up
How To Start App On Mac With Command Line Shortcut
OK, I’m going to take a break and I’ll be back next week. As always, thanks for reading and smash one of those share buttons to give this post some love if you found it helpful. Also, feel free to leave a comment below or follow me on twitter for daily links and tips.