How to build an APK file in Eclipse?
Solution 1
When you run the project on the emulator, the APK file is generated in the bin
directory. Keep in mind that just building the project (and not running it) will not output the APK file into the bin
directory.
Solution 2
For testing on a device, you can connect the device using USB and run from Eclipse just as an emulator.
If you need to distribute the app, then use the export feature:
Then follow instructions. You will have to create a key in the process.
Solution 3
There is no need to create a key and so forth if you just want to play around with it on your device.
With Eclipse:
To export an unsigned .apk from Eclipse, right-click the project in the Package Explorer and select Android Tools -> Export Unsigned Application Package. Then specify the file location for the unsigned .apk.
Solution 4
The APK file is in the /workspace/PROJECT_FOLDER/bin
directory. To install the APK file in a real device:
Connect your real device with a PC/laptop.
Go to
sdk/tools/
using a terminal or command prompt.adb install <FILE PATH OF .APK FILE>
That's it...
Solution 5
Just right click on your project and then go to
*Export -> Android -> Export Android Application -> YOUR_PROJECT_NAME -> Create new key store path -> Fill the detail -> Set the .apk location -> Now you can get your .apk file*
Install it in your mobile.
sean
Updated on July 10, 2022Comments
-
sean almost 2 years
When I develop the project using Eclipse, the APK file goes on the emulator. But I want to upload my application to a real device. Is there a tool to build an APK file?
What is the process? Or is it possible to pull the APK file from the emulator?
-
Computerish over 13 yearsRemember that that APK is not signed with your developer private key, so you shouldn't distribute or or upload it to the market.
-
sergzach over 12 yearsSo, and if we only would like to build it but not to start a noisy emulator?
-
sarnold about 12 yearsAn anonymous user attempted to edit this post to include a note that this mechanism of getting an
.apk
file will get a debug build. If you want a release build, follow Sarwar's answer instead. -
Admin about 12 yearsand where is that bin's location ?
-
Salil Pandit about 12 years@sergzach set run to Manual and when you hit play it'll list applicable devices / AVDs as soon as you have done this, the APK is created - you don't actually have to fire up the emulator. That said, sarnold is right Sanwar's answer is better for releasing the app.
-
Jarl over 11 yearsThis seems like a good answer. However android lint errors prevent this from working... The standard "Run" action somehow succeeds in generating the apk file even with android lint errors.
-
shim over 11 yearsWhat if you want to distribute to beta testers?
-
Sarwar Erfan over 11 years@shim: just give the apk files to beta testers. Or, host the apk files somewhere and give the url to the testers.
-
Rob Von Nesselrode almost 11 yearsadb has moved to the directory "platform-tools". Not sure from which version of the SDK
-
talha2k almost 11 yearsI think you swaped the methods by mistake.
-
andy over 10 yearsto test this file, connect your Android device and type in commandline: "adb install ./myApp.apk"
-
Francisco Corrales Morales about 10 years-1, reason: Yeah, but this question was about 'building an .apk from Eclipse', not how to test an .apk app
-
Francisco Corrales Morales about 10 yearsWorks, although it make the .apk even if there are errors (compilation, ...) which could be a bad or a good thing.
-
L. D. James about 10 yearsThe question was very clear of how to get the apk that he already has into a "real device". While all the other building, signing, and publishing suggestions are good suggestions, he can very easily get his apk that he already has in his emulator by downloading the current "apk" from his project sub-folder.
-
webgenius about 9 yearsThanks for sharing. this is good enough for initial testing of the shared apk.
-
kpninja12 over 8 yearsThank you! That was driving me crazy
-
zionpi over 7 yearsthis solution makes eclipse collapse too often,is there a
script
approach ?