在 unix 世界中,/tmp 文件夹大部分时间与当前运行的操作系统不在同一个文件系统上。
在 Forge 中构建/打包 IOS 应用程序使用临时文件夹和 python 函数os.rename
,它是 shellrename
命令的包装器。此命令不能在不同的文件系统上工作。
以下是 forge 运行遇到的错误:
[DEBUG] Making Payload directory
[ERROR] [Errno 18] Invalid cross-device link
[DEBUG] Traceback (most recent call last):
File "/home/<user>/TriggerToolkit/build-tools/forge/async.py", line 96, in run
result = self._target(*self._args, **self._kwargs)
File "/home/<user>/TriggerToolkit/trigger/api/app.py", line 286, in run
forge_main.run(['--general.interactive', 'no'])
File "/home/<user>/TriggerToolkit/build-tools/forge/main.py", line 437, in run
build_to_run=build_to_run,
File "/home/<user>/forge-workspace/sfjozog/.template/generate_dynamic/customer_goals.py", line 126, in run_app
build_to_run.run()
File "/home/<user>/forge-workspace/sfjozog/.template/generate_dynamic/build.py", line 337, in run
self._call_with_params(task_method, task_args)
File "/home/<user>/forge-workspace/sfjozog/.template/generate_dynamic/build.py", line 296, in _call_with_params
return method(self, *params)
File "/home/<user>/forge-workspace/sfjozog/.template/generate_dynamic/ios_tasks.py", line 626, in run_ios
certificate_password=certificate_password,
File "/home/<user>/forge-workspace/sfjozog/.template/generate_dynamic/ios_tasks.py", line 571, in run_idevice
certificate_password=certificate_password,
File "/home/<user>/forge-workspace/sfjozog/.template/generate_dynamic/ios_tasks.py", line 387, in create_ipa_from_app
self._create_entitlements_file(build, temp_file_path)
File "/home/<user>/forge-workspace/sfjozog/.template/generate_dynamic/ios_tasks.py", line 323, in _create_entitlements_file
_replace_in_file(temp_file_path, 'APP_ID', bundle_id)
File "/home/<user>/forge-workspace/sfjozog/.template/generate_dynamic/ios_tasks.py", line 318, in _replace_in_file
os.rename(tmp_file, filename)
OSError: [Errno 18] Invalid cross-device link
- - 编辑 - -
这是一个启用了 Facebook 连接的应用程序(如您所见,它试图替换 APP_ID)
- - 编辑 - -
通过手动更改 python 源文件中使用的函数(在 .templates/ 目录中),这是可行的(所以 shutil.move 是唯一的解决方案)