I have a Android device which I keep connected with my Jenkins server(through USB) which basically run my automation every day at a specified time but every now and then I keep running into problems where device starts to loose charge overnight or when I am remotely accessing(Vysor) the device and run some automation tests on it , it starts to loose and eventually die down. I am looking for suggestion to keep my device up and running 24/7 without loosing charge when I am running my automation cases.
Asked
Active
Viewed 63 times
0
-
how is this Q related to programming? – AADProgramming Feb 16 '17 at 04:20
-
I think we have Android programmers and technicians here in this forum who can help answer this question. I dont think there is anything wrong with this question – vishal Feb 16 '17 at 04:21
-
And its directly effecting my ability to run automation tests on the device everyday – vishal Feb 16 '17 at 04:22
-
check this out .. is this programming question got 50 + like http://stackoverflow.com/questions/3803871/android-apps-communicating-with-a-device-plugged-in-the-usb-port?rq=1 – vishal Feb 16 '17 at 04:32
-
in 2010 this was a valid question to be asked @vishal and if you read all the answers and comments you will understand why – Nilabja Feb 16 '17 at 07:11
-
@Nilabja I dont want to be in unnecessary discussion ... just looking for answer/suggestions from the community on my particular issue – vishal Feb 16 '17 at 15:29
-
Interesting question. I am having an opposite problem. I would like to have a way to disconnect the device every once in a while from charging, in order to prevent battery swelling and requiring replacement about once a year. To me it seems there must be something wrong either in your device or on the Jenkins machine. Do you know which one turns off the charging? And what is your Jenkins machines OS? – diidu Feb 17 '17 at 09:23
-
@diidu I have EL Capitan 10.11.6 .. i actually searched on some other forums as well and looks like there is an options to sleep the the device when not it use and then wake it up we need to https://discuss.appium.io/t/lock-and-wake-unlock-the-device-screen-android-ruby/2601 – vishal Feb 17 '17 at 18:23
-
Yes, you can control the device but I don't think you can do USB level suspend and even in that case I am not sure if the phone would fully stop charging. We have the same OS, running on macmini, so it is really strange that we have completely opposite problems. I am going to add an answer that may have nothing to do with your problem, but on the other hand it may also help. – diidu Feb 27 '17 at 08:57
2 Answers
1
I had tried all of the options you mentioned. I am now using powered USB hub which keeps it charging on power 24/7.

vishal
- 640
- 1
- 5
- 21
0
There are some things that you can do to keep your Android device from going to sleep.
- enable developer mode (I assume you have done that already since you are running automatic tests).
- on settings->developer menu turn USB debugging on (again I assume this is already done)
- on settings->developer menu turn on Stay Awake so that the display never goes to sleep when the device is charging.
It may also be that the issue is with your device. In that case I suggest you try the same thing with some mainstream Android phone and see if the behavior differs.

diidu
- 2,823
- 17
- 32