如何在真实设备上调试地理定位制作离子应用程序?我正在使用 ionic cordova run android --device --livereload 命令,它使用IP(不是localhost),我得到 Only secure origins are allowed. 错误 .

有没有办法在与USB连接的真实设备上调试应用程序?

获得职位的代码:

odswiezGps() {
    this.geolocation.getCurrentPosition({
        enableHighAccuracy: true
    }).then((resp) => {
        this.gps = resp;
        console.log(resp);
    }).catch((error) => {
        console.log('Error getting location', error);
    });
}