简体   繁体   中英

How to capture iPhone app debug logs

I was researching libimobiledevice to basically capture the specific iPhone app logs. I have tried with the idevicesyslog command, but it gives me all the system logs along with my app.

I tried with idevicesyslog -d | grep com.example.Example idevicesyslog -d | grep com.example.Example but does not give me the info I am looking for.

I am interested in the debug logs of my app.

I know there is a way to capture it from the organizer in Xcode but I don't want to do it that way. I am planning to do it programmatically and then integrate with Appium automation script.

I was able to achieve this with idevicesyslog -d |grep '" https://ac.XYZ.COM " >& t' write to the file "t" and then clear the file and move on to the next step.

This I was able to achieve but the only issue I am facing here is that I need to update the command, like it wont write to log on real time basis when I am interacting with the device. If someone can suggest a way where it log to the file in a real time that would be great.

You can use -m option from idevicesyslog, this option is for "only print messages that contain STRING"

Example:

idevicesyslog -m "Vantage"

Hope this method is work for you :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM