Theos编译打包过程中出现的问题及解决方案xcrun: error: SDK "iphoneos" cannot be located xcrun: error: SDK "iphoneos" c

一、使用make命令编译,出现如下问题

xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
==> Error: You do not have an SDK in /Library/Developer/CommandLineTools/Platforms/iPhoneOS.platform/Developer/SDKs or /opt/theos/sdks.

make: *** [before-all] Error 1

查找原因:一般SDK问题和Xcode有关系

mac$ xcode-select --print-path /Library/Developer/CommandLineTools
发现是这个Xcode路径判断错误。
mac$ xcodebuild -showsdks
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
 

解决方法:给Xcode命令行工具指定路径 或者在有多个xcode命令行工具版本的时候,指定使用哪个版本的命令行工具

mac$ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer/
 

 

二、使用make编译的tweak的时候,出现如下错误

==> Error: The vendor/include and/or vendor/lib directories are missing. Please run `git submodule update --init --recursive` in your Theos directory. More information: https://github.com/theos/theos/wiki/Installation.

make: *** [before-all] Error 1

 

此问题是由于缺少以来文件造成的,解决方案也很简单,直接根据报错的提示, 进入theos目录 sudo运行 sudo git submodule update --init —recursive

sudo git submodule update --init —recursive

 

出现一下结果,则表示安装依赖成功,即可再次运行make命令进行编译(代码中。 表示上面还有相应信息,只是过多,以。省略)

。

。

。

Submodule path 'vendor/include/LightMessaging': checked out '7a8e049c4059e1df1ff2f9669afa7ca4eedfb65b'

Submodule path 'vendor/include/libactivator': checked out 'bfac8ee70e8ad6560305dc7f0fa586c1b5696ef1'

Submodule path 'vendor/include/rocketbootstrap': checked out 'bd54f4ac8452ce2dc2978459afc262440ce94f19'

Submodule 'LightMessaging' (git://github.com/rpetrich/LightMessaging.git) registered for path 'vendor/include/rocketbootstrap/LightMessaging'

Cloning into '/opt/theos/vendor/include/rocketbootstrap/LightMessaging'...

Submodule path 'vendor/include/rocketbootstrap/LightMessaging': checked out '496257b11c3e906333797639355db9a43015eb50'

Submodule path 'vendor/lib': checked out ‘639633b40f1b3e0b9cedfad7ec1feab2e5432033'

 

 

三、使用make命令编译时出现以下错误

*** No rule to make target `/Users/EBICOM/Desktop/打?', needed by `/Users/EBICOM/Desktop/打包文件/Tweak/iosreproject/.theos/obj/debug/armv7/iOSReProject.dylib'.  Stop.

make[2]: *** [/Users/EBICOM/Desktop/打包文件/Tweak/iosreproject/.theos/obj/debug/armv7/iOSReProject.dylib] Error 2

make[1]: *** [internal-library-all_] Error 2

make: *** [iOSReProject.all.tweak.variables] Error 2

出现此错误的原因是我路径中存在中文‘打包文件’, 将路径中的中文路径去除或改为英文路径即可

再次打包编译

EBICOM-Domino:iosreproject EBICOM$ make

> Making all for tweak iOSReProject…

==> Preprocessing Tweak.xm…

==> Compiling Tweak.xm (armv7)…

==> Linking tweak iOSReProject (armv7)…

clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of iOS 7 [-Wdeprecated]

==> Preprocessing Tweak.xm…

==> Compiling Tweak.xm (arm64)…

==> Linking tweak iOSReProject (arm64)…

clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of iOS 7 [-Wdeprecated]

==> Merging tweak iOSReProject…

==> Signing iOSReProject…

EBICOM-Domino:iosreproject EBICOM$ 

以上信息则表示编译成功,或生成obj文件夹,及theos编译文件夹。 obj文件夹会生成 项目名称.dylib文件,这个即是核心文件了

 

注:项目名称.dylib文件 在obj文件夹中, 但不在项目下的obj文件夹, 而是在项目下的theos文件夹下的 obj文件夹中, theos文件夹为隐藏状态, 将隐藏文件夹设置为可见,即可找到相应的文件

 

 

四、使用make编译完成文件之后,再次make 会报错 make[2]: Nothing to be done for `internal-library-compile’.

原因是make编译文件已经存在,系统检测不需要再次编译

解决方法:清除编译生成的文件,使用命令:

 make clean

 

 

五、使用make package打包出现如下错误:

dpkg-deb: error: obsolete compression type 'lzma'; use xz instead Type dpkg-deb --help for help about manipulating *.deb files; Type dpkg --help for help about installing and deinstalling packages. make: *** [internal-package] Error 2

这是由于theos升级之后,打包格式跟着变化造成的

 

解决方案是按以下路径找到该文件修改其内容
/opt/theos/makefiles/package/deb.mk
找到第六行

_THEOS_PLATFORM_DPKG_DEB_COMPRESSION ?= lzma

将其改为

_THEOS_PLATFORM_DPKG_DEB_COMPRESSION ?= xz

clean之后再次打包,则可正常打包

 

七、使用命令make package install打包安装,出现以下错误:

==> Error: /Applications/Xcode.app/Contents/Developer/usr/bin/make install requires that you set THEOS_DEVICE_IP in your environment.

==> Notice: It is also recommended that you have public-key authentication set up for root over SSH, or you will be entering your password a lot.

 

这是由于没有设置ip或者ip位置放置错误造成的

解决方法是: 在Makefile中设置THEOS_DEVICE_IP 并将其置为文件第一下,设置如下:

export THEOS_DEVICE_IP = 192.168.x.x(手机ip) 并将其放在makefile的第一行

 

 

八、使用命令make package install打包安装,出现以下错误:

dpkg-deb (subprocess): unable to execute decompressing archive member (xz): No such file or directory

dpkg-deb (subprocess): subprocess decompressing archive member returned error exit status 2

tar: This does not look like a tar archive

tar: Exiting with failure status due to previous errors

dpkg-deb: error: subprocess tar returned error exit status 2

dpkg: error processing archive /tmp/_theos_install.deb (--install):

 subprocess dpkg-deb --control returned error exit status 2

Errors were encountered while processing:

 /tmp/_theos_install.deb

make: *** [internal-install] Error 1

 

这个问题和问题五是一样的,也是打包安装格式的问题

解决方法: 

解决方案是按以下路径找到该文件修改其内容

/opt/theos/makefiles/package/deb.mk
找到第六行, 将修改过的

​​​​​​​_THEOS_PLATFORM_DPKG_DEB_COMPRESSION ?= xz

将其改为

 _THEOS_PLATFORM_DPKG_DEB_COMPRESSION ?= gzip

再次打包安装,则可顺利进入ssh步骤

 

你可能感兴趣的:(iOS越狱及开发)