Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

[PATCH] Add tools to show device information and relay the syslog

#30

This patch adds a "deviceinfo" tool which shows interesting information of an attached iPhone/iPod Touch which can be request from lockdownd.

One can choose a specific device using "--usb bus,num" aswell.

Reported by Martin S. · April 15th, 2009 @ 12:19 AM

State: resolved
Milestone: 1.0 Release
Assigned to: Matt Colyer Matt Colyer

Activity

  1. Paul Sladen
    Paul Sladen
    • Milestone set to 1.0 Release

    April 15th, 2009 @ 10:44 AM

  2. Nikias Bassen
    Nikias Bassen

    The name 'deviceinfo' is too generic. 'iphoneinfo' would be more suitable regarding that this tool (in a later revision) might be used for automounting.

    April 15th, 2009 @ 02:35 PM

  3. Martin S.
    Martin S.

    Changed name to iphoneinfo and added some more information being dumped.

    April 15th, 2009 @ 11:18 PM

  4. Martin S.
    Martin S.

    Also shows battery information now.

    April 16th, 2009 @ 01:44 AM

  5. Martin S.
    Martin S.
    • Tag changed from libiphone, lockdown, patch to libiphone, lockdown, patch, syslog_relay
    • Title changed from [PATCH] Add tool to show device information to [PATCH] Add tools to show device information and relay the syslog

    Patch below applies after 0007-add-deviceinfo-tool.patch and adds a syslog_relay tool which basically dumps the syslog of a device to stdout.

    Someone might have an eye on the loop receiving the data over usbmux, not sure if that is the correct way to handle it but it appears to work.

    April 16th, 2009 @ 01:54 PM

  6. Paul Sladen
    Paul Sladen

    Excellent. Again, wondering that the name is too generic. What about 'iphonesyslogrelay' or combining into a more general 'lockdown command arguments' tool or straight merging into the 'iphonedump' tool, so eg:

    iphonetool --dump-syslog

    and perhaps a slight modification and instead of dumping to stdout instead /forwards/ the output via "syslog" to the local machine.

    April 16th, 2009 @ 02:05 PM

  7. Martin S.
    Martin S.

    I did not care about the names since all lives in the dev/ directory which is not actually meant for distribution, contains "not clean" test tools and requires --enable-dev-tools to be passed to configure.

    Updated patch below names the syslog relay tool to "iphonesyslog" for now which should be appropriate (one could add filters, forwarding, etc.).

    The feature to forward to the local syslog should be possible to implement using a new cli option like "-l|--local" but requires some parsing of the relayed data as it seems. However, I wait with that until the usbmuxd stuff lands except if someone beats me to it.

    I think it is good to keep it the UNIX way and rather have a couple of small tools which should enable people to come up with some creative bash stuff one didn't think of yet...

    Extending the lckd-client tool might also be interesting.

    Lockdown appears to differ between "Request" and "Command" calls. Each specific request/command identifier defines a specific set of required parameters thus a "signature" of the plist one needs to send:

    @@@Request QueryType StartSession StopSession StartService Pair Unpair ValidatePair Activate Deactivate GetValue SetValue RemoveValue EnterRecovery Goodbye

    
    
    One could extend the lckd-client to use requests/commands specified in it's prompt or from command line as in this examples:
    
    @@@# ./lckd-client --send "Request:GetValue Domain:com.apple.mobile.battery Key:BatteryCurrentCapacity"
    Domain:com.apple.mobile.battery
    Key:BatteryCurrentCapacity
    Request:GetValue
    Result:Success
    Value:90
    
    # ./lckd-client
    # >
    # > send Request:GetValue Domain:com.apple.mobile.battery Key:BatteryCurrentCapacity
    # Domain:com.apple.mobile.battery
    # Key:BatteryCurrentCapacity
    # Request:GetValue
    # Result:Success
    # Value:90
    # > send Request:SetValue Domain:com.apple.mobile.debug Key:LogToDisk Value:1
    # Domain:com.apple.mobile.debug
    # Key:LogToDisk
    # Request:SetValue
    # Result:Success
    # Value:1
    # > send Request:EnterRecovery
    # Request:EnterRecovery
    # Result:Success
    # Disconnected.
    

    (If you are accidentally issue EnterRecovery like me: User the "reset device" key combination to reboot/escape into normal mode again.)

    April 16th, 2009 @ 04:03 PM

  8. Matt Colyer
    Matt Colyer

    (from [6b1c3e363adff39ce15e57217ab97ae2d692247c]) Add utility to show information about attached devices

    [#30 [PATCH] Add tools to show device information and relay the syslog]

    Signed-off-by: Matt Colyer matt@colyer.name http://github.com/MattColyer/lib...

    April 19th, 2009 @ 10:15 PM

  9. Matt Colyer
    Matt Colyer

    (from [f104eb4371c2da6bac81f283d9943cdb800a6f95]) Add tool to relay the syslog from a device to stdout

    [#30 [PATCH] Add tools to show device information and relay the syslog]

    Signed-off-by: Matt Colyer matt@colyer.name http://github.com/MattColyer/lib...

    April 19th, 2009 @ 10:16 PM

  10. Matt Colyer
    Matt Colyer

    Hey Martin the first couple of patches you sent me were properly formatted to be read by git am but the last couple were in an odd format. Is there some switch that I can use to read them in?

    April 19th, 2009 @ 10:17 PM

  11. Martin S.
    Martin S.

    Hmm, which patches do you mean exactly? Mind that the last posted patch with same filename is meant to "override" any prior posted one. They are not continuous thus the hash is different for each. They (hopefully) should be probably formatted for git am.

    April 19th, 2009 @ 10:27 PM

  12. Matt Colyer
    Matt Colyer

    This patch works great: http://libiphone.lighthouseapp.c...

    Your other patches are in an odd format, take a quick glance at them and you'll see what I mean.

    (And yes I always took the latest patches from all the threads and didn't use the earlier patches that were named similarily)

    April 20th, 2009 @ 03:42 PM

  13. Martin S.
    Martin S.
    • Assigned user set to Matt Colyer

    Ah, I got what is wrong now. Will be fixed for new patches. ;)

    Check the new patch below which adds even more output, should be the correct format this time.

    April 20th, 2009 @ 08:07 PM

  14. Matt Colyer
    Matt Colyer
    • State changed from new to resolved

    (from [7a93c3469de1063e48c8b946fa9ed9019de6934c]) Show information about installed applications and refactor iphoneinfo a bit

    [#30 [PATCH] Add tools to show device information and relay the syslog state:resolved]

    Signed-off-by: Matt Colyer matt@colyer.name http://github.com/MattColyer/lib...

    April 24th, 2009 @ 02:18 AM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.