Coder Social home page Coder Social logo

Comments (15)

YueChen-C avatar YueChen-C commented on May 20, 2024

@rahul-1485
Try to use USB to start sysmontap.py

if __name__ == '__main__':
    rpc = InstrumentServer().init()
    sysmontap(rpc)
    rpc.stop()

from py-ios-device.

rahul-1485 avatar rahul-1485 commented on May 20, 2024

Thanks for the reply @YueChen-C after doing the changes you have suggested sudo python3 sysmontap.py is running now. I am facing one more issue the sudo python3 sysmontap.py command works for IOS 14.2 device but not for IOS 12 devices.

Error i am getting is -

apple@Apples-MBP-2 instrument_demo % sudo python3 sysmontap.py
2021-04-17 01:10:49,478 - lockdown.py[line:94] - WARNING: [Errno 1] Operation not permitted: '/var/db/lockdown/caf07925fafe65912231d022bcb889d9c38503d5.plist'
Traceback (most recent call last):
File "/Users/Rahul/Downloads/py-ios-device-main/demo/instrument_demo/sysmontap.py", line 52, in
rpc = InstrumentServer().init()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/ios_device/servers/Instrument.py", line 14, in init
self.lockdown = lockdown if lockdown else LockdownClient(udid=udid)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/ios_device/util/lockdown.py", line 61, in init
self.paired = self._pair()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/ios_device/util/lockdown.py", line 79, in _pair
self._pair_full()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/ios_device/util/lockdown.py", line 140, in _pair_full
'DevicePublicKey': plistlib.Data(device_public_key),
AttributeError: module 'plistlib' has no attribute 'Data'

Also i have tested sudo python3 applictionListing.py it is also not working working for IOS 12

Can you please suggest any other changes required for running commands on devices lower than IOS 14.

from py-ios-device.

YueChen-C avatar YueChen-C commented on May 20, 2024

@rahul-1485

Python3.9 plistlib removed plistlib.data.
I need some time to test

In addition, you can try using execute the command: sudo chmod 777 /var/ db/lockdown. Use iTunes pair instead of private pair

from py-ios-device.

rahul-1485 avatar rahul-1485 commented on May 20, 2024

hi @YueChen-C the command sudo chmod 777 /var/ db/lockdown showing error - chmod: Unable to change file mode on /var/db/lockdown: Operation not permitted.

from py-ios-device.

YueChen-C avatar YueChen-C commented on May 20, 2024

@rahul-1485
This issue has been fixed on python 3.9.Try to pull the main branch test sysmontap.py

from py-ios-device.

rahul-1485 avatar rahul-1485 commented on May 20, 2024

Hi @YueChen-C i have tried the latest code but it is still not working for IOS devices less than 14.0 Version. Getting same error

apple@Apples-MBP-2 instrument_demo % sudo python3 sysmontap.py
2021-04-28 23:16:00,470 - lockdown.py[line:94] - WARNING: [Errno 1] Operation not permitted: '/var/db/lockdown/caf07925fafe65912231d022bcb889d9c38503d5.plist'
Traceback (most recent call last):
File "/Users/Rahul/Desktop/pCloud/py-ios-device/demo/instrument_demo/sysmontap.py", line 56, in
rpc = InstrumentServer().init()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/ios_device/servers/Instrument.py", line 14, in init
self.lockdown = lockdown if lockdown else LockdownClient(udid=udid)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/ios_device/util/lockdown.py", line 61, in init
self.paired = self._pair()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/ios_device/util/lockdown.py", line 79, in _pair
self._pair_full()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/ios_device/util/lockdown.py", line 140, in _pair_full
'DevicePublicKey': plistlib.Data(device_public_key),
AttributeError: module 'plistlib' has no attribute 'Data'

Please check.

from py-ios-device.

doronz88 avatar doronz88 commented on May 20, 2024

