ios如何检测gps篡改xcode



ios如何检测xcode上的gps篡改,它带有xcode上的"模拟位置",是否有一种方法可以检测由它引起的gps篡改?

xcode的调试输出区有一个名为"模拟位置"的按钮;它允许你模拟不同国家的位置,当你使用CLLocation获取位置时,它将输出模拟器选择的国家的位置。

CLLocationManager *manager = [[CLLocationManager alloc] init];
[CLLocationManager authorizationStatus];
manager.delegate = self;
manager.desiredAccuracy = kCLLocationAccuracyBest;
[manager requestAlwaysAuthorization];
[manager startUpdatingLocation];
if( [CLLocationManager locationServicesEnabled] ) {
CLLocation *location = [manager location];  //maybe other country
NSLog(@"%@", location);
}

最新更新