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.
When I close emulator (NOT CLEAN PROJECT) and the .apk is there?
When my app is running to my emulator and copying the .apk file?
The (export) unsigned Application package and save in different location?
The (import) unsigned Application " " " " " "
Sometimes I installed apk file without problem in my Phone somtime NOT.
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.
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:
Clean/Build the project
Stop making modifications to the code (if build
automatically is checked) and do not clean/build anymore
Make Eclipse generate the APK by launching application on emulator/device
(You can skip this step if setting (a) is unchecked)
Save the APK
Continue working
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.
Related
Good day.
I have an application and I recently wrote a code to make it update programatically by fetching the updated apk file on a server I host. I made the updated apk by changing the version code to version 2 and version name to 1.0.1 in the Android Manifest file. I also placed a textView in the first activity to know if it is the updated application or not. However, an issue I encountered while updating is that I get the An existing package by the same name with a conflicting signature is already installed error when Android tries to install the downloaded apk file. Since the error is about a conflicting signature, I guessed that whenever I install an application to my device (Nexus 7) from Eclipse, the application is not signed. What I did was that I Exported a signed copy of the version 1 of the application, moved it to my Nexus 7, and installed. From that signed application version, I tried to update and I encountered no problems.
However, this process is not efficient at all because if I want to debug my application to see if data stored like the database or sharedPreferences persist between app updates, what I'll have to do is to export my app, copy to tablet, then install. This does not allow me to use logCat efficiently - as the session filter won't work. The only way for me to see my logs is via the All Messages category and look for my tags.
So, my main question is: Is there a way to install a signed copy of your application via Eclipse so you can still debug efficiently via LogCat?
A secondary question: What happens to the private app data like the SQLite Database and the SharedPreferences when the application upgrades versions? Are they deleted?
When you debug (or run) Android will use the default store key for signing your application, and you can change it on Windows -> Preferences -> Android -> Build
Change your debug keystore there with custom debug keystore
Yes Its possible to install signed copy your application via Eclipse and you can still debug efficiently via LogCat.
Follow These steps.
1. Right click on your project from project list in eclipse.
2. Click Export.
3. Then select Export Android Application
4. Then select the project to export.
5. Click Next.
6. Then give the path of signing key (Keystore file). If you don't have any then create new keystore file by selecting Create new Keystore radio button on that Dialog.
7. Enter and confirm password and click Next.
8. Select Alias of Keystore file. which you have given while creating that file.
9. Enter password for that Alias and click Next.
10. Select the destination to export apk file and click finish.
It may take few minutes to build your app. Time depends on your application size.
I'm running Android Studio 0.5.8 and using the "Debug App" functionality to send my work in progress to my phone to test. I've done this dozens, maybe hundreds of times. I'm concerned that Android Studio may not be overwriting the old apk files. It appears that my useable space keeps dropping.
Where does Android Studio save apks when installing debug runs?
Is it a destructive or cumulative process? Do I need to clean out the folder manually?
Within your module directory should be a folder called build, then another directory called APK. The APK should be in there. Perhaps check the file size and compare it to your "drop in space"
On your device Chris Stratton's comment is correct, it will overwrite the old APK when installing.
Check Settings->Apps and select your app. The see what readings it gives you for Data and cache.
It is stored in /data/local/tmp. It should overwrite the old apks stored there.
I've developed a simple Android project on Eclipse. Then I export the application as unsigned application onto my PC. Then I copied the application on to the SD card. Then I tried to install the apk file by clicking on it. I also made ensure that I can install applications from sources other than from market. But my application while installing says that application not installed. I've tried one solutions in stack overflow which suggests to install AppInstaller and try from there. Even though it's not working.
What can be the problem with the installation?
Any ideas ?
You need to sign the app, because Android will refuse to install unsigned apps. The debug certificate will also work, but better create one even if you don't intend to release to Play Store, etc. In case you do decide to publish later, make sure you create a certificate with the required validity (more than 25 years), check the guide for details.
After run a successful build ( Project -> Clean or Project -> Build All do the trick) go in your bin folder(automatically generated every time you build) and you will have an .apk file. Browse to that file in your Windows explorer (or whatever you use) and keep that folder. I eclipse show the ddms perspective (Window -> open perspective -> other -> android/ddms) pick the file explorer, drag your apk file over there, and run it on the phone!
You might be installing the app on the device which have lower OS version than the app supported version
Check android:minSdkVersion in you AndroidManifest.xml
<uses-sdk android:minSdkVersion="3" android:targetSdkVersion="8" />
And your device OS version
I'm using Eclipse to develop an app and I have two computers (a desktop and laptop) that I want to use to develop this app. I recently set up my laptop with Eclipse and imported the project over to that computer. However, I realized that I can't launch the application from my laptop onto my phone because the signature that is automatically generated when I build the app from my desktop doesn't match the one that is automatically generated on the laptop; unless I uninstall it on the phone. Does anyone know how to export the automatically generated signature from one Eclipse and import it into another?
Window -> Preferences |-> Android -> Build:
refer to your custom debug key store, (I copied mine from the C:\Users\${UserName}.android\debug.keystore) which I would put in something like drop box.
The automatically generated key is called the debug key/certificate.
You should generate a new key can just copy it over to both your devices. The only negative of this is your builds process is longer as you need a manual steps.
The other option is to copy over the debug key from one of the systems.
You will find the keys in a folder names .android in your home directory in Linux & user directory in Windows
Tip: Never loose the certificate once you push an app to the market.
I'm developing an android app using Eclipse. I export the app using the Export Android App function. I sign and align the resulting apk file. I then copy this apk to a webserver and try to install it on my phone. It goes though the installation steps, and when I test the app it does not contain my latest changes. It seems to install one of my previous builds.
Is the problem in:
- the way I create the apk?
- a cache on the phone that has not been cleared?
How do I get Eclispe to make a current apk, and how do I get my phone to install it?
How can I verify which version of my code is in a particular apk file?
Thanks,
Gerry
It could be that Eclipse isn't building the new .apk properly, though it sounds like you're exporting correctly. Are you giving the new .apk a different name from the old one? If not, then you could be downloading or installing the old one by accident.
You should be able to go into Settings -> Applications -> Manage Applications on your phone, then find your app and open its info page. The version string should be listed near the top, so you can verify that the latest version is installed.
Try running "adb logcat | tee logfile" (or adb logcat > logfile) before you begin the install attempt, then ctrl-C it and go over the file with a fine tooth comb - there's likely some hints of the problem buried within the noise.