1

I make a tweak that works in backboardd, if I just respring after install it, it doesn't work, I have to restart the my iPhone entirely. Are there any other better ways need not restarting device?

Suge
  • 2,808
  • 3
  • 48
  • 79

2 Answers2

2

You can execute this in your postinst script if you are installing your tweak as debian package (*.deb)

launchctl stop com.apple.backboardd

Backboard will restart automatically and cydia-substrate should be able to inject your tweak in it.

creker
  • 9,400
  • 1
  • 30
  • 47
  • Thank you, but how can I add this command to the "postinst script"?I use iosopendev in xcode. – Suge Feb 05 '14 at 08:22
  • @Suge, see [this link](http://www.debian.org/doc/manuals/debian-faq/ch-pkg_basics.en.html) for some information on Debian package formats. Basically, in your .deb package, you will have a `DEBIAN/postinst` shell script, and you simply need to put the `launchctl` command shown above in that script (after the usual `#!/bin/bash` line, of course). Cydia will run that script after installing your tweak. – Nate Feb 05 '14 at 22:11
  • @Nate, I add the postinst script to restart backboardd after installation, it works right for me, but lead to a new problem: it respring automatically at the end of the installation without the "Restart SpringBoard" button click, and because of that, there don't show the app icon on the home screen except you reboot the device entirely.What can I do for that? – Suge Feb 07 '14 at 12:27
  • @Suge, you need to execute `uicache` in your postinst script and then restart backboardd. Restarting backboardd leads to SpringBoard restart. But there is a problem. `uicache` can only be run as mobile user. `launchctl` can only be run as root user. You can install sudo and use `sudo -u mobile uicache` to execute `uicache` as mobile user. – creker Feb 07 '14 at 13:29
  • @creker, thank you, but what's `uicache`? I didn't find any useful instructions. – Suge Feb 07 '14 at 13:54
  • @Suge, `uicache` clears SpringBoard caches so that SpringBoard would reload all applications. This tool is used in exactly your case when you install application and want to refresh SpringBoard in order to make it visible to the user. – creker Feb 07 '14 at 20:05
1

Note: since you say that you're using iOSOpenDev to create your tweaks, there's another option, altho the postinst file works fine, too.

Add another post-install command to the custom build script that iOSOpenDev will have created for your project.

You should already see this under the Target->Build Phases->Run Script:

enter image description here Just add the following line where the arrow is (line 2):

/opt/iOSOpenDev/bin/iosod run -h ${iOSOpenDevDevice} 'su mobile -c uicache'

Note that this requires the UIKit tools package from Cydia to be installed. (to run uicache)

You should also have a user-defined Build Setting setting iOSOpenDevDevice equal to your device's IP address, so the installation can occur via Wi-Fi.

Nate
  • 31,017
  • 13
  • 83
  • 207