Reputation: 143
Why my .apk in bin folder are disappearing when I close my emulator and cleaning project and it appear again when emulator is open? I don't know when is the safe to copy the .apk file.
Sometimes I installed apk file without problem in my Phone somtime NOT.
Upvotes: 0
Views: 102
Reputation: 1274
Are you using Eclipse?
There are a few important settings:
a. Window > Preferences > Android > Build > "Skip packaging and dexing until export or launch" - if this is selected, APK is only generated when the application is launched onto a device/emulator.
b. Project > Build Automatically - The project will automatically be built after changes in the code
c. (only if b is not selected) Project > Clean... > "Start build automatically" - When you do a clean, a build is also done.
After every clean, the APK will disappear.
If setting (a) is checked, any time your project is cleaned or rebuilt (after a manual/automatic build) the APK may be removed. The APK is generated when you launch the application onto the emulator/device.
If you want to create an APK without launching, uncheck (a).
In summary, if you want to store your APK do the following:
Upvotes: 0
Reputation: 40337
While it's true that the proper purposes for a debug .apk are limited (app stores won't accept it, user data is completely unsecured, and it will expire inside a year), that is indeed a valid apk you can use for some temporary testing purposes.
Two things govern the existence of that file:
A "clean" operation should remove all build objects, including of course the .apk
The android tools are usually configured so that the automatic build process does not include generation of a debug .apk, and that instead only happens (by default) when you go to deploy on a device/emulator.
Therefore, you can grab the temporary debug .apk out of the bin folder any time between having deployed and having cleaned, regardless if your emulator or device is still running/connected or not.
Examining the timestamp on the .apk file as you try these various operations would be a way you can confirm this for yourself.
Upvotes: 1
Reputation: 494
It really depends on what you want the .apk for. If you want to distribute it via the Google Play store or on a server you'll want to export a signed application. If it's for personal use just run it on your phone using your phone as a debug device.
Upvotes: 0