I have a headless pi3 running Android things. My app is an irrigation system. It's out in a greenhouse, so I connect to it via wifi. I have the app running by default on boot.

I can change code, uninstall/reinstall with Android Studio, and everything works as I'd expect.

However, if I reboot the pi, the code that runs when the pi reboots is about three weeks out of date - an old version I've superseded. Using ADB to uninstall the app doesn't remove this copy. I've tried cleaning the project too. I'd reinstall Things and start again, but the pi now has lots of wires connecting it to lots of solenoid valves, and I'd really rather not undo that, especially as this issue might reoccur later.

Any suggestions as to what's going on, and how I can get rid of this old code and get my pi to boot up and run the most recent version?



  • How are you verifying the uninstall is not working? Does it continue to show up when you run pm list packages -3? – Nick Felker Mar 15 '19 at 22:03
  • Are you starting some code automatically at boot time? If so, how?; e.g. crontab, systemd, rc.local, etc. Can you share the code that starts it automatically? – Seamus Mar 15 '19 at 23:02
  • Nick, when I run pm list packages -3 before the uninstall, I see my app listed (the only app). After uninstall, it is not listed. – pir8ped Mar 16 '19 at 7:28
  • @Seamus, auto start is easy in Android things. I just have this in my AndroidManifest.xml:<activity android:name="com.irrigator.HomeActivity"> <!-- Launch activity as default from Android Studio --> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.HOME" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> – pir8ped Mar 16 '19 at 7:28
  • I have also tried running the code here to get rid of that old version link. The app is still running! – pir8ped Mar 16 '19 at 7:42

This isn't much of an answer as it doesn't explain why I was getting that old code running when I rebooted the pi that I couldn't get rid of.

I've got rid of it now, reinstalling Things and the app. Hopefully, I won't end up with a 'shadow' copy of my app in the future...

Thanks for the suggestions.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.