Deploying iOS apps to /Applications from XCode via build phase script? (Jailbroken)

﹥>﹥吖頭↗ 提交于 2019-12-04 07:24:36

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

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 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

The general consensus among the community is that this isn't desirable. A build system like Theos coupled with on device GDB and either a syslog package or deviceconsole is what many are using.

I'm not particuralry well knowledgable about xcode but like most IDE's im assuming in one shape or another that you can have it run a post build script if you can figure out what that is its as simple as an scp command to upload from there you can use ldid -S nameofapp in the dir that the app is uploaded to.

You can if you want allow your app to reside in /Applications though upgrading to 4.3.5 most likely forces you on a tethered Jailbreak I'm not aware of an untethered JB for 4.3.5 so thats a hassle if you wind up having to reboot.

As far as debuggers give gdb(you can get it from cydia) a go its really useful :). What Id do is just have xcode run a post build script to use scp to upload to your device then sign it manually with ldid thats the easiest way i can think of unless you have access to a developer idevice.

Give me a few minutes Ill write a script and try to describe how it works I need one anyone since i finally got a mostly working open toolchain. :)

A simple upload script

#!/bin/bash
scp -r $1 $2@$3:$4

$1 is lets say your app folder ill use my dpatcher as an example

$2 is user name either mobile or root(if you upload as root you need to chmod permissions to 755)

$3 is your idevices local ip(ie your routers ip for it) 

you can find your ip with sbsettings or by going to settings tap the blue arrow next to your ap and it will tell you.

$4 is where you want it to be most likely /Applications or /var/mobile/Applications

i named it upload.sh but you can name it anything

An example

upload.sh dpatcher.app mobile@192.168.1.65 /Applications

Then all you do is ssh in and sign it with ldid -S nameofapp

If you want to upload single files remove -r as thats for recursive uploads(ie folders)

the reason that you must use scp or sftp for uploading files is that normal ftp AFAIK is not supported with out the use of 3rd party apps.

I'm not sure how to integrate with Xcode I do every thing with either vi, emacs or nano(and I don't own a mac).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!