通过构建阶段脚本将iOS应用程序部署到/ XCode应用程序? (越狱) [英] Deploying iOS apps to /Applications from XCode via build phase script? (Jailbroken)

查看:245
本文介绍了通过构建阶段脚本将iOS应用程序部署到/ XCode应用程序? (越狱)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个Cydia应用程序。它已经开发了一段时间,直到最近,我几个月后恢复开发时,我从未遇到过任何问题。自从我上一次工作以来,有一些事情发生了变化:

I'm developing a Cydia app. It's been in development for awhile, and I've never had any problems until recently, when I resumed development after a few months. There are a couple of things that have changed since the last time I worked on it:


  1. 升级到Lion

  2. 已移至Xcode 4

  3. 在iPad上更新为4.3.5,iPhone更新为5.0

从我所做的研究中,我得出结论,我的旧设置有一些不寻常。我发现配置的应用程序放在沙盒目录 / private / var / mobile / Applications 中,并且获得对整个文件系统的读取权限的系统应用程序进入 /应用。我想从使用更新的工具和Lion,我打破了给予我系统范围读取权限的任何东西。所以,我需要有关如何让Xcode直接部署到非沙盒系统目录的信息。

From the research I've done, I've come to the conclusion that there was something "unusual" about my old setup. I've discovered that provisioned apps get put in the "sandboxed directory" /private/var/mobile/Applications, and system apps that get read access to the entire filesystem go in /Applications. I guess from using updated tools and Lion, I broke whatever was giving me system-wide read privileges. So, I need information on how to get Xcode to deploy directly to the non-sandboxed system directory.

但是有一些警告。我不想使用安装程序,我希望Xcode在构建和运行后自动执行。我还希望能够连接调试器,以便查看控制台。

There are some caveats though. I don't want to have to use an installer, I want Xcode to do it automatically after Build and Run. I also want to be able to have the debugger attached so I can view the console.

任何有此经验的人都可以教我如何使用Build Phase Scripts来做必要的事情。采用签名二进制文件并在每次构建后自动部署它?我想这确实是可行的,因为控制台输出是一个非常有价值的工具,开发像Cydia本身的应用程序会很困难。

Can anyone with experience in this teach me how to use Build Phase Scripts to do necessary magic to take the signed binary and deploy it automatically after each build? I'd imagine this is indeed possible, because console output is such a valuable tool, that it would be too difficult to develop apps like Cydia itself.

谢谢你的支持帮助!

推荐答案

我添加了一个脚本作为自定义构建阶段。该脚本签署应用程序,创建一个包,将其复制到手机并安装它。

I added a script as custom build phase. The script signs the app, create a package, copy it to the phone and install it.

构建阶段是运行脚本与/ bin / sh和我添加了$ {PROJECT_DIR} /MyApp/install.sh

The Build Phase is "Run a Script" with /bin/sh and I added "${PROJECT_DIR}/MyApp/install.sh"

脚本(非常基本 - 没有错误处理)如下(替换为适当的值):

The scripts (very basic - no error handling) is below (replace with appropriate values) :

(LatestBuild是构建目录的链接)
(ldid随iosopendev项目一起安装)

(LatestBuild is a link to the build directory) (ldid is installed with iosopendev project)

cd $HOME/Projects/iPhone/MyProject/MyApp
cp -r ../LatestBuild/MyApp.app com.test.MyApp/Applications/ 
ldid -S com.test.MyApp/Applications/MyApp.app/MyApp
rm com.test.MyApp.deb 2>&1
/opt/local/bin/dpkg-deb -b com.test.MyApp
scp com.test.MyApp.deb root@192.168.0.10:/var/root
ssh root@192.168.0.10 "dpkg -r com.test.MyApp"
ssh root@192.168.0.10 "dpkg -i com.test.MyApp.deb"
ssh root@192.168.0.10 "killall -9 MyApp"
#ssh root@192.168.0.10 "killall -HUP SpringBoard"
cd -

它可以改进很多 - 但它只是满足我的需求

It can be improved a lot - but it just works for my needs

这篇关于通过构建阶段脚本将iOS应用程序部署到/ XCode应用程序? (越狱)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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