Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在Apple Silicon 芯片的mac上运行 iOS App 的时候无法创建对象 #116

Open
yiiim opened this issue May 11, 2024 · 0 comments · Fixed by #117
Open

在Apple Silicon 芯片的mac上运行 iOS App 的时候无法创建对象 #116

yiiim opened this issue May 11, 2024 · 0 comments · Fixed by #117

Comments

@yiiim
Copy link

yiiim commented May 11, 2024

使用苹果芯片的mac 运行 iOS 的 App 会出现这个 bug,而且直接使用 xcode 运行无法复现,必须要先 xcode 运行后找到路径然后双击运行。
复现步骤:

  1. 在使用xcode中设备选中My mac(Designed for iPhone)
  2. 运行 App
  3. 终止运行 App
  4. 找到运行的app 的路径(控制台应该有输出)
  5. 双击运行

原因是

if ((uintptr_t)pointer > MACH_VM_MAX_ADDRESS) {
这句代码判断的最大虚拟内存,macOS的最大虚拟内存宏比iOS大, 然而可能是因为苹果的bug在macOS上运行iOS app是ASLR用的时macOS的,导致创建的对象地址甚至大于iOS最大的虚拟内存地址。直接用xcode运行的时候并没有启用ASLR所以正常。

调试的时候可以在xcode 中设置 Run 的 Launch 选项 Wait for the executable to be launched。然后双击启动。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant