0

Background

As it turns out, it's quite an annoyance to test out in-app-billing (i've written about it here) . Each time you find a bug and need to test your app, you must have the following steps:

  1. compile the app , preferably with the debuggable="true" flag on the manifest
  2. sign the app with your real key you've created for the play store.
  3. install the app on your device
  4. run the app on your device, preferably debugging it via eclipse.

If you'd use a batch operation instead of doing all of those by yourself, it should make things easier to test such apps, and might also be useful for other apps as well.

The question

Is there any way to make the whole process fully automatic, so that with a single click of a button, it will do all of the above?

I know how to achieve 3+4 (using "adb.exe install -r *.apk" and "adb.exe shell am start -n FULL_ACTIVITY_PATH" ), but I don't know how to achieve the others.

If there is a solution that doesn't involve a third party app or plugin (like maven or Ant), it could be very nice. Of course, if that's what is available, I would like to know if it's possible to achieve via a batch file that will use them somehow.

Is there maybe a way to mimic how Eclipse does things in this regard, without being so specific on the project (maybe just the path of the project and that's it)?

Community
  • 1
  • 1
android developer
  • 114,585
  • 152
  • 739
  • 1,270

1 Answers1

0

Maybe you can package app by ant . You can do every thing you what int the ant code of packaging ,causing the core code is to make property configs in your app and referenced lib, such as build.xml,local.properties...,and replace channel in AndroidMainfest.xml ,so you can also replace any code in your android app,just as you want ,to change the flag of debug , because all the operation just handle local file before packaging your app,you can copy or modify any file in your app. After above process ,you get a app,then you can run other code to install the app. Recently ,I have been using the batch package method to get a lot of app for different channel .so hope it helps.

  • How do I do it? is there a "template of code" for such a thing, that all i need to do is fill the needed fields? i don't know how to use Ant. that's why i always used the adb commands via batch files. is it possible to totally mimic what Eclipse does on the selected project (when you right click and choose to export) , instead of writing down so many parameters ? I mean, eclipse does it all by just using the selected project. it doesn't need me to enter special parameters... – android developer Jan 16 '14 at 06:21
  • I had uploaded an batch package project by ant to git ,maybe it can help you ,this is the : [link](https://github.com/lightSky/AntPatchPackage) – user2516334 Jan 17 '14 at 00:55
  • does it do all of the actions i've written about? does it compile the app? in case of multiple library projects that the app uses, does it compile and use them all for the app's project? – android developer Jan 17 '14 at 23:12
  • It just can compile app and package it ,but you can do something in the ant project,such as replace the debug flag. You can download the project , there has been noted clearly.If you reference other lib project ,just copy the config file under you android project to every lib project ,it will work. – user2516334 Jan 18 '14 at 01:28
  • I don't understand - why do I need to copy files on the projects if eclipse can do it all automatically without copying them? plus i don't know which config file you are talking about. on the list of steps on the website you've shown, I think only steps 1+2 are understandable and should be required, while the rest are for helping the tool with things it can figure out by itself. if I add/remove library projects, i will always need to update those files, while on eclipse, eclipse handles it all automatically... – android developer Jan 18 '14 at 08:05