Advanced Godot | Exporting To Android in APK and AAB (2021)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys this is mitch with fine point cgi and today i'm going to talk to you guys about how to export from godot to android now i know i've already covered this topic i want to say probably six to eight months ago but a lot has changed since then so back when i created the tutorial i was about 3.1 was the good old version and now we're at 3.3 where they completely changed how you export out to godot also one of the big major changes is google is enforcing its aab format restrictions instead of apk now i never showed you guys how to do that so i'm going to go ahead and show you guys how to do that today so basically we're going to go through the process of installing android studio setting up open jdk we're going to go through the process of setting up godot export we're going to talk about aav format and apk format and the advantages disadvantages even though it doesn't really matter because google's disabling support for apk anyway but it's still a good idea for me to talk about it and finally we export a release candidate of a project and send it out to google console and have it streamed to our phone so that's what i have in store for you guys today so let's go ahead and get started okay so the first thing you're going to do is you're going to want to download android studio so go ahead and click on that we're going to go through the terms and conditions basically they say hey they're not liable to anything that you um do with this application and it's not liable for any if the application crashes your computer pretty much so go ahead and agree it and download um android studio so go ahead and pull that down and while we're pulling that down we're also going to pull down adopt open jdk so we'll go ahead and pull down the latest release of eight and we are going to grab the hot spot version it really doesn't matter which one you choose hot spot is better on memory and open j9 is slightly faster to be honest with you i don't think it really matters that much for this case so let's go ahead and just pull down the hotspot version so we'll go ahead and pull this down as well all right we're going to go ahead and open up our downloads folder here and you'll see that we have adopt open jdk here so we're going to double click on that and go ahead and install it now in my case i might already have it installed but let's see we are going to set our java home variable so go ahead and change this here to set java home variable that way it go ahead it goes out and actually sets your variable for you so we don't have to do that manually let's go ahead and click next and click install and you'll see it's going to run through its installation process while we're still downloading our android studio all right so now that we have that we're going to go ahead and click finish we are going to double click on our android studio and the reason why i'm choosing android studio i know you don't have to use android studio but if you're going to do any android development at all inside of kedau you really should just have android studio it makes everything simpler and everything easier to use than if you do it all manually so you might as well just use it so go ahead and click next android studio and virtual device that's fine go ahead and click next install all right so now that that's installed we're going to go ahead and start android studio now the reason why you want to start android studios there's going to be a lot of really cool things that android studio is going to do for you automatically to set up your development environment and also having android studio fully set up is always a good idea because it allows you to test your products and your games inside of an emulated environment if you need to so it's going to come up and say hey do you want to import any android settings no i don't want to import any android settings and it's going to go ahead and try to boot up it's going to ask if you want to do data sharing i'm not going to send my statistics to google now that we have android studio open we're going to go ahead and click next and we are going to do a standard install so let's go ahead and click next i'm going to go ahead and pick the dracula theme if you want the light theme you can i'm going to go ahead and pick the dracula theme go ahead and click next and these are the things that are going to get installed so we're going to have stuff like android emulators a sdk build tools sdk platform um the google adam our intel atom image and the sdk patcher and things like that so let's go ahead and hit finish and it'll go ahead and download our components so i'll see you guys in a moment okay so now that the installation and com the downloading is completed we'll go ahead and hit finish and then you'll see that we have android studio here so that's perfect the first thing we're gonna do is we are going to go ahead and close android studio and we are going to go and double check to make sure that some of our stuff got installed correctly so we're going to go to this pc c users in this case user but it depends on whatever your username would be let's go ahead and click on that and then we're going to go to app data but you'll see that app data doesn't actually exist here so what we're going to have to do is we're going to show it so we'll go to view and hidden items and we'll go ahead and check that and you will see that now app data shows up so we'll go into app data local and then android sdk and then we will look to see if platform tools are here in which case platform tools is here if we double click on that we'll see that adb is here so that's perfect that's exactly what we wanted and we want to just make sure that the sdk folder has looks like this basically as long as it has this in it we should be good to go and finally we're going to go ahead and open up a command prompt and in our command prompt we're going to type in java dash version all right so if it says open jdk version 1.8 then we are good to go so at this point we're good to go ahead and open up godot okay so now that we're in godot what we're gonna do is we're gonna go ahead and create a quick user interface we're gonna right click add a child node and we are going to add a button and we'll make that just a touch bit bigger something i don't know probably pretty large about that big now we don't need to do this but i'm doing this just to show you the final result so you guys don't have to follow this part but i'll go ahead and save this and call it test scene test export see all right now to get our export to happen what we need to do is we need to come out to editor editor settings and we need to scroll all the way down to the bottom and there's a section here called android see that right here we'll go ahead and click on that and you'll see that all of this needs to be filled in before we can export out to godot so what is adb well that's the that is the android debug bridge so that's how your project is going to be able to be debuggable within godot jar signer is what is going to go ahead and sign any of your java script or i guess i should say script but java code and it's what's going to actually sign your apk debug key store is your actual key store that we're going to have to generate so that we can go ahead and export this out for our phones debug key store is used so that you can export it out to your phone as a debug apk or a r file debug keystore user is your android user that you generated with your debug keystore debug keystore pass is going to be the same thing but the password for your keystore these two should default to the ones that are here if they're not just go ahead and throw them in like this custom sdk build path is actually your sdk path so you can see you have android sdk path and custom build sdk path they're basically the same thing but one is used when you are building a custom build inside a godot and one is used when you are building your android export it's basically there for flexibility so that way you can choose to have one over the other if you have a preference now in my case they're both going to be the same so let's first start with adb so let's go ahead and go to this pc i'll come right over here we'll come down here and we are going to go to see users your name and then since we turned on our hidden items here we can just come down here to app data double click on that go to local go to android which is right here sdk platform tools and then go ahead and find your adb.exe it's right here so i'm just going to go ahead and copy all of that i'm going to paste this slash adb.exe you want to make sure that it matches this right here which it does so we're good there now our jar signer now this one is our oh adopt open jdk jdk jar signer so where we need to go is we need to open up our folder here we're going to go to c we're going to go to program files we will come down to adopt open jdk it's right here we're going to go to jdk hotspot bin and then find your jar signer it is right here so we'll go ahead and copy this location we are going to paste that slash jar oops no capital jar signer oh goodness dot exe for our debug keystore we're gonna have to go ahead and generate this so what i'm gonna do is i'm just gonna go to my top level documents folder i might actually already have one in here i don't think okay i don't could and i'm going to go and hit cmd and that's going to go ahead and open up a command prompt here now let's go ahead and generate our key store so we'll type key tool dash gen key dash v space dash e store debug debug.keystore space stat dash store pass android dash alias android debug key space dash key pass space android dash key alg which is your key algorithm and we're going to say rsa and our key size is going to be 2048 and then for validity we're going to set that to a thousand or 10 000 i'm sorry we go ahead and hit enter it should generate us a key store so in this case it's going to ask us what our first and last name is i'm not worried about it so i'm just going to hit enter through these props because it's not necessary for us to do it for a debug keystore actually i think it's going to force us ah it's going to force us okay so we'll put fine point cgi find point cgi fine point cgi detroit we're gonna say michigan we are gonna say uh us because i'm based in the united states and we will say why all right so what that should have done is if we come out to our documents we scroll down you should see a debug key store here so we're going to go navigate to that key store so you can see here you click on the little open file you peel up one and you should see a debug key store right here in your users documents folder so we're going to go ahead and click open and then we are going to go and add in our custom sdk build path or custom build sdk path now um you don't have to have this if you're not doing custom building but if you're doing anything in android you might as well set it up so there's no sense in not setting it up so what we're gonna do is we will go out to our file browser here we will go out to see users your username appdata local android where is it android sdk and then we're going to go ahead and just copy that location we'll paste it here and we'll paste it here as well that way it is in the same spot for both of them so now if we did everything correctly we should be able to hit close go to project export add android and then we should just be able to export our project out as an apk so let's go ahead and click save and it's going to go ahead and attempt to export so let's see what happens and you will see that the build was successful if we go back out to that folder you'll notice that the timestamp has changed to my current time so 1255 that's perfect that's exactly what we wanted so now let's go ahead and export it out into an aab file so to do that you go to your export menu you go to export format right here and you change your export apk to export aab format so what's the difference between an apk and an aab a apk is an application or android package format which is your entire project packaged into an executable if you will whereas an aab is an android app bundle now this was uh released back in about 2018 or so and it's a very streamlined version of what an apk is so one of the big things about aabs is they're about 15 percent smaller so they're they're a smaller object which is good news one of the other really cool things is it can handle uh google uh play feature delivery which basically gives you the ability to customize which features are delivered to which devices and you can actually say hey uh install this section versus this section depending on the type of phone they have and finally one of the other huge reasons to support this is google starting in august of this year which is 2021 is going to require everybody to move over to their aab format so whether you like the format or otherwise we're going to need to use it anyway so jack support it click aab export project and we can do aab and we'll go ahead and export this out and it should be pretty quick so we'll go ahead and export that out you'll see it's successful and if i go ahead and i open up my android export you will see that the two files are there now that's how you export out an aab file now let's talk about some of the export options here inside of godot so we have some custom templates now you probably will not use these but custom templates are used for custom exporting templates so for instance if you were to say hey i only want to export out um godot without its 3d engine attached you could do that by compiling your own custom template i do have a video on this i'm pretty sure and i'll link it in the description if you guys want to check it out custom build is used whenever you're using custom elements or exporting in aap format which in this case we are export format is used to export out an apk or an aab file architectures are what architecture your application supports in my case i have a set to um the a uh 7a and and 8a formats keystore is if you're using a custom keystore in this case we're not but it will and if you don't specify it it will actually go ahead and just use their your current debug one if you're doing a release you would set your release key stores here and you would just say yep this is my key store here's my user here's my password and it would go ahead and sign it with your release key store one click deploy all this does is it allows you to basically delete your previous install whenever you click on the one-click deploy which if you have your phone plugged in it'll come up up here it'll show a little android icon i usually have this off version code is the version that google reads to determine if this is a new apk so every time you export out an apk you upload to google servers you're going to need to increment this by one so that way google understands that it's a new version now for name this is just a version number for you to keep track of so that people can see in your change logs what kind of changes they are for instance standard software development versioning is major release as a new features that are breaking is your first digit minor releases that add new features is your second digit and then finally bug fixes are your third digit so that's just something to keep in mind package unique name is the name of your project when it gets generated out so this is actually a unique name for when you upload it to your google play store so for instance normally people say org or com or organization or com for commercial dot in my case i'd say fine point cgi dot whatever my app my application or game name would be signed if i want the application to be signed you always want the application to be signed launcher icons is your application's launch icon so if you change this it should show up on your phone with that icon adaptive foreground adaptive background are for when you click on the app it pops up with that background or foreground graphics this is just asking if you want the 32-bit frame buffer or if you don't um for graphic heavy applications it's really useful for non-graphic heavy applications it can be a little bit of a performance drag so that's something to keep in mind opengl debug this is just for debugging the opengl renderer so you probably will never use this xr mode is if you are doing vr degrees of freedom is if you are using the gyroscope hand tracking is well i guess degrees of freedom is if you're using vr and it's using the gyroscope to determine motion hand tracking is if you are uh requiring a hand tracking sensor on your application focus awareness basically allows you to see if the uh application has focus or not so if it's open or not and that is useful only in vr mode screen immersive mode if you want to show or hide your top bar on your um android app support small normal large or extra-large is the screen sizes so small is like four inches normal i believe is five uh 5.2 to 5.5 i think large is like six and extra large is like bigger than six like tablets and stuff uh command line args is if you have any build arguments you want to run apk expansion honestly i've never really used this but basically from what i understand is if you want to expand your apk with different salts or public keys and things like that so if you want to have like special encryption permissions is all of the permissions that your application could possibly need so for instance if you need to get your location you can pull the access fine in course location here so if you need to pull like the user location this would be how you would go about it and there's a lot of them and there also is a section for custom in case you want to have custom versions of them right here you can actually just add in your own resources is how you export so export all resources will export all the resources in this res file exported selected scenes and dependencies means only the selected scenes that are in here will get exported and its dependencies instead of all of them so if you have like test scenes and you don't want them in the final product that's how you would do it export selected resources means you would only export the resources so instead of saying hey this scene automatically has all of these resources you can just pull the resources you specifically need if you want to filter out to resources this is how you do it and if you wanted to filter in resources you would do it this way as well features you'll probably never use it but basically in this case as you can see it's saying this is an android r is supports arm it supports arm it supports etc too and it's a mobile app you can add in additional comma separated features but that's beyond the purview of this tutorial finally script now script allows you to export your application with compiled scripts text script or encrypted scripts this allows you to stop people from breaking in to your application scripts by having them either compiled or encrypted or in text so if you do text there's zero security on your scripts at all compiled compiles them into the exe or into the apk and that can be more secure if unless they unzip it or unbuild it encrypted on the other hand will actually encrypt it with a specific key that it needs to have to unencrypt it this is the most secure way but it is also much slower awesome so that's all of the different export parameters so the next thing we need to do is we need to export out our project as a released project so to do that you need to get a release key store here so you can see there are three little options here now to get a release key store we need to actually create this key store the reason why you need to use a release key store instead of a debug key store is because when you build your release version of your application you need to distribute it on the google play marketplace and when you build in i guess debug mode with the android sdk using a debug key store the sdk actually signs it saying hey this is a debug key and when you uh install it on your machine it doesn't check if it's a valid um publisher or anything like that but when you generate it with a release key tool or key store you can put it up on the app store because it is registered to you as the developer so to go ahead and generate it let's open up our command prompt here where we've previously had it and let's go ahead and generate our release key store so to generate a release key star we need to call key tool space dash gen key dash v dash key store and we're going to call it find point demo dot key store dash alias find point cgi and we are going to say dash key algorithm is rsa dash key size which is going to be 220 48 and then validity is going to be 10 000. i made a mistake where did i make my mistake ah i spelled key wrong i knew i did something wrong here all right now you got to enter in a password now this is very important that you remember and write this password down now in my case i'm going to put password but you definitely should put something really secure in here like go ahead and generate a cool password and save it somewhere because if you just make it something like password and somebody guesses it then they can have access to your application so for first and last name i'm going to say five point cgi for name of organization city i'm out here in detroit michigan united states yes now this is going to want you to get a password for for your alias and i'm just going to make it the same so you could probably just hit return return but i just re-put them in just in case so now that we've generated this we can go out into kadeau here we can go release click on this little file icon come up to our documents folder here and you will see our find point demo key store so we'll go ahead and open that we'll say find point cgi and we will say password so now if we go ahead and export our project with out you can see here export with debug if we pull that out now i can release my aab or my apk as a release version of it now one of the things that you have to know is if you're doing an aab file you have to upload it to google console right to the console app store to be able to download it and use it on your phone but if you're just testing on your phone you can generate out an apk and do your testing that way but any release that you have must be generated with a release key store because google needs to verify that this is a released application if that makes sense so if we go ahead and we open up our res folder you will see right here our a a b file and our apk file are right here so everything exported okay so now if we go ahead and we look at play console here so let me resize this for you guys so you guys can see what i'm talking about here so you can see a bunch of my apps that i've built over the time as i've been doing like tests and things like that but if i go ahead and i create an app and i call it export demo aar let's say app it's free yeah yup it's fine just let me upload my stuff so it's going to go ahead and load my google play console and i am going to release my app early without testing review now i already have an email list you probably don't so you can go ahead and click create email list but in my case i already have one and we are going to go ahead and save our changes we're going to go to releases we're going to create a release and then we are going to continue on play app signing and you will see down here it says hey drop app bundles here to upload now this is where your aab comes in handy right here if you drag this in here it will upload it all right so now that it's been uploaded i'm just going to call it release name one is fine save it and then i'm going to review my release and i am going to see i have a few warnings here saying hey your app bundle has this extra data in it that's not a big deal let's go ahead and roll it out so click on start rollout for internal testing here so if you click that you click roll out that will allow you to go ahead and download this application so now if you come to testers and you go to copy link here and then you open up a new tab and you paste it it will say hey you've been invited to work on this fine point cg i'm missing the i but that's okay android export aab unreviewed yeah i'm going to go ahead and accept that invite i'm totally on board with my own application it says hey you are ready to download it on google play so i'm going to go ahead and click on download and you will see that there is a org dot fine point c g because i miss made a mistake and then we'll go ahead and click install it's going to get sent over to my google pixel 3 and then you're going to have to log in now i've already uh blocked this out for you guys but just go ahead and log in with your google account and then it's going to say hey it will be installed on your device soon okay so you can see that android export has shown up on my app drawer so that's one of the cool things about the aab system is that you could just throw it up into internal testing and it'll get streamed to your phone or any tester's phone that you want to send it to so what i'm going to do is i'm just going to go ahead and open this application and you will see that the application has crashed and the reason why is we never set our scene to be the correct scene so if i hit this little play button you'll see hey no see no main scene has has been defined would you like to select one yes i want to select my test export scene so now that i've done that if i go to project export and i increment my code to 2 i export out my project and i export out my aab file and while that's exporting let's go ahead and go out to our release track here let's create ourselves a new release and let's say that we have some bug fixes now normally i would have shown you guys this beforehand i would say hey pick a scene and all this stuff but this is important for you guys to know how to do a new release so let's check our android it's been our godot and it's been exported so we're going to go ahead and go back to our release here we are going to open up our aab file here which is 437 that's correct so let's drag that in here and let's go ahead and re-upload it all right so now that we have that we're going to hit save and you can of course change your release details if you'd like but in my case i'm okay with it we're going to review our release and then we're going to go ahead and roll that out to internal testing and then we are going to go back over to testers we are going to copy the link like we did last time we'll paste it and go ahead and download it on google play click on installed we're going to need to re-log in like we did last time so you'll see that here and it's gonna say hey it will be installed on your device soon so now at this point we're just gonna wait for a few minutes and then we will reopen up our android export demo and now that it's on my phone we'll go ahead and hit android export and you will see everything pops up like we had us we have the button up here and we have everything that we were looking for so that's really all i have for you guys today so we went over how to set up your android dev environment so we installed android studio installed open jdk we set up godot to uh go ahead and export out to android we set up our scene a little bit we also uh showed how to export through aab format and we did an apk format export as well and we talked about the advantages and disadvantages of both different exporting formats we also talked about how google is going to disable support apk files so we're going to be moving to the aap format regardless finally we exported this out to our phone and created a small tester app um or release track for our google console and we verified the results on our phone so if you guys like this video go ahead and hit that like button if you dislike this video go ahead and hit that dislike button because i am here to make content for you guys now this was a viewer request and as usual i always like to hear about new viewer requests so please if you have any ideas or any suggestions throw them in the comments below because i would love to take that feedback or take those ideas and make them into videos and make my videos better so anyway guys that's all i have for you guys today thank you so much again for watching i'll see y'all next time [Music] thanks [Music] you
Info
Channel: FinePointCGI
Views: 5,214
Rating: undefined out of 5
Keywords: how to export to android in godot, godot android export, godot export android, export godot to android, godot export to android, godot 3.2 android export, godot how to export to android, export godot project to android, how to export from godot to android, how to export your godot game to android, godot android, godot android tutorial, godot to android, godot how to android, export to android, how to export to android, android, godot engine, godot tutorial, godot, export
Id: WQFM9m88T60
Channel Id: undefined
Length: 37min 7sec (2227 seconds)
Published: Mon Jul 19 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.