I am building an apk file for android in visual studio with cordova. To this end I am including an aar file.
I also have an older version of the apk file I am looking at and want to find out what aar file was used to build the apk, how is this done?
I have opened the apk, and the file itself is not present. A textual search on the name of the aar also reveals nothing,
You can use a decompiler to have all the packages and information listed
I use this one usually: https://github.com/skylot/jadx
You just need to build it locally with these commands:
git clone https://github.com/skylot/jadx.git
cd jadx
./gradlew dist
A build folder will be generated.
Go inside jadx/build/jadx/bin
Copy the APK inside the bin folder for simplicity and launch from terminal:
jadx-gui name_of_apk.apk
Then a GUI will open with all the informations you need
Related
I am using an Android application for automation where I have to copy the latest version of apk file from Jenkins job Artifact to a specific folder and start the test suite execution. Currently I am copying a file using "wget" command to copy the apk from Jenkins to a specified folder- but, this task I am doing using a Windows batch command file.
Now, next task is instead of using separate batch file, I have to copy this apk from Robot file itself.
How can I accomplish this task?
I've got an older Android project (still using Eclipse) that I need to build from the command line. It just builds a library (.jar file), not an application (.apk file). I installed ANT, but since there's no build.xml file it doesn't do anything.
All the examples I've found say to use the "android" command to generate build configurations, but I do not have the "android" command on my PC and searching on "download android command" didn't product any useful results.
Where does one get the "android" command? Do I actually need it in my case, or will a simple generic build.xml file of some kind do the trick?
The answer is simple but not exactly easy to find (IMHO), thus this posting.
By default, the Android SDK adds its "platform-tools" sub-directory to your path but the "android" command is in the "tools" sub-directory. So one just needs to manually edit the PC's PATH environment variable to add the "tools" directory.
How to find apk file in android studio 0.5.2. I checked build file but apk is not generate.
Can anyone help me in finding this file?
In later versions of Android Studio, it doesn't build a full APK from the "Make Project" command in order to make builds faster; it only builds an APK when you run the project, or use the "Generate Signed APK" wizard. If you want to force it to build an APK, go to thew Gradle window, open up the Tasks view, and choose "assembleDebug" to make a debug APK. When you do that your APK will be built in the build/apk directory in your module's directory.
I had a same problem
I run the app once on AVD
the apk file is generated
As soon as your build is successful .apk file is generated and it's path is like
project/build/apk directory.
I am interested in making Android apps on demand. Depending on the clients request, my web site would send me a JSON file direct to a Windows application that I have created in Delphi. This one would save the file inside the Android app source folder and then, execute a command line telling the Android compiler to generate the APK file and send it to my client, all that without my presence.
The Android project was made with MotoDev. And it uses the Android SDK that is in my root.
How should I configure the command line to achieve this from inside my Delphi program?
I will also need to change the manifest to put a new version number so it does not conflict with other clients version.
Android uses the Ant build system, so you can create a build.xml and build.properties file for your project.
You'll need to create the build.xml file first though:
android update project -p .
This will generate a build.xml file. You should probably customize the build steps and targets for your project. A good idea in your case would be to have the build.properties file generated by your website for the specific build... Then include it via the build.xml file. In particular, you will need to specify in the build.properties file where the signing keys are, and what the password is:
Build.Properties:
key.store=keystore.dat
key.alias=signing_key
key.store.password=password123
key.alias.password=password123
The build process using ant also allows you to do variable replacements in Java files, which might be another idea. It would allow you to customize the build process further on a client by client basis.
By default, the build is triggered by:
ant clean
ant release
Another neat idea: Have Ant copy the resulting APK file to a network share accessible by the website by placing a < copy ... /> line in the < target name="release" > section.
Create build.xml at project creation time
If you start a new project with:
android create project \
--target 1 \
--name MyName \
--path . \
--activity MyActivity \
--package com.yourdomain.yourproject
the build.xml file used by ant will be generated.
The android tool is present in the tools/ directory of the SDK which you downloaded.
Create debug releases
Besides:
ant release
for final releases, you can also create debug releases with:
ant debug
Location of generated apk
Generated apk are placed under bin/.
The most important outputs are:
MyName-debug.apk
MyName-release.apk
but some intermediate apks are also generated, in particular unaligned and unsigned versions.
But most of the time you can forget where they were created and just run:
ant debug install
ant release install
to get them installed. But make sure it is working with adb first: adb devices command not working
Tested on Ubuntu 15.10, Android 23.
Android doesn't directly use ANT build systems now. It uses Gradle, which is based on Groovy. You can learn more about build systems here.
You can see the list of available tasks you can run on using this command
gradlew tasks
To initiate a debug build, invoke the assembleDebug task
gradlew assembleDebug
You can install your app using the adb tool via this command
adb install path/to/your_app.apk
To learn more about building on command line, follow this comprehensive article.
Also you can read this article on "Why Build Your Java Projects with Gradle Rather than Ant or Maven?"
I know that Ant is a build tool. We write script (steps while releasing android project) to build an android project and create a signed apk. Thats is one of the uses of Ant. But I want a method/script to create a new project in Android and I also want to build it so that an apk file can be created through that method/script. Is it possible through Ant?i.e. Ant script create a new project with a package name and activity name provided in the script, build it and create an apk file ready to be loaded in the emulator or device.Is there any solution(method/script) to the above mentioned problem?
yes you can do this through ant via a command line call to 'android create project' which will in turn generate all the ant scripts.