Building android application using platform tools - android

Does anybody know sources in internet where described how to build an android application using it's native components such as aapt, aidl, dex, apkbuilder, etc.? Because in this link there is only description of how to build an application using ant tool.

Ant uses the native tools. There are very few guides available on how to actually run the aapt/aidl/dex/etc tools at a command prompt, and in general Ant performs all the tasks you'd like here. Is there a specific reason you don't want to use Ant?

Related

Gradle in command line or Android Studio?

Android studio provides lots of plugins and features to run the task more quickly. There are two ways to run Android applications that I know,
Download Gradle and run in cmd. (Without Android Studio)
In Android Studio generally, all developers do in this way.
I know the major differences. Can we run below tasks without Android Studio and with installed Gradle and in CMD.
E.g.
I want to clean build in cmd without Android Studio.
Generate signed APK in CMD.
Run test cases in CMD.
Make sure to run above tasks there will not be any dependency on Android Studio.
The two ways are totally the same.
Also, with Gradle, you do not run Android applications. Gradle is your build tool which has a plugin for build steps necessary for Android applications. Android Studio offers you an integration of the mentioned build tool, but you are free to use this integration or a standalone Gradle installation.
However, take care about different versions of Gradle, this may cause your build files to only work with either the standalone or the Android Studio Gradle installation. Also, it may be possible, that the two installations do not share temporal folders or global properties, as they expect them in different directories.
For my part, I use the Android Studio Gradle installation with the tool integration, but switch to a standalone installation for continouus runs (e.g. a Gretty container).

Build (not develop) your android app .apk (gradle build) on server?

I'm trying to build(not develop) an android application on server. I've the whole native android code on the server, which I need to build according to some modification done on the server.
I've been looking all over the internet but couldn't find any detailed solution. All I got to know was I might need Jenkins or some CI tool (which I think is time consuming as I'll need to get them installed on server and then all the android dependencies).
Initial idea was to build the .apk file via some python script which contains all the gradle commands in it.
How can i do this?
Android apps can be built easily on a system that doesn't have any Android tools installed by applying the Android SDK Manager plugin for Gradle to your project.
When running ./gradlew assembleDebug (or whatever task), then Gradle will be installed and then all Android dependencies, including the SDK tools, build tools, platform versions and other dependencies will be installed automatically.
You can run this simply on the command line yourself, or automate to run after every commits to source control easily with Jenkins (it's easy to install on a wide range of operating systems).
You need to install Stand-alone SDK tools and suitable SDK packages to your server to build Android software.
When you have all installed and good, you can build APK with gradle , e.g.
(Linux and Mac)
./gradlew assemble

Build webRTC for android on windows

I am working with webRTC. I want to build it for android to do peer to peer streaming. I think i can do that using that webRTC-android-app, right? So my question how can i build it on windows because if you go to the link the first line says "Android development is only supported on Linux."
So it's possible to build that on windows or i have to switch to Linux for that project?
I would recommend you to try use Cygwin (https://www.cygwin.com/). Please be sure that you are using x64 version. I would also recommend you to setup "devel" package during installation process. apt-cyg (https://code.google.com/p/apt-cyg/) will be also helpful for you.
The build steps will be similar with build steps for Linux, but all operations will be done under cygwin console.
The main advantage of this way is that you can easily integrate Cygwin bash with your IDE on windows (e.g. eclipse) and build WebRTC library as a part of your project build process.

Compile Android project in Continuous Integration System Hudson?

I'm setting up a Continuous Integrations System with Hudson and it's just amazing.
I got a SVN repository and integrated a post-commit hook that notifies Hudson when someone commits to the repository. This part is working splendid.
The general idea is, that if the project fails, with unit-tests or anything else, it should tell the collaborator(i'm using a simple e-mail notifier atm). But if it successes I want it to compile the project and build either an unsigned or a signed .apk file.
What's the easiest or smartest way to do this?
I've read you can use a Shell Command to build the .apk but I can't seem to figure out how this works? Can anyone tell me how I can do this or should I go for another solution?
Thanks in advance
Finn Larsen
There is a guide on the Jenkins wiki about building Android apps with Hudson or Jenkins, including building and running a test app, obtaining code coverage and static analysis stats.
Essentially you can use the Ant support built-in to build your application.
If you want to run automated tests, you can also use the Android Emulator Plugin.
Since you're just starting out with Hudson, I would say now is a good time to upgrade to Jenkins. ;)
As far as I remeber hudson supports ant's builds. And android apps can be built using ant use this link for more info about building android apps with ant. Be aware that you'll have to install Android SDK on your build agent.
Android provides ant build script. So, you can make apk easily.
install android-sdk in hudson server
install ant in hudson server ( ant version should be > 1.8 )
in hudson, call cmd android update project -p <PATH to your project>
in hudson, call ant debug. debug target generates debug apk build

Android autobuild + tests

what is the easiest way to run an autobuild of android app, that includes compiling, running tests and creating an apk file (using ANT)?
thanks!
Use the android tool from the SDK. If you already have something that's a running project in Eclipse you just need to run the android project in the base directory of your project:
android update project --path .
And it should generate the ant build scripts needed to be able to build debug and release apks from the command line.
As for testing, there's also options to create a new test project using the android tool: http://developer.android.com/guide/developing/testing/testing_otheride.html The docs in there go through details for automating and setting up test projects.
If you're looking for a way to automate all the stuff check out one of the continuous integration servers, like Jenkins (http://jenkins-ci.org/) They're tailored to watch a software repository, automate some actions, and monitor the output.

Categories

Resources