The iOS syslog was removed in iOS 13.3. Prior to that, you could still view the deprecated syslog if you compiled your tweaks using an iOS 9 or lower SDK. Apple introduced oslog in iOS 10.
- Clone https://github.com/theos/theos/ to
$THEOS/sdks
. - Change
$THEOS/vendor/logos/bin/lib/Logos/Generator/Base/Method.pm:73
fromHBLogDebug(...
orNSLog(...
, depending on theos version, tolog(...
. - Add the following to
$THEOS/include/HBLog.h
:-
#define log(...) HBLogWarn(@"<NOSS>: %@", [NSString stringWithFormat:__VA_ARGS__]);
on line 19, ie if you're running os_log / iOS 10+ SDK. -
#define log(...) HBLogDebug(__VA_ARGS__);
on line 41, ie when not running an iOS 10+ SDK.
-
- On your iDevice, add
alias debug="oslog | awk 'f; /\)/{f=0} /<NOSS>:/{print; f=/\(/}'"
to/etc/profile.d/profile.sh
and source it afterwards. You may need to create the file if you haven't already. - Write
debug
in your device's terminal.
Feel free to use anything other than <NOSS>:
, it was only to make the prints hold something unique in order to filter it.
If you need to manually log something, simply use log(@"...", ...);
To change from the new oslog to the old syslog, simply change the TARGET
in the Makefile from iphone:clang:11.2
to iphone:clang:9.2
.
I recommend adding an alias for the old syslog in the same file as above if you're going to use the syslog:
alias syslog="socat - UNIX-CONNECT:/var/run/lockdown/syslog.sock"