Pushing form from computer to tablet

Hi,
My name is Madeline and a group of us are making a survey at St. Catherine’s University and are trying to put our survey onto our tablet and are using the command window to try and push our file using the command “grunt adbpush-default-app” and we keep getting warnings about the .nomedia file… it also says it thinks certain things did push but it isnt showing up in or OI file manager on our tablet. We know its not a problem with our form because we tried doing it with your exampleForm and just changed the form_id and the same thing was happening. please please please help, we have been tryi8ng to do this for days.
Thanks,
Madeline

Hi Madeline and welcome to the ODK community! Please take a moment to introduce yourself when you can. :blush:

It sounds like you’re using grunt to automate certain tasks, is that right? Have you tried just running the adb command on its own? Given a form named my-form.xml, you would use the following:

adb push my-form.xml /sdcard/odk/forms

Please let us know what happens when you try that.

Oh, I’m sorry, I just realized that you’re using ODK Survey. What I suggested is the typical workflow for ODK Collect and that probably won’t be helpful for you.

Thanks Helene for the suggestions! Yes, we were using grunt to automate the push from app designer to the tablet in the command window. We just succeeded after reading up some more along the lines you suggested about the file paths for adb push. We’re not 100% sure which actions actually solved our problems (because we suspect we were having several problems) but in case this helps folks in the future here’s what we did:

  1. We reinstalled and updated Nodejs and Android studio

  2. One of the problems was that the adb command itself wasn’t working; we had to train the computer to look in a different spot for it than where the app designer was (see, for example: http://www.howtodroid.com/2014/02/how-to-add-adb-command-prompt-windows.html)

At this point we had adb trying to push and finding the command, and it could detect our device when we typed adb devices, but kept saying “remote device or resource busy” and not actually pushing anything. This was despite having allowed debugging and repeatedly authorizing per the Getting Started guide. What seems to have helped was:

  1. Restarting everything

  2. Restart the adb: adb kill-server and then adb start-server

  3. We installed Google USB in the Android SDK tools

  4. We installed Android USB manager on the device (tablet) from the Google Play store

After that grunt abdpush-default-app worked without any errors!

I’m so glad you figured it out! And thanks so much for the detailed writeup.

Hi @elmps2018,

Starting from your information, I have successfully tested the following procedure to push a new form to my Android MashMallow smartphone:

  1. Install usb driver for android from the app store in your smartphone, The “usb driver for android” app icon appears on the phone screen
  2. Connect your phone with a usb cable to your pc
  3. tap on the “usb driver for android” app’s icon’s which shall lead you to the setup screen. Do not forget to put USB Debugging on “ON”. This will allow your pc to detect your phone and it will install a driver for it (takes a few minutes on my Windows 10 64 bit)
  4. Install google’s Android Studio app in your pc. It will create a “C:\Users\yourusername\AppData\Local\Android\sdk\platform-tools” folder. I created a link to this folder on my desktop not to have to remember the place!
  5. Click on the link to get to this folder where adb.exe is located,
  6. Shift-right mouse click to open a command line in this folder
  7. copy adb push your-form.xml /sdcard/odk/forms in the command line then click Enter

This way the file is pushed correctly to ODK collect forms folder. No need to install “usb driver for android” app in your pc.

The same procedure works if you to push the form to a simulator if you have created one with Android Studio. I always do this during the debugging/testing phase instead of using my real phone.

To pull (unload) the odk directory from your phone (or simulator) use:

adb pull /sdcard/odk/ your_preferred_location_in_your_pc

Please note that for pushing as well as for pulling, the phone should not be connected to pc while you’re working with a simulator and vice-versa.

Good luck