Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new features to apple.py #4

Open
thehesiod opened this issue Apr 3, 2013 · 5 comments
Open

new features to apple.py #4

thehesiod opened this issue Apr 3, 2013 · 5 comments

Comments

@thehesiod
Copy link

I've been working on apple.py to support automation however one critical feature missing is the ability to figure out which applications are currently running so you don't try launching the app while the old one is shutting down (bad things happen). I know its possible since Instruments does it, and I know that to figure out what the command is one would have to look at the plists that lockdownd is sending to the device. i was able to use socat to look at the data on usbmuxd however one would have to deconstruct the data and dump the plist data (no time for this now). Anyone have anything up their sleeves for doing this? Also, how should I send my contributions? I could email what I have. I suppose I could just fork this but aren't there enough forks? :)

Here's what I've added so far:

  • optional param to connect to lockdown to a particular application (useful to retrieving files)
  • caching devices attached for filter to above
  • remote file stat
  • remote app file list
  • remote app delete folder/file
  • kill app (attach by re-launch, then kill)
@thehesiod
Copy link
Author

btw, I found that I can get the launch'd PID like so:
self.send('qLaunchSuccess')
self._socket.sendall('vCont;c')
#self.send('vCont;c') # this will block until the app exists. TODO: To be able to run async we need a way to figure out when the app has completely exited
self.send('\x03')
pid = self.send('qC')

with elif response.startswith('QC'):
return int(response[2:], 16)

and killing like so:
self.send('vAttach;' + str(pid))
return self.send('k')

and it seems pretty stable.

@crewbs
Copy link

crewbs commented Nov 14, 2013

Is there any chance apple.py could be extended to support specifying a device to use (e.g. it's UDID), rather than just using the device most recently connected?

@unprompted
Copy link
Owner

I added a --device-id argument.

@crewbs
Copy link

crewbs commented Nov 28, 2013

Awesome, thanks. works great.

@dengwei729
Copy link

python apple.py -get /var/mobile/Media/jailbreak.log .
Waiting for a device...
Connected to device with UDID: ae23586414f4d0d70c88fe9566e6de34c5ba95b8
Traceback (most recent call last):
File "apple.py", line 1155, in
readFile = afc.open(arguments.get_file[0], 'r')
File "apple.py", line 871, in open
return AFCFile(self._afc, path, mode)
File "apple.py", line 835, in init
raise RuntimeError('AFCFileRefOpen returned %d' % result)

why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants