2

our company bought 50 Samsung Galaxy Tabs for corporate use. Before these can be delivered to users we must install some company labeled programs in to them.

We thought the easiest way to do this would be through ADB but it needs the USB debugging to be enabled. Is there a better and faster way to do it than enable it on each device one by one? Is it possible to enable USB debugging from PC using some program or piece of code while connected with USB cable? The ideal solution would be that we connect multiple devices via USB to one PC and run installation script that enables USB debugging, runs installations, disables USB debugging and finally shuts down the devices. How would you do this?

Br, Tupe

user1132307
  • 31
  • 1
  • 2
  • few thoughts(coz i'll facing the same problem in nearest future) USB debugging ? what for ... all you need is allow to install unsigned application, so now we able to install our app ... but still what about updates ... build own updater with c2dm so if you push new version you send c2dm message to all devices and it will download and install your main app on all devices – Selvin Jan 05 '12 at 14:41
  • Stackoverflow is really for programming questions. Your question is actually better suited for android.stackexchange.com – slayton Jan 05 '12 at 14:50
  • @slayton this question could be good start for discussion about "enterprise apps deployment on android devices" – Selvin Jan 05 '12 at 14:59

2 Answers2

2

Is there a better and faster way to do it than enable it on each device one by one?

Have several people enable it on each device one by one in parallel.

Is it possible to enable USB debugging from PC using some program or piece of code while connected with USB cable?

Fortunately, no, as that would be a security hole.

The ideal solution would be that we connect multiple devices via USB to one PC and run installation script that enables USB debugging, runs installations, disables USB debugging and finally shuts down the devices.

Under your plan, a piece of Windows malware could detect that an Android device is plugged in and install Android malware on that device. After all, if your "installation script" can do it, so can the malware.

How would you do this?

Host the APK on an internal Web server, generate a short URL to it, check the "allow non-Market installs" on the device, and fire up that URL in the browser on the device. This presumes that you plan on updating the app (e.g., bug fixes) and that you aren't planning on going through your whole USB cable process for each of those updates. In that case, you need to get the Web server configured for APK files and have the "allow non-Market installs" checkbox checked anyway, so you may as well do that as part of the initial device setup.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • both answers are similar to my comment ... but can we do silent install not like this one (http://stackoverflow.com/questions/3438637/silent-installation-on-android-devices) but fx.: using this http://developer.android.com/guide/topics/admin/device-admin.html (so user have to accept it first/ but not every time we wana update it) – Selvin Jan 05 '12 at 14:55
  • @Selvin: The device admin APIs, at present, have nothing to do with app installs. – CommonsWare Jan 05 '12 at 14:57
0

Is it possible to enable USB debugging from PC using some program or piece of code while connected with USB cable?

Hopefully not. If this were possible any piece of hardware that you plugged your device into could do some very nasty things to it without any chance for you to intervene.

I've done some large installs like that. I've not found one technique to be the end all be all.

I would suggest host your apk file online somewhere make a shortened (easy to type) url to it. Then on the devices open up browser and type the url. That will download your apk, when you click the download complete in the notifications it will start the install.

Note: You will have to turn on "Allow install from unknown" in settings. The fastest way I think is just do the download and press the apk, this will throw up a dialog that has a button you can press to take you right to the correct settings page to turn this on. But bad news is that after you turn it on the install won't resume automatically. So you either have to find the apk with file explorer, or go back to browser and download a new copy of it. I would guess the latter might be quicker, albeit messier.

FoamyGuy
  • 46,603
  • 18
  • 125
  • 156