Wednesday, 13 July 2016

Help converting Tasker action to ADB shell am command



My goal is simple: Send a command through ADB to bluestacks (which i got working) to FakeGPS (which Is responding) to set GPS location to a specified lat/long (part that doesn't work)

First, background info

my environment is bluestacks 2, with FakeGPS (this one) installed as system app using LuckyPatcher

Setting a location directly in FakeGPS does work corectly - Good
I saw this on the FakeGPS page linked above:

Quote:









FAQ for integration with Tasker only (Example is lat 18.89768D long: -55.0365D) :
Create a new task and add Action -> Misc -> Send Intent
2. Edit:
- Action: com.incorporateapps.fakegps.ENGAGE (to Stop add a new task and use com.incorporateapps.fakegps.STOP)
- enter 1st extra: lat:18.89768D
- enter 2nd extra: lng:-55.0365D
the "D" at the end is important so add it!
- Target: Service




I tried it out with Tasker, and lo and behold, Tasker can indeed send intents to FakeGPS and FakeGPS will set the location correctly - Good

What I want to do is send an intent through ADB (source information here) so I can set the FakeGPS location inside bluestacks from a windows console window. I have gotten it to the point where FakeGPS will respond, but I cannot get it to go to the lat / lng I give it. IT always either does nothing, or goes to lat:0 lng:0.

Commands I have tried:

Code:


Connect to bluestacks:
adb connect 127.0.0.1:5555

adb -s 127.0.0.1:5555 shell am startservice -a com.incorporateapps.fakegps.ENGAGE --ef lat 41.0050073D --ef lng -28.4530577D
adb -s 127.0.0.1:5555 shell am startservice -a com.incorporateapps.fakegps.ENGAGE --ef lat 41.0050073 --ef lng -28.4530577
adb -s 127.0.0.1:5555 shell am startservice -a com.incorporateapps.fakegps.ENGAGE -e lat 41.0050073D -e lng -28.4530577D
adb -s 127.0.0.1:5555 shell am startservice -a com.incorporateapps.fakegps.ENGAGE -e lat 41.0050073 -e lng -28.4530577

adb -s 127.0.0.1:5555 shell am startservice -a com.incorporateapps.fakegps.ENGAGE --ef lat 41.0050073D --ef lon -28.4530577D
adb -s 127.0.0.1:5555 shell am startservice -a com.incorporateapps.fakegps.ENGAGE --ef lat 41.0050073 --ef lon -28.4530577
adb -s 127.0.0.1:5555 shell am startservice -a com.incorporateapps.fakegps.ENGAGE -e lat 41.0050073D -e lon -28.4530577D
adb -s 127.0.0.1:5555 shell am startservice -a com.incorporateapps.fakegps.ENGAGE -e lat 41.0050073 -e lon -28.4530577


I've also tried a few other things, but none of them got any sort of response from FakeGPS. From what I read in the intent documentation and the blurb quoted above, one of these SHOULD work, but none of them do. However I KNOW that what I want to do is possible because Tasker can successfully set the location. Can someone help me get this working from ADB?



No comments:

Post a Comment