This error is unrelated to the iOS version, but rather the python version and was already fixed as @YueChen-C said. It seems you haven't pulled the latest version.

Python had a really wierd way to deprecate this API (no deprecation warnings on older versions then 3.9). Its now replaced simply with bytes so the call to plistlib.Data was just removed.

from py-ios-device.

rahul-1485 avatar rahul-1485 commented on May 20, 2024

hi @doronz88 i am currently on Python 3.9 version and the and taken the latest code it works fine for IOS 14 devices. But on devices lower than 14.0 the error is same for all Python scripts.

apple@Apples-MBP-2 instrument_demo % sudo python3.9 applictionListing.py
2021-04-29 01:19:05,492 - lockdown.py[line:94] - WARNING: [Errno 1] Operation not permitted: '/var/db/lockdown/caf07925fafe65912231d022bcb889d9c38503d5.plist'
Traceback (most recent call last):
File "/Users/Rahul/Downloads/py-ios-device-main/demo/instrument_demo/applictionListing.py", line 20, in
rpc = InstrumentServer().init()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/ios_device/servers/Instrument.py", line 14, in init
self.lockdown = lockdown if lockdown else LockdownClient(udid=udid)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/ios_device/util/lockdown.py", line 61, in init
self.paired = self._pair()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/ios_device/util/lockdown.py", line 79, in _pair
self._pair_full()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/ios_device/util/lockdown.py", line 140, in _pair_full
'DevicePublicKey': plistlib.Data(device_public_key),
AttributeError: module 'plistlib' has no attribute 'Data'

Also tried to change permission for lockdown folder it says "chmod: Unable to change file mode on /var/db/lockdown: Operation not permitted"

from py-ios-device.

doronz88 avatar doronz88 commented on May 20, 2024

Latest revision contains a different content on the error line from your backtrace so it seems you aren't on latest version. Try to install it as follows:

python3 -m pip install --user -U -e . 

The -e is for local installation so you don't need to pip install every time.

from py-ios-device.

rahul-1485 avatar rahul-1485 commented on May 20, 2024

hi @doronz88 i got below error with your command -

apple@Apples-MBP-2 ~ % python3 -m pip install --user -U -e

Usage:
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3 -m pip install [options] [package-index-options] ...
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3 -m pip install [options] -r [package-index-options] ...
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3 -m pip install [options] [-e] ...
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3 -m pip install [options] [-e] ...
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3 -m pip install [options] <archive url/path> ...

-e option requires 1 argument

from py-ios-device.

doronz88 avatar doronz88 commented on May 20, 2024

You forgot the . after the -e flag.

from py-ios-device.

rahul-1485 avatar rahul-1485 commented on May 20, 2024

hi @doronz88 thanks for help it is working now i have one query when we run python3 applictionListing.py it shows app list and then when we run python3 sysmontap.py it shows the process and it's data. But how do we know the data belongs to particular app. Let suppose i want my know about data of safari app "python3 sysmontap.py" command shows listing but it not shows for which app data belongs too. Can you please suggest how to associate particular app process with data. Is there any parameter for it.

from py-ios-device.

doronz88 avatar doronz88 commented on May 20, 2024

You can trigger the selector named processIdentifierForBundleIdentifier: for each given pid to have a pid/bundle/app-data relation. This selector is not implemented in this repo but can be easily done.

from py-ios-device.

rahul-1485 avatar rahul-1485 commented on May 20, 2024

Hi @doronz88 when we run "sudo python3 sysmontap.py" we get data of all the process is there any command to get data only for the particular process id. Let suppose if we want to see the data of a particular process only associated with an app.

from py-ios-device.

doronz88 avatar doronz88 commented on May 20, 2024

This script doesn't allow this. I've implemented this feature in my own tool:
https://github.com/doronz88/pymobiledevice3

You can run:

pymobiledevice3 developer sysmon processes -a pid=some_pid

You can filter on any field you desire.

from py-ios-device.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.