无头Android模拟器:GPS定位即使在设置地理定位时也不起作用

无头Android模拟器:GPS定位即使在设置地理定位时也不起作用,android,testing,geolocation,android-emulator,Android,Testing,Geolocation,Android Emulator,摘要:在无头仿真器的仿真器控制台中输入地理修复不会设置moc位置数据。有解决办法吗 复制步骤: 1)使用命令启动模拟器 emulator -avd Pixel2API27 -no-window 2)使用命令设置位置数据 telnet localhost 5554 auth <auth Token> geo fix -121.45356 46.51119 4392 观察结果: Current Location Manager state: Location List

摘要:在无头仿真器的仿真器控制台中输入地理修复不会设置moc位置数据。有解决办法吗

复制步骤:

1)使用命令启动模拟器

  emulator -avd Pixel2API27 -no-window 
2)使用命令设置位置数据

 telnet localhost 5554
 auth <auth Token>
 geo fix -121.45356 46.51119 4392
观察结果:

Current Location Manager state:
  Location Listeners:
    Reciever[6ca7e93 listener UpdateRecord[passive com.google.android.gms(10013 foreground) Request[POWER_NONE passive fastest=0]]]
    Reciever[f7aded0 listener UpdateRecord[passive android(1000 foreground) Request[POWER_NONE passive fastest=+30m0s0ms]]]
    Reciever[c146ec9 listener UpdateRecord[passive android(1000 foreground) Request[POWER_NONE passive fastest=0]]]
    Reciever[6ea99ce listener UpdateRecord[passive com.google.android.gms(10013 foreground) Request[POWER_NONE passive fastest=0]]]
  Active Records by Provider:
    passive:
      UpdateRecord[passive android(1000 foreground) Request[POWER_NONE passive fastest=0]]
      UpdateRecord[passive android(1000 foreground) Request[POWER_NONE passive fastest=+30m0s0ms]]
      UpdateRecord[passive com.google.android.gms(10013 foreground) Request[POWER_NONE passive fastest=0]]
      UpdateRecord[passive com.google.android.gms(10013 foreground) Request[POWER_NONE passive fastest=0]]
  Overlay Provider Packages:
    network: com.google.android.gms
    fused: com.google.android.gms
  Historical Records by Provider:
    android: passive: Min interval 0 seconds: Max interval 1800 seconds: Duration requested 1 out of the last 1 minutes: Currently active
    com.google.android.gms: passive: Interval 0 seconds: Duration requested 0 out of the last 0 minutes: Currently active
  Last Known Locations:
  Last Known Locations Coarse Intervals:
  Geofences:
  Enabled Providers:
    fused
    passive
  mWhitelist=[] mBlacklist=[]
  Throttling Whitelisted Packages:

    com.google.android.gms
  fudger: offset: -83, 431 (meters)
passive Internal State:
mReportLocation=true
gps Internal State:
  mStarted=false
  mFixInterval=1000
  mDisableGps (battery saver mode)=false
  mEngineCapabilities=0x0 ( )
GNSS_KPI_START
  KPI logging start time: +11s943ms
  KPI logging end time: +1m18s661ms
  Number of location reports: 0
  Number of TTFF reports: 0
  Number of position accuracy reports: 0
  Number of CN0 reports: 0
GNSS_KPI_END
  native internal state: Gnss Debug Interface not available

network Internal State (com.google.android.gms):
REMOTE SERVICE name=network pkg=com.google.android.gms version=2
fused Internal State (com.google.android.gms):
REMOTE SERVICE name=fused pkg=com.google.android.gms version=1
注意:如您所见,最近的已知位置:为空


有人有想法吗?

我也有同样的问题,Rlupo07您找到解决办法了吗?Tayyab,我没有找到解决方案,也没有找到解决办法。
Current Location Manager state:
  Location Listeners:
    Reciever[6ca7e93 listener UpdateRecord[passive com.google.android.gms(10013 foreground) Request[POWER_NONE passive fastest=0]]]
    Reciever[f7aded0 listener UpdateRecord[passive android(1000 foreground) Request[POWER_NONE passive fastest=+30m0s0ms]]]
    Reciever[c146ec9 listener UpdateRecord[passive android(1000 foreground) Request[POWER_NONE passive fastest=0]]]
    Reciever[6ea99ce listener UpdateRecord[passive com.google.android.gms(10013 foreground) Request[POWER_NONE passive fastest=0]]]
  Active Records by Provider:
    passive:
      UpdateRecord[passive android(1000 foreground) Request[POWER_NONE passive fastest=0]]
      UpdateRecord[passive android(1000 foreground) Request[POWER_NONE passive fastest=+30m0s0ms]]
      UpdateRecord[passive com.google.android.gms(10013 foreground) Request[POWER_NONE passive fastest=0]]
      UpdateRecord[passive com.google.android.gms(10013 foreground) Request[POWER_NONE passive fastest=0]]
  Overlay Provider Packages:
    network: com.google.android.gms
    fused: com.google.android.gms
  Historical Records by Provider:
    android: passive: Min interval 0 seconds: Max interval 1800 seconds: Duration requested 1 out of the last 1 minutes: Currently active
    com.google.android.gms: passive: Interval 0 seconds: Duration requested 0 out of the last 0 minutes: Currently active
  Last Known Locations:
  Last Known Locations Coarse Intervals:
  Geofences:
  Enabled Providers:
    fused
    passive
  mWhitelist=[] mBlacklist=[]
  Throttling Whitelisted Packages:

    com.google.android.gms
  fudger: offset: -83, 431 (meters)
passive Internal State:
mReportLocation=true
gps Internal State:
  mStarted=false
  mFixInterval=1000
  mDisableGps (battery saver mode)=false
  mEngineCapabilities=0x0 ( )
GNSS_KPI_START
  KPI logging start time: +11s943ms
  KPI logging end time: +1m18s661ms
  Number of location reports: 0
  Number of TTFF reports: 0
  Number of position accuracy reports: 0
  Number of CN0 reports: 0
GNSS_KPI_END
  native internal state: Gnss Debug Interface not available

network Internal State (com.google.android.gms):
REMOTE SERVICE name=network pkg=com.google.android.gms version=2
fused Internal State (com.google.android.gms):
REMOTE SERVICE name=fused pkg=com.google.android.gms version=1