Cannot set altitude by setlocation
See original GitHub issueThe problem
Cannot set altitude by setlocation
Environment
- Appium version (or git revision) that exhibits the issue: 1.14.0-beta.2
- Last Appium version that did not exhibit the issue (if applicable): N/A
- Desktop OS/version used to run Appium: macOS 10.14.5
- Node.js version (unless using Appium.app|exe): v12.4.0
- Npm or Yarn package manager: npm
- Mobile platform/version under test: Android 9
- Real device or emulator/simulator: Real device
- Appium CLI or Appium.app|exe: CLI
Details
Just called below codes from python-client, but altitude isn’t updated to args.
SampleAndroidTest.py
def test_01_test_name(self):
self.driver.set_location(121.21, 11.56, 10)
import time
time.sleep(10)
print(self.driver.location)
Terminal
➜ app_apidemo git:(master) ✗ python SampleAndroidTest.py
test_01_test_name (__main__.SimpleTest) ... {'latitude': 121.21, 'longitude': 11.56, 'altitude': 5e-324}
ok
----------------------------------------------------------------------
Ran 1 test in 25.996s
OK
I can set altitude by executing below adb commands.
➜ app_apidemo git:(master) ✗ adb -P 5037 -s 13f1fd2c shell am startservice -e longitude 11.56 -e latitude 121.21 -e altitude 0 io.appium.settings/.LocationService
Starting service: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=io.appium.settings/.LocationService (has extras) }
➜ app_apidemo git:(master) ✗ adb -P 5037 -s 13f1fd2c shell am broadcast -n io.appium.settings/.receivers.LocationInfoReceiver -a io.appium.settings.location
Broadcasting: Intent { act=io.appium.settings.location flg=0x400000 cmp=io.appium.settings/.receivers.LocationInfoReceiver }
Broadcast completed: result=-1, data="121.21000 11.56000 0.00000"
➜ app_apidemo git:(master) ✗ adb -P 5037 -s 13f1fd2c shell am startservice -e longitude 11.56 -e latitude 121.21 -e altitude 10 io.appium.settings/.LocationService
Starting service: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=io.appium.settings/.LocationService (has extras) }
➜ app_apidemo git:(master) ✗ adb -P 5037 -s 13f1fd2c shell am broadcast -n io.appium.settings/.receivers.LocationInfoReceiver -a io.appium.settings.location
Broadcasting: Intent { act=io.appium.settings.location flg=0x400000 cmp=io.appium.settings/.receivers.LocationInfoReceiver }
Broadcast completed: result=-1, data="121.21000 11.56000 10.00000"
Link to Appium logs
https://gist.github.com/ki4070ma/729244eb37734209fbcbe0d1bae5e9fc
https://gist.github.com/ki4070ma/729244eb37734209fbcbe0d1bae5e9fc#file-appium_logs-L185-186
Although passing 10
as altitude to the server, but 10
isn’t used during executing adb.
[debug] [W3C (d1034c44)] Calling AppiumDriver.setGeoLocation() with args: [{"latitude":121.21,"longitude":11.56,"altitude":10},"d1034c44-82e4-43cf-a63a-fd0aaa9f8e04"]
[debug] [ADB] Running '/Users/atsushimori/Library/Android/sdk/platform-tools/adb -P 5037 -s 13f1fd2c shell am startservice -e longitude 11.56 -e latitude 121.21 io.appium.settings/.LocationService'
Code To Reproduce Issue [ Good To Have ]
As above.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
JComponent setSize() and setLocation() not working
Rectangle r = new Rectangle(x, y, length, length); will always put the rectangle at x, y. I tried using setLocation, using a different...
Read more >How to set location, altitude, airspeed, heading - X-Plane.org
Using XP 11, I cannot (1) position the aircraft except on an airport, (2) set altitude, (3) set airspeed and (4) set heading....
Read more >Set Altitude when jumping to latitude/longitude C# ...
How to set altitude when I jump to a latitude / longitude C# SIMCONNECT ? I use this to jump to the location...
Read more >javax.swing.JFrame.setLocation java code examples - Tabnine
frame.pack(); frame.setLocation(location, Toolkit.getDefaultToolkit().getScreenSize().height - 400);
Read more >Cannot set location parameters at startup - APT Forum
Cannot set to elevation. Cannot set UTC time. I am using a Celestron AVX mount and it has been aligned. APT is connected...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We can still mention it only works on real devices
yes, this documentation has to be fixed. Altitude support has never been there