#30 ✓resolved
Martin S.

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

Reported by Martin S. | April 15th, 2009 @ 12:19 AM | in 1.0 Release

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.

Comments and changes to this ticket

  • Paul Sladen

    Paul Sladen April 15th, 2009 @ 10:44 AM

    • Milestone set to 1.0 Release
  • Nikias Bassen

    Nikias Bassen April 15th, 2009 @ 02:35 PM

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

  • Martin S.

    Martin S. April 15th, 2009 @ 11:18 PM

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

  • Martin S.
  • Martin S.

    Martin S. April 16th, 2009 @ 01:54 PM

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

  • Paul Sladen

    Paul Sladen April 16th, 2009 @ 02:05 PM

    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.

  • Martin S.

    Martin S. April 16th, 2009 @ 04:03 PM

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

  • Matt Colyer

    Matt Colyer April 19th, 2009 @ 10:15 PM

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

    [#30]

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

  • Matt Colyer

    Matt Colyer April 19th, 2009 @ 10:16 PM

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

    [#30]

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

  • Matt Colyer

    Matt Colyer April 19th, 2009 @ 10:17 PM

    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?

  • Martin S.

    Martin S. April 19th, 2009 @ 10:27 PM

    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.

  • Matt Colyer

    Matt Colyer April 20th, 2009 @ 03:42 PM

    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)

  • Martin S.

    Martin S. April 20th, 2009 @ 08:07 PM

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

  • Matt Colyer

    Matt Colyer April 24th, 2009 @ 02:18 AM

    • State changed from “new” to “resolved”

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

    [#30 state:resolved]

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

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.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

A project around supporting the iPhone in Linux.

See http://libimobiledevice.org

People watching this ticket