Safari调试iOS web页面

Safari调试iOS web页面

前言:移动端web页面调试一直是前端的一大痛点,所幸的是,在iOS调试方面,可以利用mac safari去调试对应的web页面。

本文将简要介绍如何使用mac safari调试iOS web页面。

Safari设置

打开Safari偏好者设置,选中“高级菜单”,在页面最下方选中“在菜单中显示开发菜单”的复选框,这样设置完毕就能在Safari菜单中看到开发菜单了。

iPhone设置

打开iPhone手机设置app 选择Safari,找到高级选项,将JavaScript开关和web检查器开关都打开。

移动端Web页面调试

到此,准备工作完成。这时候使用USB数据线将iPhone链接到mac上,打开Safari浏览器,运行手机app里面的web页面,在开发菜单中选择连接的手机,找到调试的网页,就能在Safari里面调试了。

iOS App WebView调试

可以使用mac safari调试App Webview,但是需要对App项目进行相应的配置:

  • 修改Build Configuration:在Xcode中,点击运行/停止按钮右侧的项目名按钮,在弹出的下拉菜单中,往下拉,找到Edit Schema选项,进入到Edit Schema面板中。切换到Run面板,将 Build Configuration设置为Debug(取代Release)

  • 修改 Code Signing:在Xcode中,在文件目录树中选中项目名,显示出右侧的设置面板,选中 Build Settings面板。将Provision Profile设置为Automatic,将Code Sign Identity设置为iOS Developer

注意:修改完Code Signing之后,将会阻止你Release生产版本的App,如果要发布App请将Code Signing相关设置复原。

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
hex编码实现AES加密解密功能示例可以按照以下步骤进行: 1. 导入所需的模块: ```python import binascii from Crypto.Cipher import AES from Crypto.Random import get_random_bytes ``` 2. 定义AES加密和解密函数: ```python def encrypt(plain_text, key): cipher = AES.new(key, AES.MODE_EAX) nonce = cipher.nonce ciphertext, tag = cipher.encrypt_and_digest(plain_text.encode()) return binascii.hexlify(nonce + ciphertext + tag).decode() def decrypt(cipher_text, key): cipher_data = binascii.unhexlify(cipher_text) nonce = cipher_data[:16] ciphertext = cipher_data[16:-16] tag = cipher_data[-16:] cipher = AES.new(key, AES.MODE_EAX, nonce) decrypted_text = cipher.decrypt_and_verify(ciphertext, tag) return decrypted_text.decode() ``` 3. 生成随机密钥: ```python key = get_random_bytes(16) ``` 4. 加密和解密示例数据: ```python plain_text = "This is a sample plaintext." cipher_text = encrypt(plain_text, key) decrypted_text = decrypt(cipher_text, key) ``` 完整的代码示例如下: ```python import binascii from Crypto.Cipher import AES from Crypto.Random import get_random_bytes def encrypt(plain_text, key): cipher = AES.new(key, AES.MODE_EAX) nonce = cipher.nonce ciphertext, tag = cipher.encrypt_and_digest(plain_text.encode()) return binascii.hexlify(nonce + ciphertext + tag).decode() def decrypt(cipher_text, key): cipher_data = binascii.unhexlify(cipher_text) nonce = cipher_data[:16] ciphertext = cipher_data[16:-16] tag = cipher_data[-16:] cipher = AES.new(key, AES.MODE_EAX, nonce) decrypted_text = cipher.decrypt_and_verify(ciphertext, tag) return decrypted_text.decode() key = get_random_bytes(16) plain_text = "This is a sample plaintext." cipher_text = encrypt(plain_text, key) decrypted_text = decrypt(cipher_text, key) print("Plain text:", plain_text) print("Encrypted text:", cipher_text) print("Decrypted text:", decrypted_text) ``` 这样,就可以使用hex编码实现AES加密解密功能了。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值