Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown mobile command "setGeolocation" #834

Open
ErodriguezQA opened this issue Oct 31, 2024 · 1 comment
Open

Unknown mobile command "setGeolocation" #834

ErodriguezQA opened this issue Oct 31, 2024 · 1 comment

Comments

@ErodriguezQA
Copy link

I think that the mobile: setGeolocation is not available on the last stable version of UIAutomator2 since I get the following error:

WebDriverError: Unknown mobile command "setGeolocation". Only shell,execEmuConsoleCommand,startLogsBroadcast,stopLogsBroadcast,changePermissions,getPermissions,performEditorAction,getDeviceTime,startScreenStreaming,stopScreenStreaming,getNotifications,listSms,pushFile,pullFile,pullFolder,deleteFile,isAppInstalled,queryAppState,activateApp,removeApp,terminateApp,installApp,clearApp,startService,stopService,startActivity,broadcast,getContexts,lock,unlock,isLocked,refreshGpsCache,startMediaProjectionRecording,isMediaProjectionRecordingRunning,stopMediaProjectionRecording,getConnectivity,setConnectivity,hideKeyboard,isKeyboardShown,deviceidle,bluetooth,nfc,setUiMode,getUiMode,injectEmulatorCameraImage,sendTrimMemory,getPerformanceData,getPerformanceDataTypes,toggleGps,isGpsEnabled,getDisplayDensity,getSystemBars,statusBar,fingerprint,sendSms,gsmCall,gsmSignal,gsmVoice,powerAc,powerCapacity,networkSpeed,sensorSet,getCurrentActivity,getCurrentPackage,dragGesture,flingGesture,doubleClickGesture,clickGesture,longClickGesture,pinchCloseGesture,pinchOpenGesture,swipeGesture,scrollGesture,scrollBackTo,scroll,viewportScreenshot,viewportRect,deepLink,acceptAlert,dismissAlert,batteryInfo,deviceInfo,openNotifications,type,replaceElementValue,getAppStrings,installMultipleApks,backgroundApp,pressKey,screenshots,scheduleAction,getActionHistory,unscheduleAction,setClipboard,getClipboard commands are supported. when running "execute/sync" with method "POST" and args "mobile: setGeolocation"

Im using Appium through the last version available of WebdriverIO.
Appium version: 2.12.2
UIAutomator2 version: 3.8.0

The way I use said command is through the following method:

async setPosition(latitude, longitude, altitude){
    await driver.executeScript('mobile: setGeolocation',[{latitude,longitude,altitude}]);
}
@mykola-mokhnach
Copy link
Contributor

Please provide the full server log. Most likely your driver is out of date

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants