alright in this video what we're going to do is set up the Android SDK to run from
the command line now this is actually for mac users so if you're running on a
Mac do watch this video as we go through when and show you how to set up the path
but for Windows users the previous video was for you and linux users don't bother
with this video but go to the next one and other reason you want to do that is the
commands are slightly different depending on the operating system so if
you're on a Mac you're in the right place let's continue
alright so I'm going to digress slightly and set up the computer to access things
like this sql lite command-line interface so that you can enter sql
lite commands on your computer now this will also allow us to use the Android
debug bridge or adb and we'll be using that later in the course now you may
have noticed that when you run your apps from android studio you sometimes see a
brief message pop up saying waiting for adb now this comes up as a android
studio starts the adb server on your machine and checks that there's a
physical device or emulator that it can connect to now the android debug bridge
is extremely useful that's what ADB is for managing android devices and is the
way that Android studio and installs and runs your apps now because android
studio knows where the Android SDK installed on your machine it can use
tools like the sql lite command-line interface and the Android
debug bridge adb with no problems but for us to access them directly
we have to actually add the Android SDKs platform tools directory to our
computers path so this video is going to show you how to do that so
the first step that we need to do is to see if the paths already set up i've
got android studio started as you can see on the screen here now and you can
either open a project that we worked on previously and if you go in to do that
open the project and click on file and select project structure
alternatively if you're on the welcome screen as i am an Android studio just
come in here click on configure and click on sdk manager
either way should get you to the same screen and what we're looking for is android
sdk location and you may see that if you click on file project structure you need
to click on sdk location
to see the screen the bottom line here that this is where the Android SDK has
been installed by Android studio so we need to actually take a copy that and
copy it to your clipboard and then we are going to be pasting it and modify
that so I'm just going to come here and click on it
select it right click now if right click doesn't work here so do a command C
to copy and then I'm just going to open text edit just going to type text
edit go to applications if you want to and do it that way
click on new document we're just going to paste in that path and you can see
its users timbuchalka library android sdk with forward slashes now almost
certainly your location is going to be completely different to mine and that's
ok if you copied it from Android studio like I did it will be the correct path
to whatever the android studio is installed on your computer
now adb and the sql lite both live in a folder called platform-tools
within the sdk folder so we need to add a slash platform-tools to the end
of this path that I have paste it into text edit i'm going to click on to the end
/ and i'm going to type platform making sure I type in lowercase dash tools no
extra spaces at the start or at the end it's important that they're the same and
once I've done that i'm going to select whole path again i'm going to do another
copy
I've done a command c which you can either right click and select copy
if your prefer so we now got that in the clipboard and what we need to do is go
and open the terminal window to make this change so the quickest way to do
that is just to click on the little magnifying glass over here and type in
terminal and I could have actually just a command space as well either will bring
up this screen and type terminal that will open up this little window you can see
here and just zoom a little bit better so a little bit now so you can see a
little bit better and the commands you want to type now are touch...
....
....making sure you've got exactly
the same capitalization that you see here basically all lower case we're
going to type...
and should fill in the rest of us automatically I can press tab again or type
pr and press tab gives us the full names we can open that file now press
enter there may or may not be contents already in here so if there is you want
to go down into the last line but in the case of my file it's actually empty so
what I'm going to do is I'm going to type in export....
....
....then we need to paste in the Android SDK path that we
copied into the clipboard earlier i'm going to paste that in there now then
put a double quote in there and other thing was you notice i put a colon
not semicolon but a colon after the word path and before the path that I pasted
in and you can see we've got a double quote around both of them as well alright
so we can actually save that now so i'm going to click on file and select save
and normally you have to log out for the changes to take effect but there is
another command we can use which will actually get the system to read
those changes that we've just added to that file as we can come back here back
to our terminal we can type in source....
....will be enough and press tab and give us the rest of the name press enter
and if you haven't got any input back that normally means that things have
worked and it's been updated for us automatically if you get some sort of error
make sure you go back and check that you've typed in exactly as you seen me type it
in here in my case it seems to have worked
we haven't got any errors so there's two things we can do here we can just type
in adb lowercase press ENTER and we're getting an error there so I'm just going
to see what I've done here going to type in sql lite 3 and whether
works and sql lite three is working i'm not too sure why adb's isn't working
but the main one that we wanted to get working here was that sql lite so that's
great that's actually working let me just go back and see what's going on
again
going to type .quit and I think what probably happened here is I've set up a
virtual machine for this copy of osx because i wanted to show you what it
would be like setting up a path without having set up previously in my
development machine it has been set up so i think i haven't actually install all the
tools developer tools correctly the bottom line here is that you should
find that when you talk in ADB you'll find that it does work and in any event
the main thing was that in this particular section of the course we're
looking for the sql lite 3 and that definitely worked as you can see
their so consequently i'm happy to say that this is working and you'll find
that this should work for you when you actually do the similar thing and you
probably won't get this error with the ADB and that's because you've downloaded
and installed the android software development kit correctly which i
haven't completely done here alright so that's basically what we need to do at
this point we've confirmed that we've got the sql lite 3 in our path
and that means that in future videos in this section we're going to be able to
use this to start manipulating databases creating databases and adding columns
and rows etc so let's start working on that in the video after the next one
because the next video which is one you want to skip now relates to getting
this set up on a linux machine so skip that video and move on to the video
sql lite