我要评分
获取效率
正确性
完整性
易理解

Example Configuration

  1. Call the setprop method to set property values. The following uses gps.mock.latitude and gps.mock.longitude as an example. The methods for setting other properties are the same.
    # setprop persist.gps.mock.latitude 30.188433
    # setprop persist.gps.mock.longitude 120.193818
  2. Check the current GPS properties.
    # getprop | grep "persist.gps.mock."

    To query string texts on Windows, use the findstr command instead of the grep command. In the following scenarios where the grep command is used in this chapter, perform operations based on your service scenario.

    # getprop | findstr "persist.gps.mock."
  3. Query the GPS data of the location service. Run the following command in the container to query the latest GPS data:
    # dumpsys location | grep -A 1 "gps provider:"
  4. Check whether the GPS properties take effect based on the returned value.

    Returned Frame Parameter

    Description

    gps

    Location information. The format is [Latitude],[Longitude].

    hAcc

    Current positioning precision, in meters.

    alt

    Altitude, in meters.

    bear

    Current steering angle, in degrees.

    vel

    Current moving speed, in meters per second.

  5. Check whether the GPS data of the system properties is consistent with the GPS data of the location service.