Automate installation of Android devices 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?
This could be done - but would need to either:

1)root the devices and allow system priviledges 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.