问题描述
我一直在四处寻找如何将xcode用于越狱开发.
I have been looking around for learning how xcode can be used for jailbreak development.
我有Lion和越狱的iPhone3G和不支持iPhone3G的xcode4.6.
I have Lion and jailbroken iPhone3G and xcode4.6 which doesnt support iPhone3G.
我已经安装了ldid
,但不知道如何使用它.
I have installed ldid
but have no idea how to use it.
我也必须创建启动守护程序,并将其附加到我的应用程序中.我已经按照此教程制作了守护程序,但是我陷入了在xcode中创建开放式工具链模板的设置中.我遵循了每个步骤,但是我的xcode没有显示任何用于打开工具链的模板. 真的需要开放工具链模板吗?
I have to make launch daemons, too, and attach them with my application. I have followed this tutorial for making a daemon but i got stuck in the setup for creating an open tool chain template in xcode. I followed every step but my xcode is not showing any template for open tool chain. Is it really required to have open tool chain template?
推荐答案
您是对的. Xcode 4.6不支持iPhone 3G.您可以安装旧版本的Xcode吗?例如,Xcode 4.4仍支持3G.
You're right. Xcode 4.6 doesn't support the iPhone 3G. Can you install an older version of Xcode? For example, Xcode 4.4 still supports the 3G.
您可以选择将Xcode的旧版本安装在其他文件夹中,以免覆盖新版本(例如,安装到/Developer-old/
或其他版本).
You can choose to install the old version of Xcode in a different folder, so that it doesn't overwrite the new version (for example, install to /Developer-old/
or something).
一旦安装了旧的Xcode版本,就可以导航到安装目录并查找名为:
Once you install the old Xcode version, you can navigate to the installation directory and look for the directory named:
(或者可能也可以使用iPhoneOS5.1.sdk).然后,将整个文件夹复制到新的Xcode 4.6安装目录中.例如:
(or probably iPhoneOS5.1.sdk would work, too). Then, copy that entire folder into the new Xcode 4.6 installation directory. For example:
之后,您应该看到以下内容:
Afterwards, you should see this:
安装了5.0 SDK之后,您现在可以使用Xcode 4.6为iPhone 3G构建应用程序.现在,您还可以根据需要卸载Xcode 4.4. 在其他问题中查看有关此内容的更多信息.关键是您将为armv6
(仅)构建应用程序. Armv6是iPhone 3G的处理器.
With the 5.0 SDK installed, you can now build apps for the iPhone 3G, using Xcode 4.6. You can also now uninstall Xcode 4.4 if you want. See more about this in this other question. The key is that you will be building your app for armv6
(only). Armv6 is the iPhone 3G's processor.
第二步是在Xcode中关闭关闭代码签名.在您的项目设置中,将供应配置文件设置为不进行代码签名. 您必须修改Xcode配置文件以允许您执行此操作.
The second step is to turn off code-signing within Xcode. In your project settings, you set the provisioning profile to Don't Code Sign. You must modify an Xcode configuration file to allow you to do this.
现在,您可以在Xcode中构建应用程序.完成后,导航至Mac上已构建应用程序的目录(MyAppName.app/
文件夹所在的目录).然后,您使用 ldid 来伪造代码对应用可执行文件进行签名:
Now you build the app in Xcode. When you're done, navigate to the directory on your Mac where the app has been built (where the MyAppName.app/
folder is). Then, you use ldid to fake code sign the app executable:
ldid -S MyAppName.app/MyAppName
现在,您的应用具有伪造的代码签名,可以在越狱的手机上运行.
Now, your app has a fake code signature that will allow it to run on a jailbroken phone.
然后,您使用ssh
或scp
或其他方式将其传输到手机上,应将其安装在/Applications/
下.
Then, you use ssh
, or scp
, or something else to transfer it to your phone, where it should be installed under /Applications/
.
您已经拥有构建iOS的最佳链接启动守护程序.我会坚持那个教程. 否,我在Xcode中也没有任何打开的工具链 template .我只是使用Chris的教程来查看如何构建非图形守护程序main
程序(而不是UIApplication
),将其复制到我的MyAppName.app
文件夹中,并创建一个定义启动守护程序的com.mycompany.mydaemon.plist
文件.
You already have the best link on building iOS Launch Daemons. I'd stick with that tutorial. No, I don't have any open toolchain template in Xcode, either. I just use Chris' tutorial to see how to build a non-graphical daemon main
program (not a UIApplication
), copy it to my MyAppName.app
folder, and create a com.mycompany.mydaemon.plist
file that defines the Launch Daemon.
将plist安装在手机的/System/Library/LaunchDaemons/
中后,您可以启动它,而无需重新启动手机,方法如下:
Once the plist is installed in /System/Library/LaunchDaemons/
on the phone, you can start it, without having to reboot the phone, with:
launchctl load -w /System/Library/LaunchDaemons/com.mycompany.mydaemon.plist
在命令行(在电话上)上按
.或者,只需重启手机,守护程序就会自动启动.
at the command line (on the phone). Or, just reboot the phone, and the daemon will start automatically.
尽管我已经学会了在可用之前进行此操作,但是如果愿意,您现在可以查看 iOSOpenDev 一种更精巧的方法来做这些东西.
Although I learned to do this before it was available, you can now look at iOSOpenDev if you'd like a more polished way of doing some of this stuff.
这篇关于使用xcode进行越狱开发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!