Setting up new MacBook for software development

Video ID: mmkDyV59nRo

YouTube URL: https://www.youtube.com/watch?v=mmkDyV59nRo

Added At: 13-06-25 21:16:34

Processed: No

Sentiment: Neutral

Categories: Tech, Education

Tags: software development, programming, tutorial, MacBook Pro, Homebrew, VS Code, Xcode

Summary

• The video is about setting up a MacBook Pro for software development. • It involves installing various tools and packages, including Chrome, Xcode, Homebrew, and VS Code. • The speaker provides step-by-step instructions for each installation.

Transcript

[Music]
hey everybody today i'm going to set up
my new macbook pro this is the m2 model
i'm going to set it up for software
development now i do have some of the
packages that i want to install written
down but this video might still take a
little while because well
things happen during installations
unpredictable things sometimes so we'll
have a look at it together now if you
came to the live unboxing the other day
i did already install chrome on it that
was the first thing i did and between
then and now i installed xcode so to
install chrome you just go to safari
google for
chrome
download chrome and install it there you
go the reason i like chrome for software
development is because when i'm doing
web dev it has some of the best tooling
for looking at css changing things on
the fly looking at javascript debugging
and so on and xcode is probably the
thing that takes the longest time to
install on a mac it's a huge download
not only that but it also takes a really
long time to install that's why i did it
off the camera so here it is xcode
bouncing up and down i think this might
be the first use now while it's doing
that let me just show you how to install
xcode you go to the app store and you
just search for xcode and then you click
on install i have version 13.4.1 here
now
why would you care about xcode at all
well
let me know in the comments down below
if you're a software developer and you
use a mac are you in a position not to
have xcode installed i think those kinds
of developers are probably few and far
between because xcode is the primary
tool on a mac to do software development
and even if you're not using xcode
directly it has some really useful
features like for example if your apps
that you're developing use the network
it has some tools that you can use to
throttle the network to simulate slow uh
networks and latencies anyway it has a
lot of tools i recommend you install it
even if you are not using it directly
otherwise why even get a mac get a pc
that's a lot less expensive and you can
still do all your development tasks
right well i guess you could but
macs have really nice hardware don't
they they're well built their keyboard
is really good the screen is really nice
the speakers are great the resale value
is really good um okay i've convinced
myself again let's keep going shall we
now i have xcode because i do mobile
development so i work with ios apps i
work with android apps so the next thing
to do is install the android environment
but just before we do that there is a
tool that's
pretty ubiquitous if you are using a mac
and you're a developer you will most
likely encounter homebrew now you don't
have to install it but it's a really
popular package manager for the mac and
i recommend using it it makes a a lot of
things easier so you go to brew.sh and
uh this just has instructions on how to
install homebrew okay install homebrew
using this one line of code so i'm gonna
copy that let's open up the terminal oh
look at that i don't have the terminal
on my dock in fact i do like to clean up
the dock we'll do that in a moment so
i'm gonna search for terminal
and there it is and i'm going to move
this over to my dock because i like to
have terminal handy at any moment so i'm
going to use that now there's other
terminals like item 2 that are very
popular that are more configurable and
customizable you can use that
sure but i'm okay with using just
regular terminal works for me so i'm
going to open that up and paste that
command line script to
download and install homebrew now this
just points to basically a dot sh file a
shell file it's a script on the internet
in github it downloads that file and
runs it so let's do it okay let's go now
while that's installing i'm gonna clean
up my dock there's a whole lot of stuff
there by default which i don't care
about messages
i'm gonna drag that off now if you just
drag an icon off far enough away from
the dock you'll see that it has a little
remove bubble there
if you let go it just gets removed
that's the easiest way to remove these
things okay that's much better now i did
keep safari in there because i do
sometimes check safari when i'm doing
web dev to make sure that things are
looking good so so far i have safari i
have the terminal and i'm gonna drag
google chrome into my permanent dock
there right next to safari and i'm also
gonna drag in xcode because
sometimes i just need to open it
directly and i want it to be quick now
of course a lot of times i use command
space to bring up the spotlight search
in which case i can just search for
xcode and open it up that way both are
fairly quick all right now homebrew
installed and don't forget that
sometimes after the installation of
these command line tools there are some
instructions to follow don't skip this
okay so it says next steps run these two
commands in your terminal to add
homebrew to your path okay this is
important look at this it's going to add
this script to your z profile okay what
is this dot z profile well we're in the
home directory right now i'm going to
open up a new tab and keep that one
around because that has instructions on
the new tab i'm going to go ls dash la
this basically is going to list all the
directory contents in my home directory
look at that i have no dot files here at
all except for this one dot files are
basically your global configuration for
software and for your environment and um
you are going to have a dot z profile
file which is gonna contain
this information all right so right now
there isn't anything there that file z
profile is not there but when i run this
line right here so i'm gonna just copy
that first line
and paste it here and
evaluate it it wrote out that line to
this new file called z profile and now
if i go to the other tab and run lsla
now you see i have a z profile
file to look at the contents of that you
can use nano which is
an editor that comes with mac os nano z
profile and you can see that that line
is in there i'm going to press ctrl x to
exit out of here and now i need to
run this other line this is the exact
same line as this it just basically
evaluates it in place so that i don't
need to restart my shell now i should
have the brew command which is homebrew
to run homebrew you just issue brew
that's the command and there it is this
output means that well it's working now
there's one other thing that i'd like to
install that i forgot to mention and
that's vs code sometimes we take these
things for granted they're installed and
i'm used to having it installed so i
didn't put it on my list but it's an
editor that i use all the time so i'm
going to install it so i'm going to
search for vs code
there it is i'm going to go to the
download link directly and there's
options here for windows
linux and mac and i'm going to go
directly to the apple silicon version
because well
i know i have an apple silicon machine
here so might as well and i believe that
download is smaller than the universal
download which has both versions for
intel and for apple silicon i just need
the apple silicon one so i'm going to
run that one and there it is now it's in
my downloads folder right so i need to
move it to applications so that i can
just directly
run that program whenever i need it so
i'm going to take this extracted file
and just drag it over to applications
and drop it in there these are the
applications installed on my machine and
now we have visual studio code so i can
click on that and it's gonna ask me if
it's okay to open it yes it is that's
the security feature and there it is
there's vs code it's running i'm going
to close my applications folder and i'm
going to move vs code over to my
permanent dock now there's one other
thing that i want to make sure that
happens and that is on my terminal i
want to be able to just type in code to
open up vs code now if i type code dot
it's not going to recognize it
command not found code it doesn't know
what that is if i open up a new terminal
tab
if i type in code it still doesn't know
what that is so how do we get that
working well we go to visual studio code
and you can do f1 and then type in make
sure that greater sign greater or less
than sign is there and then install and
then this is the one you want shell
command install code command in path
let's go ahead and do that and it wants
my password to do that i'll enter that
in successfully installed in path cool
now let's pop open a new terminal tab
and say code dot
and vs code opens into my home directory
and now it's gonna ask me a bunch of
permissions i'm gonna say okay okay
okay okay
and do you trust the authors of the
files in this folder and i say trust
permanently good so now i can look at my
files pretty easily just using vs code
there's z profile right there great
let's continue so the next thing to
install for android development or for
java development both of them require
java jdk i'm going to use this one right
here adoptium it's a pre-built open jdk
and this one does support apple silicon
it's pretty good there's other options
out there like zulu and even the
official uh oracle one supports apple
silica now i believe but this is the one
i'm gonna use so i can go into this
website adoptium.net and click on this
button but we now have homebrew so we
don't need to do that we can use
homebrew to install our packages for us
so in order to do that uh we're going to
go to the documentation here and then
you can say let's see download temirin i
don't know if i'm saying that right
temurin tamarin tamarin tamarin probably
right install eclipse tamarin here are
the instructions for that on mac os and
there is the command line we need to use
brew install dash dash cask tamarin so
you can install this version but i know
that for some of the development that i
do for example native script i need a
specific version of the jdk and that's
this one right here
okay brew install cask tamarind 11. so
that's the one i would be installing but
if you're just doing general development
you can just use the latest version
which is this one so i'm gonna do this
one but you can install that one
before i install this one though i need
to run this command brew tap homebrew
cask versions so that it has the record
of all the different versions that are
available so i'm gonna run that first
okay and it's done and now all i need to
do is just install this one which is
brew install dash dash cask tamarin 11.
it needs my password for one of the
installations and it's done all right
great um now we just need android studio
i'm gonna go to
developers.android.com
studio or you can just search for
android studio it'll get you here
eventually download android studio right
here or you can go to download options
here and pick out the exact correct
version that you need to make sure that
you're getting the one you want for the
apple silicon machine which is this one
max 64-bit arm this is the one i want i
know i'm not making a mistake or
accidentally getting the wrong version
so i'm gonna download that one
yes agree and let's go hey i earned an
android studio user badge i have like 10
of those
can i trade that in for cash that's the
question all right download done let's
open that up and this one provides a
nice little installer that we can just
drag android studio into applications
folder directly that
is going to copy the files over and
install it i don't know why i sound like
i've been i don't know
partying all night where is our android
studio here it is let's open that up
open and there it is do not import
settings we're on chipmunk chipmunk
already that's so cute all right welcome
this wizard will set up your development
environment for android studio next
let's choose the standard i don't know
what kind of development you're doing
but i'm going to choose standard for now
and the default theme is dark good to go
next and now it's going to download a
bunch of packages and keep installing
stuff like the android sdk
we're going to need to accept
licenses for each one of these items so
i'm going to select them read the
agreement and then click accept on each
one of those and if you need to install
other packages other versions for
example 33
the sdk 33 is pretty new so you
might need to support older sdks so you
need to go back and get those all right
it's gonna download more stuff and
install them okay looks like it's done
i'm gonna click finish here and here we
are now you might need to customize this
a little bit so here under more actions
you have your sdk manager this is where
you can install other apis for example
right now we have android api 33 and
i might want to grab 12 and 11 as well
to support those i'm gonna check those
and that's sdk platforms now let's take
a look at sdk tools make sure that
android emulator is checked here we do
want that installed and i think that's
the default anyway
thanks helicopter that was very
good timing all right let's click apply
here and it says confirm changes
yes and it's going to get the rest of
the stuff now when that's done you click
ok and then you can just go back here to
android studio if you need to create a
new project let's just do a quick test
here okay
there we go i'm in android studio and
i'm able to write some code so now you
can develop android applications let's
move on to the next one i'm going to
terminate this close android studio and
clear the screen here now the next thing
i want to install is the javascript
node environment so one way to do that
and this is not the recommended way i'm
going to show you two not recommended
ways and then i'll show you what i use
now you can go to nodejs directly and a
lot of people do this but uh you're
gonna get yourself in trouble because of
permissions and things like that down
the line so you can go to the node
official website and download the latest
lts version lts's long term support or
you can get the latest and greatest
which is 18 that's the current version i
usually stick with lts unless i
specifically need something in version
18 but lts does fine so you can do that
download this from here and install it
or or you can do it a different way so
we have homebrew installed we can go to
say brew install
node yeah this is easier this is using
your package manager and the permissions
will be fine you can do it this way but
i like even a different way i like to
use node version manager which allows me
to quickly manage different versions of
node on the same machine here's nvm node
version manager you can go to this url
and check it out install it read about
it and this is how easy it is to
basically switch between versions of
node which if you have multiple projects
to support is a really good idea if you
are just starting out you probably only
need one version of node then you can
just do brew install node and that'll be
fine now i'm going to use nvm so i'm
going to go here to the instructions for
mvm and copy this one and execute that
this will install nvm now again it gives
me some instructions after it's done
installing make sure you read that it
says profile not found tried these files
these are your dot files these are
associated with your profile but we
don't have any of them if we go to a new
tab and say ls
ls-la these are the dot files that we
currently have notice vs code created
one and vm created its own folder gradle
and android all right this is the z
profile file that we've been using so
far and well nvm didn't bother looking
at that file it looked for these instead
okay so we can create a new file called
z shell rc uh z sures
or
we can just keep using z profile to keep
everything together and that's what i'm
going to do so i'm going to open up
visual studio code with this folder and
i'm just going to add
additional things in here like it says
create one of them and run the script
again or append the following lines to
the correct file yourself so i'm going
to append these two lines copy that and
paste that in here and save now if we go
and open up a new tab and say nvm
there it is now it's there now i can use
nvm
to install node instead of doing it
directly from the website or using
homebrew now i can use nvm so nvm
install node uh no that's not how we do
it
so nvm install
16 now it's gonna get version 16 of node
and install it now i have node look at
that that was super easy and i can just
type exit or whatever i did so i can say
node
version
and i have version 16. npm
version and i version 8.11 npm is
another tool that comes with node so
node installs npm alongside of it it
also has different versions if you're
new to this don't worry you'll get the
hang of it npm is another place that is
a package manager for node projects
anyway that's another video now i can do
javascript projects now that i have node
so how would i go about doing that well
right now i'm in my home directory i
like to keep all my
code related activities in a folder
called code so i'm going to create a
directory called code and then
go into that directory all my stuff is
going to be organized in this one
directory so i know all my code is in
there not spread out all over my hard
drive hard drive somebody's going to
call me out on that there is no hard
drive it's a it's a ssd more
specifically nand chips right in this
thing or one nand chip in this
particular model anyway i'm gonna create
a new directory called nodetest and
let's go in there and i'm gonna open
this up in vs code now i can just write
a javascript file like index
dot js and i can say console.log
hello there okay now if i'm back here
make sure i still have node yes i do and
i can say node index.js and prints hello
there so it just executed my javascript
file using node nice so that's a
node-based javascript environment now
that you have note of course you can do
all the other front-end related things
like you can install angular react you
can start using javascript based
mobile application development
frameworks like nativescript and react
native and of course ionic that whole
world of front-end development and
server-side javascript development is
open to you now now you have this setup
all right we're done with javascript
next is dot net so i'd use dot net quite
a bit for some of my projects i'm gonna
oh dot no no dot net oh dot not um here
we go dot net so if you go here you can
go to download and net is basically a
server-side cross-platform
application framework you can write your
code in c-sharp and a ton of other
languages so here we are on the download
page to get the net sdk make sure you
have mac os selected and look at this
dot net 6 is available here in lts long
term support you can also go to all
versions to check out net 7 which is in
preview right now all the latest and
greatest but we're going to stick with
dot net 6 and i'm going to get the arm
version arm 64 version and there's a
package i'm going to click on that to
install it continue
install it's going to need my password
install software done i don't need the
installer i'm going to move that to
trash okay so what what did that do for
me well now i'm gonna back out of here
and now i have the.net
executable cli so it's a command line
tool i have the.net sdk installed i can
create dotnet applications now now if
you like visual studio for mac you
didn't have to do what i just did you
could have just downloaded visual studio
for mac directly
so let me show you that visual studio
for mac i'm not gonna do that but you
could go about it that way and it's a
little bit confusing some people are
confused between what is visual studio
2022 what is visual studio 2022 for mac
or what is visual studio
code i just got confused a little bit
too while saying it visual studio code
is an editor visual studio for mac is
kind of a an in development product that
was really comes from the days of
xamarin and it's probably mostly used
for doing xamarin development on a mac
so you can create mobile applications
using c-sharp visual studio 2022 the
full-blown visual studio is a windows
only product not for mac and that one
has all the features it's a full-blown
ide visual studio for mac is also
considered an id but it's kind of a
light one and visual studio code is just
an editor now it's getting a lot of
extensions and through those extensions
there's some ide like features that are
enabled but it's not considered a full
ide okay so you could go here for visual
studio for mac it's not a bad tool okay
but it's not as light as visual studio
code and it doesn't have as many
features as visual studio so it's kind
of an in-between product you can
download this and bypass
installing.net
manually like we just did i'm not going
to do that i already have net and i
always forget how to
use the.net cli because i'm not used to
it but it's pretty easy so if i wanted
to create a new console application just
like we did with node here i can use dot
net cli to create a new console app so
i'm going to copy that let's create a
new directory for dot net test and paste
that in dot net new console application
and framework you don't need to specify
it because i only have net 6 installed
but that's fine so now it created a new
console app and if we open this up in
visual studio code there it is console
write line hello world uh you know what
let's say hello
from alex
now i need to run this and in order to
do that i just say dot net run so let's
head out here and say dotnet
run and there it is hello from alex so
that's written in c-sharp and executing
with net now the next thing i want to
install is docker i've been using docker
more and more lately and it's a pretty
useful tool let me tell you so there's
docker we're gonna go to docker
get docker and there it is get docker
desktop for mac i'm gonna click on that
here you also have options for intel
chip or apple chip everybody's gonna
have those options now i'm gonna click
on the apple chip of course and let it
download not a very big download okay
i'm gonna click on that installer and
drag docker to our applications folder
installed so now i can just search for
docker oh it's not there for some reason
oh there it is it takes a little bit of
time to pop up and there it is do you
want to open it yes i do docker desktop
needs privileged access okay there's my
password accept the terms and click
accept and docker desktop is up and
running now let's talk about python and
machine learning a lot of machine
learning tools require python like
tensorflow pi torch but just like we did
with node you could install python or
you could install an environment manager
for python and that way you can quickly
create multiple environments for python
these are encapsulated boxes where they
have different versions of python
individually with their own packages and
when you go into those environments you
don't have to worry about version
conflicts so everything is encapsulated
there for example if i need project with
python 3.8 i can create an environment
for 3.8 install all the related packages
for that project and keep it in there
and then if i need a project with python
3.6 i can create another environment
with 3.6 and i can switch between those
without having them interfere with each
other so there's a couple of ways to
manage these environments one is called
anaconda and that's the way we're going
to do it today and the other popular one
is called pi and py env so let me just
show you pyen since we're talking about
it you go here uh on github pyen slash
pyen and this will show you how to
manage that and how to install it pretty
easy some people love it i'm used to
anaconda and miniconda specifically so
let's go to anaconda you can download
and install it but it's a pretty big
package with a lot of data science
packages involved you can install it
here but i like a package called
miniconda which gives me the python
environment management features without
the full blown anaconda so if we go to
conda dot io we can get miniconda there
let's go to mac os installers here and
uh here we go um you know what i can go
with python 3.8 not sure why those are
different python versions you know let's
go up here to latest
minicon installer links and then under
mac os we're going to grab the one that
says apple m1 64-bit package so this one
i'm gonna click on that and let's run
that installer yep install and off we go
and of course it wants to access my
folders i'll let it do that thank you
for installing and we're good to go now
what does that get me let's open up a
new terminal tab and you'll notice that
right away
something happens here now i have base
what is this base thing well base or
whatever is in parentheses there is the
environment that you're currently in so
whenever you open up a new terminal now
you'll get the environment that you're
in written out there and you can type in
conda dash dash version and you'll get
the conde command line utility so now if
you want to create a new environment
conda create
dash dash name you name your environment
and let's call this one pi
310 or python like that so this creates
a brand new environment for me that i
called pi 310 and i can list the
environment by saying conda env list and
this will list the environments that are
currently installed and there's base
right there and there's pi 310. if i
want to switch to that environment i say
conda
activate
pi 310 and now in parentheses i have pi
310 instead of base i'm inside that new
environment that i've created so now if
i checked version of python it's not
found we need to install python here so
conda install
python equals 3.10
yes and now it's installed python 3.10
so if i check python version 3.10 now i
can leave this environment by saying
conda deactivate and now i'm back to
base so if i check the version here it's
3.9 and i can also say conda deactivate
to leave the base environment too just
completely leave out of any anaconda or
conda environment now if i check my
python version it's not there i can
always say conda activate
pi 310 and i'm back to this environment
where python is 3.10. now that we have a
python environment we can install the
tools for machine learning like
tensorflow so here is tensorflow and
this has been fluctuating over the last
year and a half this is the latest i
found is developer.apple.com metal slash
tensorflow plugin okay so this has the
instructions here how to set up the
environment we already did that by the
way so this right here arm 64 apple
silicon it says download and install the
con environment which we did now install
the tensorflow dependencies so we're
going to install those we're run this
line on the command line let's head out
there and run it so conda install dash c
apple tensorflow depths yes good to go
now it has some other instructions on
when you're upgrading tensorflow so keep
an eye on this page here because this
changes quickly okay this part of the
video might be updated next month okay
now that
you've installed the packages for
tensorflow the dependencies in your con
environment now you can create an
environment in python that you're going
to be using so let me get out of here
i'm going to back up to code and i'm
going to create a new directory called
tf
cdtf for tensorflow and uh you know what
i'm going to create a new environment
instead of python 310 i'm going to say
conda deactivate leave that environment
and i'm going to say conda create dash
dash name let's call it tf1 for
tensorflow 1. once that's done i'm going
to activate tf1
activate tf1
there we are
do we have python in here yet i don't
think we installed python here yet
no we didn't so conda install python
equals
3.8
and python version 3.8 you see how easy
it is to switch between different
environments without interrupting the
other ones now i want to go ahead and
install base tensorflow so this command
line right here python install
tensorflow mac os let's paste that in
oops um
this is one of those situations that i
was talking about in the beginning where
you never know what happens i mean
you're following instructions and
suddenly things break and that's what
happened in this case so this is one of
those things where it's so fluid that
it's um
this might be fixed in the next day or
two after i'm done with the video or
there might be a new set of instructions
that are not yet posted up so sorry to
disappoint but i don't have that
information right now if you are curious
about that let me know in the comments
down below and i'll follow up now next
is pytorch another popular library and
it's one that i personally use so how do
we install it we go to this page and
install and this is a nice little picker
for how you want to form your
installation package so first you select
the pytorch build and right now the
nightly build is the one that's apple
silicon compatible this one will run but
it's going to be slow
the nightly build is the one that
currently has apple silicon bits in it
to make it performant so that's the one
i'm going to select my system is mac the
package manager i use is conda that's
pretty selected language that i use is
python and the compute platform notice
all these are crossed out because
i'm on a mac if i selected linux those
would be available or windows but on a
mac you can't use cuda so default is
selected and it gives you this nice
little command to run so i'm going to
run that command to do my installation
but first i want to create
a new
conda environment so conda deactivate
and let's see if it's in my history here
condo create pt1 pi torch1
activate
pt1 and you can install python in here
now you could also just create an
environment with python already
installed using one single command but i
haven't done that here now that that's
done i'm gonna paste this command in
here conda install pi torch torch vision
torch audio dash c pi torch nightly and
this will get all those packages
installed and set up for me oh
this was working last week now this one
is also in flux because looks like one
of the packages was moved torch audio is
not available but it did install the
rest of the packages so to get the
latest make sure you check the
documentation check for any updates this
is a video obviously so videos kind of
stay static and after a month or two
months or a year the general
installation steps will probably still
be the same but the specifics might
change the urls might change the
commands might change so keep an eye on
those pages for the latest documentation
all right this was a long one and
hopefully it was useful valuable
informative if it was i'd appreciate a
thumbs up and consider subscribing maybe
we'll do more long tutorials like this
for other things all right
see you next time
[Music]