模拟器上的越狱应用程序? [英] jailbroke app on simulator?

查看:105
本文介绍了模拟器上的越狱应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Xcode上为越狱的iPhone开发应用程序.我正在使用Xcode 4.2,而我的iPhone操作系统是iOS6.我无法将iPhone与XCode连接进行测试,因为XCode 4.2不支持iOS6.

I'm developing apps for jailbroken iPhone on Xcode. I'm using Xcode 4.2 and my iPhone OS is iOS6. I cannot connect my iPhone with XCode for testing because XCode 4.2 does not support iOS6.

每次编译代码并尝试在模拟器上运行时,我都无法摆脱 sandbox .因此,我尝试创建一个.ipa文件,将其安装在iPhone上并进行测试.

Every time when I compile the code and try to run it on the simulator, I cannot get out of the sandbox. So I've tried to create an .ipa file, install it on iPhone and test it.

有什么方法可以在模拟器上测试越狱的应用程序吗?

Is there any way to test jail broken apps on simulator?

推荐答案

这取决于您要测试的哪种越狱功能.我有一个越狱应用程序,可以访问完整的文件系统,当我在Simulator中运行它时,我可以访问Mac上的所有文件,而不仅仅是从Simulator的主目录中访问(请参见图片

It depends what kind of jailbreak functionality you're looking to test. I have a jailbreak app that accesses the full file system, and when I run it in the Simulator, I can access ALL the files on my Mac, not just from the Simulator's home directory (See pic here showing the Mac's Applications directory in Simulator). If this is something you have in your app, you could reconstruct the file system of your iPhone on your Mac and use that for testing. However, if you're doing something like accessing the iPhone's serial port, the Simulator obviously won't have that capability.

或者,您是否尝试过创建后构建脚本以通过SSH将.app文件安装到iPhone上?这是我使用的脚本(变量IPOD是WLAN中设备的IP本地地址,其他来自Xcode):

Alternatively, have you tried creating a post build script to install the .app file onto your iPhone via SSH? Here's the script I use (the variable IPOD is the device's IP local address in my WLAN, the others come from Xcode):

bundleid=`defaults read $BUILT_PRODUCTS_DIR/${WRAPPER_NAME}/Info.plist CFBundleIdentifier`
# kill if running, remove old version, copy new one and launch it
ssh -p $PORT root@$IPOD "killall $EXECUTABLE_NAME"
ssh -p $PORT root@$IPOD "rm -r /private/var/stash/Applications/$WRAPPER_NAME"
scp -P $PORT -r $BUILT_PRODUCTS_DIR/${WRAPPER_NAME} root@$IPOD://private/var/stash/Applications
ssh -p $PORT root@$IPOD "open $bundleid"

open命令在Cydia上可用.

The open command is available on Cydia.

这显然是一个非常简单的脚本,并且可能有更好的方法(例如使用dpkg),但它为我完成了工作.

This is obviously a very simple script and there are probably better ways of doing it (like using dpkg), but it gets the job done for me.

您显然需要在iPhone上安装并激活SSH,以及诸如killall(在Cydia中都可用)之类的其他东西.

You'll obviously need to have SSH installed and activated on your iPhone, and some other things like killall (all available in Cydia).

这篇关于模拟器上的越狱应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