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

feat: Add support for setting altitude, satellites count and velocity in emulator #571

Merged
merged 5 commits into from
Jul 1, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat: Add support for setting altitude in emulator
  • Loading branch information
mykola-mokhnach committed Jul 1, 2021
commit 1465c278e36b9d6c47f167591ed43ca7c5b5d9d0
8 changes: 6 additions & 2 deletions lib/tools/settings-client-commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,13 @@ commands.setGeoLocation = async function setGeoLocation (location, isEmulator =
const speed = formatLocationValue('speed', false);
if (isEmulator) {
await this.resetTelnetAuthToken();
await this.adbExec(['emu', 'geo', 'fix', longitude, latitude]);
const args = [longitude, latitude];
if (!_.isNil(altitude)) {
args.push(altitude);
}
await this.adbExec(['emu', 'geo', 'fix', ...args]);
// A workaround for https://code.google.com/p/android/issues/detail?id=206180
await this.adbExec(['emu', 'geo', 'fix', longitude.replace('.', ','), latitude.replace('.', ',')]);
await this.adbExec(['emu', 'geo', 'fix', ...(args.map((arg) => arg.replace('.', ',')))]);
} else {
const args = [
'am', 'startservice',
Expand Down