编程技术网

关注微信公众号,定时推送前沿、专业、深度的编程技术资料。

 找回密码
 立即注册

QQ登录

只需一步,快速开始

极客时间

[指南]在AARCH64-MAC上运行MACOS 12.3.1上的iOS构建

作者: ydaiming 2022-5-12 16:14:49 显示全部楼层 |阅读模式

[GUIDE] Building for ios on aarch64-mac running macos 12.3.1

Is your feature request related to a problem? Please describe.

Used feature template as not to get the bug label added and disrupt the team. This guide is meant as self reference as well as suggested changes for adding support for using python3 for team.

正如Docs中的Antistript团队所指出的那样,对Python2的支持已在MACOS 12.3中丢弃。对于X86_64 CPU,解决方案与从Python网站安装语言软件包一样简单,但是对于Aarch64 CPU,无需构建,将它们留在灰尘中。

The docs suggested creating symlink /usr/local/bin/python pointing at /usr/bin/python3, but this seems to hit some issue with xcode 13.3, macos 12.3.1, where xcode will try to install developer tools again if the symlink is created. I found no solution around this at all.

Instead, I went ahead and made the changes to move my current setup to use python3. I'm hoping this guide will help the team figure out needed changes to implement, as well as, a reference for me if I lose the progress I made earlier.

对于初学者,我要进行以下设置:NX工作区:12.4 Nativecript CLI:8.2.3 NativeScript IOS:8.2.3

变化

NativeScript CLI

First thing I had issue with is CLI refusing to work as command python -c 'import six' is failing, so I went ahead and fixed that ~/.npm-global/lib/node_modules/nativescript/node_modules/@nativescript/doctor/src/sys-info.js*:

// Change line 540 from:
// return [4, this.childProcess.exec("python -c \"import six\"")];
// to:
return [4, this.childProcess.exec("python3 -c \"import six\"")];

现在,运行CLI不应该失败。

NativeScript ios

在本节中,我正在进行很多更改,首先,我要在文件**之前进行更改:

path/to/projcet/node_modules/@nativescript/ios/framework/internal/metadata-generator-arm64/bin/build-step-metadata-generator.py
path/to/project/node_modules/@nativescript/ios/framework/internal/metadata-generator-x86_64/bin/build-step-metadata-generator.py
path/to/project/platforms/ios/internal/metadata-generator-arm64/bin/build-step-metadata-generator.py
path/to/project/platforms/ios/internal/metadata-generator-x86_64/bin/build-step-metadata-generator.py

Shebang价值需要更改:

# from:
# #!/usr/bin/env python
# to:
#!/usr/bin/env python3

And, the files themselves, needed to be changes as done by @NathanWalker here: NativeScript/ns-v8ios-runtime@1e0c0ce

*我正在展示全局NPM软件包位置,以允许读者轻松区分此文件是相对于全局软件包还是本地软件包。**此处更新的文件包括不需要更改,因为它们是x86_64 cpus的文件,我将其保留在这里,因为这是我所做的实际更改。

Describe the solution you'd like

没有 React

Describe alternatives you've considered

没有 React

Anything else?

没有 React

Please accept these terms I have searched the existing issues as well as StackOverflow and this has not been posted before I agree to follow this project's Code of Conduct
该问题来自:NativeScript/NativeScript/issues/9902 , 试试查看该项目更多issue.
腾讯云服务器 阿里云服务器
腾讯云服务器 腾讯云服务器
关注微信
^