2

I am having a lots of Android devices which I need to prepare for use as follows:

  • Remove all unnecesary applications
  • Add single Google account
  • Install certain applications from App Store of given Google Account
  • Set background/themes

I would like to write scripts which I could execute to process these steps. Is that feasible?

Thanks.

EDIT 1:

Creating useraccounts as

adb shell am start -n com.android.settings/com.android.settings.accounts.ChooseAccountActivity

results in:

Starting: Intent { cmp=com.android.settings/.accounts.ChooseAccountActivity }
java.lang.SecurityException: Permission Denial: starting Intent { flg=0x10000000 cmp=com.android.settings/.accounts.ChooseAccountActivity } from null (pid=7214, uid=2000) not exported from uid 1000
    at android.os.Parcel.readException(Parcel.java:1425)
    at android.os.Parcel.readException(Parcel.java:1379)
    at android.app.ActivityManagerProxy.startActivityAsUser(ActivityManagerNative.java:1976)
    at com.android.commands.am.Am.runStart(Am.java:494)
    at com.android.commands.am.Am.run(Am.java:109)
    at com.android.commands.am.Am.main(Am.java:82)
    at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
    at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:263)
    at dalvik.system.NativeStart.main(Native Method)

Similar problem is:

$ adb shell ls /data
opendir failed, Permission denied
$ adb root shell ls /data
adbd cannot run as root in production builds

So the permissions are preventing me from using the scripts. Can it be overcome?

2 Answers 2

0

Seems so. If you have a look at Android ADB API I've used commands in batch scripts etc to install / uninstall .apk files etc (agreed that isn't the same as installing from the store but it's a start) ... and as for theming I'm pretty sure you can do stuff with issuing intents etc to make that happen.

2
  • This seems to be quite interesting, but I am not sure whether it will allow everything – for inst. I am not sure whether it will allow me to setup the Google account.
    – Vojtěch
    Commented Jun 11, 2014 at 10:36
  • 1
    Agreed it won't give you everything you need ... I've had experience with a tool called EggPlant which is really high level, if cost is a barrier maybe you could try and implement something similar ? Sorry I can't be of more help.
    – James C
    Commented Jun 11, 2014 at 10:47
0

This could be done - but would need to either:

  1. Root the devices and allow system privileges high enough to automate uninstall/install/create wihtout user confirmation

  2. The user would need to confirm app uninstallations and installations - which would be almost as slow and laborious as doing the work manually.

If you decided to go down the root and run route, you would need to write an app which could install the others for you OR you would need to look into something such as nandroid which can be used to create an image of a working Android device and return you a set of image files to deploy to other devices.

Failing that, as James said - look at the debug bridge APIs which could be used to accomplish this.

You must log in to answer this question.