{"id":6957,"date":"2020-05-30T14:57:24","date_gmt":"2020-05-30T09:27:24","guid":{"rendered":"https:\/\/codeforgeek.com\/?p=6957"},"modified":"2023-12-22T19:05:26","modified_gmt":"2023-12-22T13:35:26","slug":"setting-up-mac-for-development-coding","status":"publish","type":"post","link":"https:\/\/codeforgeek.com\/setting-up-mac-for-development-coding\/","title":{"rendered":"Setting up Mac for Development\/Coding"},"content":{"rendered":"<p>You may need to setup up your brand new Mac or after purchasing a used one with factory reset for software development purposes. While I understand that the usage behavior of individuals differs, there are some settings and software that most of the developers use or should use.<\/p>\n<p>In this article, I am going to cover setting up your mac for software development. I will keep this article updated with settings\/software I come across in the future. Let&#8217;s begin.<\/p>\n<h2>Setting up Mac for Development<\/h2>\n<p>Let&#8217;s begin with updating your system to the latest macOS. If you already have the latest one, move to the next section.<\/p>\n<h3>Updating Mac<\/h3>\n<p>The first thing you need to do is update your system. <\/p>\n<p>To do that go: Apple menu (\uf8ff) > About This Mac > Software Update.<\/p>\n<p>Also, upgrade your OS to the latest version to have a more secure OS.<\/p>\n<h3>Installing Xcode<\/h3>\n<p>Xcode is a sort of mandatory software in Mac for software development. Xcode comes up with compilers and other basic software that we need to use to build programs. <\/p>\n<p>To install Xcode, run the following command in the terminal.<\/p>\n<p><code><br \/>\nsudo xcode-select --install<br \/>\n<\/code><\/p>\n<p>Installation of Xcode may take some time depending on your internet bandwidth. It&#8217;s worth the wait.<\/p>\n<h3>Install Homebrew<\/h3>\n<p>I have just one word for Homebrew. It&#8217;s awesome. It&#8217;s the best software for the developer community. Homebrew is the package manager and allows you to install\/update software with few lines of command.<\/p>\n<p>Once Xcode is installed, run the following command in the Terminal to install Homebrew.<\/p>\n<p><code><br \/>\n\/bin\/bash -c \"$(curl -fsSL https:\/\/raw.githubusercontent.com\/Homebrew\/install\/master\/install.sh)\"<br \/>\n<\/code> <\/p>\n<p>To verify Homebrew installation, run this:<\/p>\n<p><code><br \/>\nbrew doctor<br \/>\n<\/code><\/p>\n<h3>Installing core softwares<\/h3>\n<p>Listing some of the core software that I believe every developer needs to have.<\/p>\n<p>Just copy\/paste the shell command shown below in the terminal to install.<br \/>\n<code><br \/>\nbrew install \\<br \/>\n  git \\<br \/>\n  make \\<br \/>\n  tree \\<br \/>\n<\/code><\/p>\n<h3>Installing necessary softwares<\/h3>\n<p>Now, this may change according to your needs. Add\/remove the packages based on your need.<\/p>\n<p><code><br \/>\nbrew cask install \\<br \/>\n  alfred \\<br \/>\n  appcleaner \\<br \/>\n  visual-studio-code \\<br \/>\n  google-chrome \\<br \/>\n  flux \\<br \/>\n  firefox \\<br \/>\n  iterm2 \\<br \/>\n  docker \\<br \/>\n  vlc \\<br \/>\n  slack \\<br \/>\n  spotify \\<br \/>\n  postman<br \/>\n<\/code><\/p>\n<h3>Installing ZSH<\/h3>\n<p>If you are not using MocOS Catalina, you need to install ZSH separately. <\/p>\n<p><code><br \/>\nbrew install zsh<br \/>\n<\/code><\/p>\n<p>Install Oh My ZSH.<\/p>\n<p><code><br \/>\nsh -c \"$(curl -fsSL https:\/\/raw.githubusercontent.com\/robbyrussell\/oh-my-zsh\/master\/tools\/install.sh)\"<br \/>\n<\/code><\/p>\n<p>Then run,<br \/>\n<code><br \/>\nchsh -s $(which zsh)<br \/>\n<\/code><\/p>\n<p>Check out the <a href=\"https:\/\/github.com\/ohmyzsh\/ohmyzsh\/wiki\" rel=\"noopener noreferrer\" target=\"_blank\">configuration page<\/a> to customize ZSH according to your need and taste.<\/p>\n<h3>Configuring Git<\/h3>\n<p>First thing first, set up your Git username ( make sure it&#8217;s the same as the Github  ).<\/p>\n<p><code><br \/>\ngit config --global user.name \"Your Name Here\"<br \/>\ngit config --global user.email \"your_email@youremail.com\"<br \/>\n<\/code><\/p>\n<p>Next, create a global level .gitignore file. You can add\/remove the file name as per your requirement.<\/p>\n<p>create a new file in the home directory.<\/p>\n<p><code><br \/>\nnano ~\/.gitignore<br \/>\n<\/code><\/p>\n<p>Copy\/paste the following content.<\/p>\n<p><code><br \/>\n# Folder view configuration files<br \/>\n.DS_Store<br \/>\nDesktop.ini<\/p>\n<p># Thumbnail cache files<br \/>\n._*<br \/>\nThumbs.db<\/p>\n<p># Files that might appear on external disks<br \/>\n.Spotlight-V100<br \/>\n.Trashes<\/p>\n<p># Compiled Python files<br \/>\n*.pyc<\/p>\n<p># Compiled C++ files<br \/>\n*.out<\/p>\n<p># Application-specific files<br \/>\nconfig.json<br \/>\nconfig.js<br \/>\n.env<br \/>\nnode_modules<br \/>\n.sass-cache<br \/>\n<\/code><\/p>\n<h3>Install Programming languages\/framework software<\/h3>\n<p>Let&#8217;s install the required software for programming purposes. I generally use Node, Python, Rust, and C++. C++ already gets installed with Xcode. Let&#8217;s install the rest of them.<\/p>\n<p><strong>Installing Node using <a href=\"https:\/\/codeforgeek.com\/update-node-using-npm\/\" rel=\"noopener noreferrer\" target=\"_blank\">NVM<\/a>: <\/strong><\/p>\n<p><code><br \/>\ncurl -o- https:\/\/raw.githubusercontent.com\/nvm-sh\/nvm\/v0.35.2\/install.sh | bash<br \/>\n<\/code><\/p>\n<p>Then,<\/p>\n<p><code><br \/>\nnvm install node<br \/>\n<\/code><\/p>\n<p>Restart the terminal and run this command.<\/p>\n<p><code><br \/>\nnvm use node<br \/>\n<\/code><\/p>\n<p>Verify the Node installation.<\/p>\n<p><code><br \/>\nnode -v<br \/>\nnpm -v<br \/>\n<\/code><\/p>\n<p><strong>Installing Python: <\/strong><br \/>\nRun this command to install Python3.<\/p>\n<p><code><br \/>\nbrew install python<br \/>\n<\/code><\/p>\n<p>For Python 2.7.<br \/>\n<code><br \/>\nbrew install python@2<br \/>\n<\/code><\/p>\n<p>Install Pip.<\/p>\n<p><code><br \/>\ncurl https:\/\/bootstrap.pypa.io\/get-pip.py > get-pip.py<br \/>\nsudo python get-pip.py<br \/>\n<\/code><\/p>\n<p><strong>Installing Rust:<\/strong><\/p>\n<p>Run this command to install Rust.<\/p>\n<p><code><br \/>\nbrew install rustup<br \/>\n<\/code><\/p>\n<p><code><br \/>\nrustup-init<br \/>\n<\/code><\/p>\n<p>Verify Rust installation.<br \/>\n<code><br \/>\nrustc --version<br \/>\n<\/code><\/p>\n<h3>Installing Database softwares<\/h3>\n<p>I generally work with MongoDB, MySQL, and Redis. Let&#8217;s install them.<\/p>\n<p><strong>Installing MongoDB:<\/strong><\/p>\n<p><code><br \/>\nbrew tap mongodb\/brew<br \/>\n<\/code><\/p>\n<p><code><br \/>\nbrew install mongodb-community<br \/>\n<\/code><\/p>\n<p><strong>Installing MySQL:<\/strong><\/p>\n<p><code><br \/>\nbrew install mysql<br \/>\n<\/code><\/p>\n<p>Run MYSQL as a service.<\/p>\n<p><code><br \/>\nmysql.server start | stop<br \/>\n<\/code><\/p>\n<p><strong>Installing Redis: <\/strong><\/p>\n<p><code><br \/>\nbrew install redis<br \/>\n<\/code><\/p>\n<p>Verify the installation.<\/p>\n<p><code><br \/>\nredis-server<br \/>\n<\/code><\/p>\n<h3>Configuring Visual Studio Code<\/h3>\n<p>I use the following VSCode extensions:<\/p>\n<ul>\n<li>ESLint<\/li>\n<li>GitLens<\/li>\n<li>Prettier<\/li>\n<li>Path intellisense<\/li>\n<li>Rust<\/li>\n<\/ul>\n<p>You can search these extensions in the VSCode and install them one by one.<\/p>\n<p>And <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=wesbos.theme-cobalt2\" rel=\"noopener noreferrer\" target=\"_blank\">Cobalt2 theme<\/a> from Wesbos.<\/p>\n<p>It looks pretty good.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/codeforgeek.com\/wp-content\/uploads\/vscode.png\" alt=\"\" width=\"1552\" height=\"939\" class=\"alignnone size-full wp-image-6961\" srcset=\"https:\/\/codeforgeek.com\/wp-content\/uploads\/vscode.png 1552w, https:\/\/codeforgeek.com\/wp-content\/uploads\/vscode-300x182.png 300w, https:\/\/codeforgeek.com\/wp-content\/uploads\/vscode-1024x620.png 1024w, https:\/\/codeforgeek.com\/wp-content\/uploads\/vscode-768x465.png 768w, https:\/\/codeforgeek.com\/wp-content\/uploads\/vscode-1536x929.png 1536w\" sizes=\"(max-width: 1552px) 100vw, 1552px\" \/><\/p>\n<p>Related: <a href=\"https:\/\/codeforgeek.com\/best-visual-studio-code-extensions-web-development\/\" rel=\"noopener noreferrer\" target=\"_blank\">Top 15 Must Have Visual Studio Code extensions<\/a><\/p>\n<h3>System preferences<\/h3>\n<p>Here are a few things I change in the system preferences.<\/p>\n<p>First, change the screenshots folder ( by default Mac save it on Desktop )<\/p>\n<p><code><br \/>\ndefaults write com.apple.screencapture location <full path to the folder><br \/>\n<\/code><\/p>\n<p>Add your iCloud account and sync Calendar, Find my Mac, Contacts, etc.<\/p>\n<p>I change trackpad settings and enable the tap to click with one finger feature. I generally use Logitech MX master 2 as a wireless mouse.<\/p>\n<p>I change the dock setting and make the icon size smaller. I remove lots of default applications from the dock as well. Keeping it minimal and simple.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/codeforgeek.com\/wp-content\/uploads\/Screen-Shot-2020-05-30-at-2.37.01-PM.png\" alt=\"Mac dock\" width=\"806\" height=\"49\" class=\"alignnone size-full wp-image-6962\" srcset=\"https:\/\/codeforgeek.com\/wp-content\/uploads\/Screen-Shot-2020-05-30-at-2.37.01-PM.png 806w, https:\/\/codeforgeek.com\/wp-content\/uploads\/Screen-Shot-2020-05-30-at-2.37.01-PM-300x18.png 300w, https:\/\/codeforgeek.com\/wp-content\/uploads\/Screen-Shot-2020-05-30-at-2.37.01-PM-768x47.png 768w\" sizes=\"(max-width: 806px) 100vw, 806px\" \/><\/p>\n<h2>Thoughts?<\/h2>\n<p>If you have any suggestions, feedbacks or any software I am missing out big time. Do let me know.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You may need to setup up your brand new Mac or after purchasing a used one with factory reset for software development purposes. While I understand that the usage behavior of individuals differs, there are some settings and software that most of the developers use or should use. In this article, I am going to [&hellip;]<\/p>\n","protected":false},"author":69,"featured_media":6964,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_surecart_dashboard_logo_width":"180px","_surecart_dashboard_show_logo":true,"_surecart_dashboard_navigation_orders":true,"_surecart_dashboard_navigation_invoices":true,"_surecart_dashboard_navigation_subscriptions":true,"_surecart_dashboard_navigation_downloads":true,"_surecart_dashboard_navigation_billing":true,"_surecart_dashboard_navigation_account":true,"_uag_custom_page_level_css":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-6957","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorial"],"blocksy_meta":[],"uagb_featured_image_src":{"full":["https:\/\/codeforgeek.com\/wp-content\/uploads\/Setting-up-Mac-for-Development.jpg",1500,750,false],"thumbnail":["https:\/\/codeforgeek.com\/wp-content\/uploads\/Setting-up-Mac-for-Development-150x150.jpg",150,150,true],"medium":["https:\/\/codeforgeek.com\/wp-content\/uploads\/Setting-up-Mac-for-Development-300x150.jpg",300,150,true],"medium_large":["https:\/\/codeforgeek.com\/wp-content\/uploads\/Setting-up-Mac-for-Development-768x384.jpg",768,384,true],"large":["https:\/\/codeforgeek.com\/wp-content\/uploads\/Setting-up-Mac-for-Development-1024x512.jpg",1024,512,true],"1536x1536":["https:\/\/codeforgeek.com\/wp-content\/uploads\/Setting-up-Mac-for-Development.jpg",1500,750,false],"2048x2048":["https:\/\/codeforgeek.com\/wp-content\/uploads\/Setting-up-Mac-for-Development.jpg",1500,750,false]},"uagb_author_info":{"display_name":"Pankaj Kumar","author_link":"https:\/\/codeforgeek.com\/author\/pankaj\/"},"uagb_comment_info":0,"uagb_excerpt":"You may need to setup up your brand new Mac or after purchasing a used one with factory reset for software development purposes. While I understand that the usage behavior of individuals differs, there are some settings and software that most of the developers use or should use. In this article, I am going to&hellip;","_links":{"self":[{"href":"https:\/\/codeforgeek.com\/wp-json\/wp\/v2\/posts\/6957","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codeforgeek.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codeforgeek.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codeforgeek.com\/wp-json\/wp\/v2\/users\/69"}],"replies":[{"embeddable":true,"href":"https:\/\/codeforgeek.com\/wp-json\/wp\/v2\/comments?post=6957"}],"version-history":[{"count":0,"href":"https:\/\/codeforgeek.com\/wp-json\/wp\/v2\/posts\/6957\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/codeforgeek.com\/wp-json\/wp\/v2\/media\/6964"}],"wp:attachment":[{"href":"https:\/\/codeforgeek.com\/wp-json\/wp\/v2\/media?parent=6957"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codeforgeek.com\/wp-json\/wp\/v2\/categories?post=6957"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codeforgeek.com\/wp-json\/wp\/v2\/tags?post=6957"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}