iPad mini2降级iOS10.3.3

我的iPad mini2由于更新到12.4后卡顿,犹豫前后终于进行降级操作。

按照威锋网的一个帖子进行操作,本帖为我的踩坑贴汇总。

安装环境报错

使用pip3 install -r requirements.txt进行安装

bsdiff4 (setup.py) … error

Requirement already satisfied: six==1.13.0 in /Library/Python/3.8/site-packages (from -r requirements.txt (line 10)) (1.13.0)
Building wheels for collected packages: bsdiff4, pyusb
Building wheel for bsdiff4 (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /Library/Developer/CommandLineTools/usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/53/1v8ykf513138zrvp2th76l640000gn/T/pip-install-bhzlo3bb/bsdiff4_cc62a057fa494a5b92e99f21441ab6d2/setup.py'"'"'; __file__='"'"'/private/var/folders/53/1v8ykf513138zrvp2th76l640000gn/T/pip-install-bhzlo3bb/bsdiff4_cc62a057fa494a5b92e99f21441ab6d2/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/53/1v8ykf513138zrvp2th76l640000gn/T/pip-wheel-pm9ph9rp
​    cwd: /private/var/folders/53/1v8ykf513138zrvp2th76l640000gn/T/pip-install-bhzlo3bb/bsdiff4_cc62a057fa494a5b92e99f21441ab6d2/
 Complete output (114 lines):
 running bdist_wheel
 running build
 running build_py
 creating build
 creating build/lib.macosx-10.14.6-x86_64-3.8
 creating build/lib.macosx-10.14.6-x86_64-3.8/bsdiff4
 copying bsdiff4/test_all.py -> build/lib.macosx-10.14.6-x86_64-3.8/bsdiff4
 copying bsdiff4/__init__.py -> build/lib.macosx-10.14.6-x86_64-3.8/bsdiff4
 copying bsdiff4/format.py -> build/lib.macosx-10.14.6-x86_64-3.8/bsdiff4
 copying bsdiff4/cli.py -> build/lib.macosx-10.14.6-x86_64-3.8/bsdiff4
 running build_ext
 building 'bsdiff4.core' extension
 creating build/temp.macosx-10.14.6-x86_64-3.8
 creating build/temp.macosx-10.14.6-x86_64-3.8/bsdiff4
 clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c bsdiff4/core.c -o build/temp.macosx-10.14.6-x86_64-3.8/bsdiff4/core.o
 In file included from bsdiff4/core.c:9:
 In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:11:
 In file included from /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include/limits.h:21:
 In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/limits.h:63:
 /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/cdefs.h:807:2: error: Unsupported architecture
 \#error Unsupported architecture
  ^
 In file included from bsdiff4/core.c:9:
 In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:11:
 In file included from /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include/limits.h:21:
 In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/limits.h:64:
 /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/machine/limits.h:8:2: error: architecture not supported
 \#error architecture not supported
  ^
 In file included from bsdiff4/core.c:9:
 In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:25:
 In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:64:
 In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h:71:
 In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_types.h:27:
 In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:33:
 /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/machine/_types.h:34:2: error: architecture not supported
 \#error architecture not supported
  ^
 In file included from bsdiff4/core.c:9:
 In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:25:
 In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:64:
 In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h:71:
 In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_types.h:27:
 /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:55:9: error: unknown type name '__int64_t'
 typedef __int64_t    __darwin_blkcnt_t;   /* total blocks */
​     ^
 /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:56:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
 typedef __int32_t    __darwin_blksize_t;   /* preferred block size */
​     ^
 note: '__int128_t' declared here
 /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:57:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
 typedef __int32_t    __darwin_dev_t;     /* dev_t */
​     ^
 note: '__int128_t' declared here
 /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:60:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
 typedef __uint32_t   __darwin_gid_t;     /* [???] process and group IDs */
​     ^
 note: '__uint128_t' declared here
 /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:61:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
 typedef __uint32_t   __darwin_id_t;     /* [XSI] pid_t, uid_t, or gid_t*/
​     ^
 note: '__uint128_t' declared here
 /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:62:9: error: unknown type name '__uint64_t'
 typedef __uint64_t   __darwin_ino64_t;    /* [???] Used for 64 bit inodes */
​     ^
 /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:68:9: error: unknown type name '__darwin_natural_t'
 typedef __darwin_natural_t __darwin_mach_port_name_t; /* Used by mach */
​     ^
 /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:70:9: error: unknown type name '__uint16_t'; did you mean '__uint128_t'?
 typedef __uint16_t   __darwin_mode_t;    /* [???] Some file attributes */
​     ^
 note: '__uint128_t' declared here
 /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:71:9: error: unknown type name '__int64_t'
 typedef __int64_t    __darwin_off_t;     /* [???] Used for file sizes */
​     ^
 /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:72:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
 typedef __int32_t    __darwin_pid_t;     /* [???] process and group IDs */
​     ^
 note: '__int128_t' declared here
 /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:73:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
 typedef __uint32_t   __darwin_sigset_t;   /* [???] signal set */
​     ^
 note: '__uint128_t' declared here
 /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:74:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
 typedef __int32_t    __darwin_suseconds_t;  /* [???] microseconds */
​     ^
 note: '__int128_t' declared here
 /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:75:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
 typedef __uint32_t   __darwin_uid_t;     /* [???] user IDs */
​     ^
 note: '__uint128_t' declared here
 /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:76:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
 typedef __uint32_t   __darwin_useconds_t;  /* [???] microseconds */
​     ^
 note: '__uint128_t' declared here
 In file included from bsdiff4/core.c:9:
 In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:25:
 In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:64:
 In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h:71:
 /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_types.h:43:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
 typedef __uint32_t   __darwin_wctype_t;
​     ^
 note: '__uint128_t' declared here
 In file included from bsdiff4/core.c:9:
 In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:25:
 In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:64:
 In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h:75:
 In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types/_va_list.h:31:
 /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/machine/types.h:37:2: error: architecture not supported
 \#error architecture not supported
  ^
 fatal error: too many errors emitted, stopping now [-ferror-limit=]
 20 errors generated.
 error: command 'clang' failed with exit status 1
   ...

   Check the logs for full command output.

修复

sudo -H

首个踩坑:

WARNING: The directory '/Users/xxx/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

继续修复

参考:What is the meaning of “Failed building wheel for X” in pip install?

使用pip3 -v,可见有pip3使用:pip install wheel,出现下列问题:

zsh:command cannot found pip

参考:zsh command cannot found pip

要点:创建pip3环境变量

查找pip3的路径:pip3 -V

创建alias:alias pip=/usr/bin/pip3放在zshrc内,之后source ~/.zshrc

–user权限问题

在更新pip时,版本从19-21,报出权限问题:[1]

Consider using the `--user` option or check the permissions.

参考:Could not install packages due to an EnvironmentError: Errno 13

使用pip3 install package_name --user更新pip,成功。

找到了一个issue

参考GitHub issue:Running setup.py install for bsdiff4 … error

–user应该放在后面,添加zchrc,当然之后也要source:

export ARCHFLAGS="-arch x86_64"

python3 -m pip install --user -r requirements.txt

使用以下命令安装成功:

python3 -m pip install --user -r requirements.txt

结果:

Requirement already satisfied: six==1.13.0 in /Library/Python/3.8/site-packages (from -r requirements.txt (line 10)) (1.13.0)

Building wheels for collected packages: bsdiff4

 Building wheel for bsdiff4 (setup.py) ... done

 Created wheel for bsdiff4: filename=bsdiff4-1.1.9-cp38-cp38-macosx_10_14_6_x86_64.whl size=12710 sha256=fe15fdacfe95ad6a085f38ac34c501937a582d632191b4053ede8afc76f0c938

 Stored in directory: /Users/penghaoxiong/Library/Caches/pip/wheels/94/a6/ac/6d5b7fdb7c73297adee2e9f7181664b33234cecfd1eb34280c

Successfully built bsdiff4

Installing collected packages: bsdiff4

 WARNING: The scripts bsdiff4 and bspatch4 are installed in '/Users/penghaoxiong/Library/Python/3.8/bin' which is not on PATH.

 Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

Successfully installed bsdiff4-1.1.9

开始降级

Catalina

在终端中输入CatalinaFix.sh,使用打开方式无效。

usb.core.NoBackendError: No backend available

参考:iPad mini2 Vieux降级ios10.3.3 问题解决合集

需要安装usbilb:brew install libusb

当前(2021年7月)下载,可能会提示:

Starting iBSS/iBEC patching
Looks like you are downgrading an iPad Mini 2 to 10.3.3!
Patched iBSS/iBEC
About to re-build IPSW
Entering PWNREC mode...
Getting SHSH...
Restoring...
Note that errors about 'BbSkeyId', 'FDR Client', 'BasebandFirmware Node' and 'ERROR: zip_name_locate: Firmware/all_flash/manifest' are not important.
Just ignore them and only report errors that actually stop the restore.
Restoring without a baseband as your iPad4,4 doesn't have cellular capabilities...
WARNING: Unable to find BbChipID node
WARNING: Unable to find BbChipID node
Files cleaned.
Finished! Enjoy your downgraded device :)
penghaoxiong@PenghaoXiongs-MacBook-Pro Vieux-master %

便降级成功了。


Choose an IPSW for the iPad Mini 2 (WiFi)

MatthewPierson / Vieux


  1. 此处由于安装完brew的python3之后总结,故报错信息不完整,但意思还是到了。 ↩︎

 wechat
产品北里,讲述产品和人性、涉及设计、技术和运营的公众号。
你们的赞赏是我更新的动力~