Android19连接iOS13个人热点失败

本文链接:https://www.cnblogs.com/obarong/p/11770028.html

现象

第一次连上,Android设备可以上网,分配到的IP是172.20.10.X。Android连上其他Wi-Fi,再连iOS13.1个人热点,分配到的IP是刚才连其他Wi-Fi时的IP。估计是iOS没有分配新的IP。

目的

修复连接问题。如果无法修复,则弹出提示框,引导用户用其他连接方式。

过程

查看Android设备IP

Android设备用USB连电脑,执行adb shell netcfg,wlan0是Android设备的IP。

iOS13.2也不行,只能做弹窗警告。

- (void)checkios13 {
    if (@available(iOS 13.0, *)) {
        [self showAlert];
    }
}

- (void)showAlert {
    UIAlertController *alert = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"str_alertTitle_info", nil)
                                                             message:NSLocalizedString(@"str_not_support_connect_ios13_ap", nil)
                                                      preferredStyle:UIAlertControllerStyleAlert];
    
    UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"str_alertOKButton_title", nil)
                                                            style:UIAlertActionStyleDefault
                                                          handler:nil];
    [alert addAction:defaultAction];
    [self presentViewController:alert animated:YES completion:nil];
}

结果

成功……告诉用户“暂不支持连接iOS13个人热点”。

临时解决办法:手动设置 IP 为 172.20.10.x,x 从 2~15 中取一个。子网掩码 255.255.255.240,或者网络前缀长度 28。默认网关 172.20.10.1。dns 可以用 114.114.114.114, 8.8.4.4。

附录

Xcode运行报错

Could not locate device support files.

Xcode11.1版本太低,iOS13.2版本太高,不能运行。

解:
下载beta版Xcode11.2或者下载13.2的SDK放到路径/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport

sdk下载链接: https://pan.baidu.com/s/1lnPDGSdUmEdk3Y5b0_4z7g 提取码: hirw

可能要重启Xcode。

参考

Beta Software - Download - Apple Developer
https://developer.apple.com/download/

iOS & iPadOS 13.2 Release Notes | Apple Developer Documentation
https://developer.apple.com/documentation/ios_ipados_release_notes/ios_ipados_13_2_release_notes?language=objc

Xcode真机调试报错:Could not locate device support files. - 简书
https://www.jianshu.com/p/38931f09ca0f

升级到IOS13有BUG 连接个人热点没有网络【iphone吧】_百度贴吧
http://tieba.baidu.com/p/6265197210

猜你喜欢

转载自www.cnblogs.com/obarong/p/11770028.html