How to create project installation done on android studio

Asked

Viewed 338 times

2

I created a project in Andoid Studio, run it on the right virtual machine, now I would like to "compile" it to install on a real phone.

How do I do it? I create a file and step into the mobile? I have to put in Google Play?

2 answers

4


You’re probably using a build tool to take care of your project. Because you’re using the AST, I assume you’re using the gradle as your build tool.

So let’s put parts to understand a little more.

Overview about the build tool

The Android build system is the toolkit you use to build, test, run and package your apps. The build system can run as an integrated tool in the Android Studio menu and independently of the command line. You can use the build system resources to:

  • Customize, configure and extend the build process.
  • Create multiple Apks for your application with different features, using the same design and modules.
  • Reuse of code and resources between source sets.

A deeper look at how build works

The build process involves many processes that generate intermediate files on the way to producing a .apk. If you are developing in Android Studio, the complete build process is done each time you run the task gradle build for your project or modules. The build process is very flexible, so it is useful, however to understand it is necessary to know what is happening under the whole compilation process, and see how it is configurable and extensible. The following diagram describes the different tools and processes that are involved in a compilation:

The build tool merges all configured resources, build types and dependencies.

Output do Build

Build generates an APK for each build variant in the folder app/build: the directory app/build/outputs/apk/ contains packages called app--.apk; for example, app-full-release.apk and app-demo-debug.apk.

This is your . apk to run on a device and test.

  • C: Users Silvio Androidstudioprojects Meuprojeto app build outputs, is this folder sequence where . apk should be? don’t have the app folder, should I do something to appear? Gradle build when starting the studio, but does not create the file.

  • "no app folder" meant: no apk folder.

  • You have Gradle installed on your machine?

  • Yes, it does build, I was able to find the files after "startei" the virtual machine, only it doesn’t have the same name you put, they have the following names: "app-debug" and "app-debug-unaligned". Are you right? these can already be installed? or do I need to make the definitive?

  • The app-debug.apk is the default when you don’t overwrite in the buildTypes section. But yes, you just play that . apk to your mobile and install there. Android Studio also has an option for you to move up the project by running and connecting your device to your machine, so it is an automatic process, without you having to manually send the . apk pro device.

0

No, you don’t need to put it in the Play Store. Just do the following:

Take the phone you would like to install and activate the USB debugging (USB debug) option that you usually find in Settings > Programmer Options. Having activated this option on your phone, connect the phone using a USB cable and then, in Android Studio, when you click Run, your phone will appear in the list, then just select it and wait for the end of the process!

I hope I’ve helped!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.