# Setting up of multiple tablets from out the box

I have the task of setting up 50+ tablets (Binatone Homesurf 744, Yes cheap & cheerful!), which all need the same App installed and same wireless settings entered but require different configuration files (config files stored on SD card).

I was hoping there might be a solution which I can set up each of the tablets via ADB or a script without root access if possible (as this would an additional step and take more time). The tablets so far have come out the box with debugging mode already enabled. If I access the tablet via ADB and type "su", it does give me some kind of root access as the symbol changes from "$" to "#" but I'm unable to remount the /system a rw. The process I would like to do is as follows:- • Start Tablet and plug in via USB cable to the PC for ADB access • Automatically Disable/Skip "Welcome" screen (Initial Setup Wizard) • Install Wireless Settings • Install Required APK • Push Required Configuration Files • Restart Tablet if Required I think I may have answered the question about disabling\skipping the "welcome" screen after a bit of research. This I believe requires full root or rw access to modify system files (ro.setupwizard.mode=DISABLED, I believe?). With regard to the wireless settings, I'm able to add the wireless settings manually in ADB shell via the following command after switching to the "wifi" user (issuing "su wifi"):- echo 'network={\nssid="Wireless"\npsk="i*********m"\nkey_mgmt=WPA-PSK\npriority=1\n}' >> /data/misc/wifi/wpa_supplicant.conf  After restarting the wireless via ADB, the tablet happily connects to the newly added wireless. I can install the required APK and "push" the required configuration files manually or via a batch script on windows. Any help would be appreciated on automating this and making things as simple as possible. Thanks in advance! • If that ADB command works, the tablet is most likely rooted – as files in /data/misc are usually not writable by anone but a system user. I don't think there's a way to automatically skip the wizard (and no app can plug in the cable for you), but everything else should be easily possible. One thing I need to know before being able to answer: What OS is running on your computer? I can setup an answer for Linux, if that's acceptable (which should also work on a Mac, and could be adapted to Windows). – Izzy Mar 16 '15 at 17:11 • Thanks Izzy, I have access to both Linux and Windows so an answer for Linux would be greatly appreciated at least to give me an idea of where to start. – Johnpaul Mar 17 '15 at 15:13 • OK, so here you go! I've included some explanations which should make it possible to adapt the idea for other systems as well. Hope you'll find it helpful! – Izzy Mar 17 '15 at 17:28 ## 1 Answer So here's a solution for Linux. The first part you already mentioned in your question, but for completeness I'll include it nevertheless: #!/bin/bash # echo "Plug in the cable now, please!" # Just kidding: That and skipping the intro you'll have to do manually :) # As well as ensuring that USB debugging is enabled etc. Test with # "adb devices". If it shows the connected device, go on. # Install Wireless Settings echo "Installing wireless settings..." adb shell su -c "echo 'network={\nssid="Wireless"\npsk="i*********m"\nkey_mgmt=WPA-PSK\npriority=1\n}' >> /data/misc/wifi/wpa_supplicant.conf" # Install Required APK # assuming all the required APK files reside in a "install" sub-directory: echo "Installing APKs..." for apk in install/*.apk; do adb install "${apk}"
done

# Push Required Configuration Files
# these and all other files you want to push you've placed into
# the "upload" sub-directory **WITH FULL PATH** (e.g. to push "foo" to
# "/data/local", it would be saved as "upload/data/local/foo

# Restart Tablet if Required
echo "Rebooting device..."


Of course, this is just a skeleton; you might wish to have some "success checking" in place, or write a log to evaluate later. But it contains all the technical stuff you need:

• adb shell su -c "command" to execute a command as root – here for appending your wireless settings
• adb install to install your APK files. In case these are just newer versions of apps already installed on the devices, add the -r (re-install) switch; a simple install would fail then (i.e. make it adb install -r "\${apk}")
• adb push to transfer files to the device. Note a few things here:
• Syntax is adb push <source> <target> (the counterpart would be adb pull <source> <target>)
• you can push a file, or an entire directory
• <source> and <target> must be of the same type (i.e. either both are a file name, or both are a directory name)
• you can only push to directories you've got write access to. So in order to push into "system areas", the ADB daemon on the device must be running in root mode

As the last condition usually is a culprit (on "production devices", adbd runs in "secure mode" – i.e. non-root), use a work around by first pushing the files to a "common area" (e.g. the internal SD card), and then copy them over. Example:

adb shell "mkdir /sdcard/misc"