Hi and welcome back.
Today we're going to be exploring how to install Fastlane on your computer so
that you're able to upload applications for test flight.
Great. So we're gonna go to Google Chrome
and we're gonna just search Fastlane React native.
And here we should see the Fast Lanes website.
Let's open that up.
It should be also linked to your resources on this video.
So please, that up.
Now let's go to distributing beta builds
with Fastlane on Android and iOS and start following this documentation.
I'm going to make this window smaller.
I'm going to open up my terminal and I'm going to start setting up.
Now, this documentation clearly says that Fastlane will not work on Windows PC.
I don't think any of the students here are
using Windows because in the beginning of this course, I mentioned that we're
going to be heavily relying on the tools that Mac offers to us.
And now let's start by installing xcode command line tools.
Honestly, I already know that this is installed on my computer.
So this is not going to go through.
It might already be installed for you as well.
So if it is, that's okay.
Just let's continue on.
Otherwise, just wait for it to complete.
And now let's install ruby using homebrew.
This is also installed for me, for you.
It might ask you for a password and it might take some time.
So it did some updates as I see on my computer.
Now we want to install Fast Lane,
and this is also installed on my computer, but just I'm going to run it with you guys
and you should do so as well and wait for it to complete.
I'm going to enter my password. Great.
And let's see what it does.
So it actually started reinstalling my Fast lane, which I'm totally fine with.
It's going to go through and come back to the video once you're ready.
Great. So the installation has been completed.
So we do have access to Fastlane.
And what we want to do right now is make
sure that we are all set with our prerequisites.
We should have Xcode nine or higher
because at the time that I recorded this video, code was already on version 14.
So we're all set with that.
Now I have to choose Bundle Identifier.
And this Bundler Identifier has to be something unique.
Now,
I'm pretty sure that the Bundler Identifier that we have
previously used for our project is taken up.
So let's create something better.
Now I'm just going to go to my X workspace file inside the code,
and then I'm going to change the Bundler Identifier.
So just click here on your main donation application.
If you don't see it,
just make sure that you're in this folder here, and then click on your donation app
and then General, and then locate Bundle Identifier.
Once you click that,
you're going to be redirected here and you can change your Bundle identifier here.
Now, we might face some issues with the Firebase setup that we have,
but let's ignore that for now since our goal is to upload an application
on Test Flight and let's go on and change our Bundle Identifier. For that,
I'm actually going to use something that I
definitely know is not going to be used, which is com.DonationApp.vache maybe.
And I don't think anyone will have this Bundle Identifier, so it should be unique.
And once I do that,
we do have the Bundle Identifier already all set, and we need to create our app
name or Fastlane can create it for us, but let's do that for ourselves.
So let's just go to developer.Apple.com and then let's go
to our account and let's click on Identifiers.
Actually, you'll see one here because I tried to create
something for our application already, but just ignore that and let's create
a new one and have your App ID selected here.
I'm going to click on App and here I'm
going to enter the same Bundler Identifier that I had here.
So I'm just going to copy this.
I'm going to paste it here and I'm just going to say Donation App here.
Now let's see what are our choices here?
I think push notifications might
automatically be enabled with our Firebase set up.
So let's make sure that we check this off so that we don't have any problems.
Otherwise that's fine.
If we have this checked off, shouldn't be a problem.
So let's just continue and click on Register.
And now we have a new bundle Identifier here.
So let's just make sure that we enable
push notifications here just in case that could be done with signing
capabilities here and then adding a new capability.
Let's search for push notifications,
double click it, and it should be added right here.
Great.
So once we're done with that, let's go back to our Developer account
and then let's click on Applications and create a new application.
So I'm going to select Platform iOS.
And here I'm going to name it as AltruDonate.
And this also has to be unique, by the way.
I'm going to name it AltruDonate.
And then the primary language is going
to be English and the Bundle Identifier that I have created is present here.
So I have to choose this.
And then SKUs also have to be unique.
So I'm just going to go with my Bundle Identifier here as well.
And I'm going to say that I have full access and create this.
Great. So once we do that,
here is our application and here's our Test Flights tab where we
have no builds uploading, which is totally fine.
Now let's go stack to our fast lane
documentation and make sure that we follow the rest of the setup.
So we do have the Bundle ID already and we
have our app name and we need to use the Git ignore file inside iOS directory.
So let's just click this and open it in a new window.
Copy the contents of this file,
go to our webstorm project, and then what we want to do here is make
sure that we have a new file we .gitignore.
And I'm going to paste this here
and make sure that it's formatted as I want it to be.
I'm a format freak. Okay, great.
So let's save this.
And now we have the git ignore file.
Let's go back to the documentation and read what they need.
So we do have the app icons and oh wow,
they actually suggested the website that I used.
So that's great.
So we have the app icons.
So we're going to be all get we shouldn't get any errors because of this.
And now in the general tab identity
section of the code, the general tab identity,
they're saying change the bundle Identifier to your Identifier.
It's already changed.
And then in the Signing Capabilities tab,
we should disable automatically manage signing.
So I have disabled that.
That's totally fine.
And the in the Build settings tab,
you should select all in combined, which I already have selected.
And then we should scroll down to code signing.
And then we should make sure that for debug, we have Apple development
selected, which is right here and selected.
Okay.
And then for any iOS SDK, Apple development should be selected as well.
And then for relieve,
it should be Apple distribution and Apple distribution here as well.
Great.
We have set up this correctly and then we need to initialize the fastlane.
So to do that, we are going to open our terminal.
We're going to navigate to our project.
For me, it's located in the desktop and then iOS folder.
Whoops, I misspelled something.
I should have donation app here. Great.
I'm going to clear this terminal.
So that what we're going to do is going to be clearly visible to you.
And then I'm just going to do fast lane init
and this is going to start executing.
Great.
And we're going to say that we're going to use this for test flight automation.
Say that our choice is two and click
on Enter and then some new files are going to be generated for us.
But before then, let's enter our Apple username.
Okay, this is my username.
I'm being logged in and now some dependencies are being installed for me.
So just press Enter anytime it tells you to continue by pressing Enter.
And now our setup is done.
If I go here, we're going to see that new
folder has been created for me with this fast lane setup.
And then what we want to do is make sure that we finish this up correctly.
Now we need to set up code signing.
And I don't want to go through this documentation because it's actually much
bigger headache than what I'm going to suggest for you.
So just follow me, please.
We have already generated app id and since
we have done that we're going to need to set up our provisioning profiles.
This is one of the things that this
documentation also suggests, but for that you're going to need GitHub.
Okay?
So in the previous video we already went through how to create your GitHub profile.
And now what I'm going to do is go to my profile and then go to repositories.
And here I'm going to create a new
repository and I'm going to name it DonationAppCertifications.
Great.
So I'm going to make this private to do so as well.
Sure, I can added a readme file automatically.
I'm going to create this repository.
Okay, so now this is created and then we
need to make sure that we have access to our GitHub from our terminal.
And to do that you're going to have to go
to your settings and then click on developer settings right here.
And then go to your personal access tokens and the tokens and generate a new token.
And I have to enter my authentication here.
I'm going to do that right now.
So let's give this donation application
token and I'm going to set expiration date to 90 days.
Who knows what I'm going to need it for.
And then I'm going to make sure that I have access to all of my repository.
And I'm going to set up repository permissions here.
And inside the repository permissions, I'm going to give the highest access
that I can give to myself in all of the values.
Please do so yourself as well.
I'm quickly going to do this.
Right now I have selected highest possible access that I can have on everything.
And then what I'm just going to do is generate this token.
And once this token is generated, you're going to see it for one time only.
So make sure to copy that.
And once you copy that,
we're going to have to change up some things in our terminal.
So let's go to our terminal and once you have that token, let's try to
clone our GitHub project and see how we can verify ourselves.
Okay, so let's go to our profile here and then let's just clone this project.
For example, so you would copy this command here inside the clone and you just
say clone and now it's going to ask you for your username so just enter it.
But for password, which is very important, make sure that you enter the token that we
just generated because otherwise if you just enter your GitHub password,
this was deprecated so you're not going to be able to login.
So I'm just copy paste it.
My token is not visible and it's not going to be visible to you either.
So once you do copy and then paste, just click enter and great.
Now I was able to clone this project so
now I'm authorized to use GitHub as I please, which is great because we're going
to be really needing it for our fastlane setup.
Right now we should start using Match
by running the following command inside the iOS folder still.
And we're going to use fastlane Match init for this.
And here's where we need our GitHub.
So we're going to need a storage and for storage I wanted us to use Git.
So now I'm going to select one and I'm going to say enter and it's going to ask
me for the URL of GitHub repository where this should upload the file.
And if we didn't give a permission
and a token to our terminal to access our GitHub account, this throw an error.
So that's why we needed it.
Go to our profile and then go to the certifications that we just created.
And I'm going to copy the URL of this
and paste it here and then click enter and great.
So the Match file was created.
Right now this is a new file that was created and it has access to our donation
app certifications which is exactly what we needed.
We can start generating new certificates
and profiles using Match in order to deploy our applications.
To test flight, we're going to need iOS distribution certificate.
So to create one, just run this command.
I'm going to clear the terminal and I'm
going to run Bundle Fastlane Match App Store.
You can actually run this without Bundle exec in front as well.
So now we're going to need test phrase for Match storage.
This can be anything that you want.
I'm going to enter what I want it to be and I'm going to repeat this here.
And great.
This was successfully created and now the profiles are generated for me.
The provisioning files are installed.
Let's see, this has just been updated and new Master Branch has been created.
So if we go into Master Branch we're going
to see all of the distribution and App Store credentials created for us.
So now that we have this created, what we need to do is make sure that we
include our provisioning files in the Fast file.
So let's just go here and say that we need
sync code signing to the app store
credentials that we just created.
So type appstore.
Great, now let's save this and we have
this set up and then there are new rules to the applications as well.
So we're going to need to do some kind of other setups as well.
Inside the Fast Lane folder, just create a new file and call it .env.default.
And once you do that, we're going to create some configurations here.
First of all, the configuration that we're
going to need is going to be Fastlane user.
So here, just enter your apple ID.
This is my Apple ID
and the you're going to need Fast Lane
Apple application specific password.
And to get this password you're going
to have to go to appleid.apple.com sign in using your Apple ID.
I'm going to do the same. Great.
And now we're going to generate app specific password.
So let's just click on this and donate is the application.
Here. You're just going to enter your Apple ID's
password and then you're given app specific password that you can use.
So just copy and paste it here. Great.
Once you do that, you don't need this file anymore.
Everything's set up for you and the we're going to make sure that we can log
into our fast lane, fast lane
spaceuth -u and then your Apple ID here.
This will generate a cookie and then just say yes and you're done.
We should make sure that we have one more setting set.
Because of this particular project setup,
we're going to need to update our info plist file.
So that should be inside iOS folder here, inside the donation app.
Locate your info pill list file here.
And we're going to have to add one more key here.
And I will tell you what that key is.
It should be NS camera usage description.
And here we're going to give it a string value and we're going to explain why we
are using camera permissions from the user.
The thing is that one of the packages that we have installed comes
with the camera usage, even though we're not really using it.
So we're just going to say to the user that we don't need access to camera.
So I'm going to clear the terminal again and let's do fast lane beta.
So I just got an error.
Let's see what error I got.
So it requires a provisioning profile with push notifications.
So let's go to our Xcode donation app and then signing capabilities.
And here inside the provisioning profile,
just select your Match App Store donation app and then try to rerun this again.
I'm going to close this,
going to clear my terminal and I'm going to type fast lane beta.
Right, so now our application is
in the running state, which is in some terms a success because
it is preparing a build that could be uploaded to Test Flight.
And after this we're going to see a Metro bundler open up, hopefully.
And our application is still going to be in the building process.
And once that's done, Test Flight should start asking us for our
credentials so that we can upload our application here.
Great. So now the Metro bundler opened up,
which means that our application is still being bundled up.
After this step
it might still take a bit to upload our
application to testflight, but this is already a very good sign.
So just hold on and be patient.
Here it says that we're uploading
the updated app to the App Store Connect, which is this screen displayed here.
And it might take a few minutes.
Don't interrupt the script.
So don't interrupt.
Wait for it. Great.
So we see this message appear here.
Now it says waiting for the build to show up in the build list.
This may take a few minutes and if this
persists check your email for processing issues.
Now you're going to see this message appear from time to time.
I think it's every 30 seconds or it's
every 1 minute, I don't remember it exactly,
but yes, please go to the email that you have set up for your Apple ID and wait
for the confirmation or any issues that come up with your upload.
And meanwhile, you can actually reload
this page and you are going to see build number three processing.
This is because I tried multiple times
to upload this build and the build number increments itself.
So this is my third try to upload
the build and we're going to see whether it processes or not.
If it processes and it goes through successfully, the we are going to see
the app icon appear here and we're going to be able to share this build with people
that are using Test Flight so that they can try out our app.
Otherwise we're going to receive an email
regarding the issues that we got and we're going to try to resolve that.
And this is a normal process and Apple is very picky
with what you upload, they can look into your app with their
automated system and determine any updates that they need from you for this
application to be acceptable for Apple's App Store.
Great. So right now we didn't receive any email
and the processing of the new build is being finished up.
This is great.
I'm so happy that we are going through this process so well.
Here we see our app icon update already as you see.
So let's wait for this to complete. Great.
So our application has just been uploaded,
so fastlane tools just saved you 27 minutes.
So we spent 27 minutes uploading this automatically.
Subsequent ones might be quicker and 27
minutes might not seem as big of a time saved to you.
However, this is a deployment process that can be done automatically and this is
something that many companies use out there.
It's better than generating builds yourself
and having to manually upload it because it's just less human errors.
So this is great.
We have just uploaded our application to Test Flight.
If we refresh this, we're going to see that the build has been processed.
It can even be submitted to the Apple Store to be reviewed
and public, but before then you might have to enter a lot of information.
We're not going to be releasing this application to public,
but in the next video I am going to show you how to share this with some of your
friends and how to create an internal testing group.
But that's all for today's video.
Reach out if you have any issues.
I am definitely going to try to help you.
And thanks so much for watching and I hope you have a great day.