I have used the auto-instrumentor command on my Android apk file.
auto-instrumentor.cmd apk <apk file> prop <APK-Instr.properties>
It generated three new files:
unsigned
signed
final
Now I am able to use my app when I do a fresh install.
But if I try to upgrade an earlier build to this Dynatrace enabled version, it always gives me a message
App Not Installed.
If you are not using the original certificates to sign the apk you will not be able to install the instrumented app over the already existing once. The only option you have is to uninstall the original app and install the instrumented app.
If you have the original certificates you need to take the following steps:
take the unsigned apk and instrument the apk
sign the apk
zip align the apk
For more information please take a look at the Android Auto-Instrumentation documentation
Related
I have installed Android Studio Dolphin | 2021.3.1 for Mac (~993 MiB) recently. I have created .aab file from Build -> Generate Signed Bundle / APK. While generating .aab I have given all the required details like keystore file path, alias and password. After generating .aab I tired to generate .apk from .aab by using following command,
sudo bundletool build-apks --bundle=<.aab location> --output=<.apk location>
Then I encountered with following warning,
WARNING: The APKs won't be signed and thus not installable unless you
also pass a keystore via the flag --ks. See the command help for more
information.
Now, If I am unable to install the generated .apk file due to signing issues.
May I know the reason behind this warning though I have given all the required details while generating .aab?
It's a requirement of the Android platform that all APKs must be signed to be installed on a device, so your requirement of "installing unsigned APKs" is simply not possible.
Solutions to get apk from aab
I am developing an android application. All the things is going well when I run the application into genymotion virtual device.And Since the apk is stored in F:...\app\build\outputs\apk location. So I just want to collect it from this location and download it to install in a android phone.As I simultaneously updating the application with code but this apk doesn't provide me the updated apk file according to the updated code .They just give me the old apk file even if i run my application again and again from the android studio. Can anyone suggest me why this is happening ??? I just want to run this apk into phone or download this apk file for another purpose.
This three steps will do Go build->Build apk
Go to Build > Build APK to generate a normal APK.
Go to Build > Generate Signed APK to generate signed APK.
Signed APK are those which we generate to release our application. Here it is, why is it necessary to generate signed APKs: Why should I Sign my Application APK before release
If you build a debug APK, it will still work on all devices but you cannot release it.
From terminal run the following command to make sure that you get the updated apk.
1. gradle clean (from windows )
-or-
./gradlew clean (from linux) -
Above command deletes the build folder.
2. gradle build (from windows)
-or-
./gradlew build(from linux)
Above command builds all the flavor for your application.
Edit: Original answer
Signed apk is needed to install in any other non debug device. This will be same as the debug app that runs in your test device/emulator.
Build -> Generate signed apk
I use Android Studio to create Android Apps. When I created signed apps, using the option "Build -> Generate Signed APK..." in Android Studio I selec the previously created keystore file and start the generation process. Everything seems to work fine.
Then I try to updload the app into the Play Developer Console, and get the error, that the app is not zipaligned.
Now I zipalign the app by hand, using the command line. Now uploading the app works.
Cant I zipalign the app in the APK generation process right away using Android Studio?
I'm used to develop and debug android apps on my phone, it's pretty faster.
When I'm ok, I export a signed APK to upload to the market.
Now I use Google Maps APIs, I must add a signature to the Manifest, this signature is associated with my key I use to sign APKs for release. So I am able to export a signed APK to test on my phone, but it's not automated and I cannot view LogCat anymore.
Can I just instruct ADT+Eclipse to auto-sign the APK before uploading it to my attached phone?
Am I missing a point?
I don't think you can do this via ADT directly. But you could use ant to build instead which supports signing (http://developer.android.com/tools/building/building-cmdline.html).
Just set the key.store, key.alias, and key.store.password, key.alias.password properties in the ant.properties file.
You can also trigger ant builds from within eclipse and add a new ant target to install/launch the app on your device
On Android developer's page (http://developer.android.com/guide/publishing/app-signing.html) there is a tutorial on publishing which says that an app has to be compiled as an unsigned app, a private key must be generated with keytool then signed with jarsigner.
How do we create an unsigned app with IntelliJ?
Alternatively, can we do all these steps via Tools->Android->Export Signed Android Package?
Thanks in advance!
New IDEA versions have an option to generate unsigned APK in the Android Facet settings, Compiler tab:
However you don't need to do that if you use the Export Signed Android Package feature:
Tools | Android | Export Signed Android Package will generate the release version of your application signed with the release key and ready for Market.
You can also create a batch file that will sign the unsigned APK and configure it as an External Tool in IDEA so that you can generate it in one click or via keyboard shortcut (if you are OK with a batch file containing your keystore passwords in open text).
I use such script to generate the signed APK, upload it to a phone and start the main Activity to perform application testing, it has the following sequence of actions:
jarsigner
zipalign
adb install
adb start
EDIT 2013/2/8: The option to export a Signed APK is now under Top Menu > Build > Generate Signed APK (IntelliJ IDEA 12)
IDEA 12 has even better way to do it via artifact, configured like this:
Then use Build | Build Artifacts when you need to make a release version.
Well you could modify the ant scripts slightly and have one target which builds a final signed APK. So that technically could be a one click build. Not sure about publishing, you may be restricted to using the web interface to upload and publish the app.
I wrote a tutorial on publish, it might be worth a read as I cover some of the building final releases and such