question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Appium iOS: The network trace file for instruments gets blank

See original GitHub issue

The problem I am running appium for ios real device to record the instruments trace log for network. But after running the test, i found the .trace file is blank. If i am running it for “Activity Monitor”, the .trace file have the contents.

Environment

  • Appium version: 1.14.0 (Appium desktop for mac)
  • ios real device: 12.4
  • Instrument version: 10.2.1 (10E1001)
  • ios network connection: wifi

The sample code:

 File traceZip = new File("/tmp/trace.zip");
  HashMap<String, Object> args = new HashMap<>();
  args.put("timeout", 60000);
  args.put("pid", "current");
  args.put("profileName", "Network");
  //args.put("profileName", "Activity Monitor");
  driver.executeScript("mobile: startPerfRecord", args);
  driver.findElementByAccessibilityId("Search").click();
  Thread.sleep(5000);
  String b64Zip = (String)driver.executeScript("mobile: stopPerfRecord", args);
  byte[] bytesZip = Base64.getMimeDecoder().decode(b64Zip);
  FileOutputStream stream = new FileOutputStream(traceZip);
  stream.write(bytesZip);

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
tomqijianbocommented, Aug 13, 2019

yes, it works fine with the full path name now. args.put("profileName", "/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/Resources/templates/NetWork"); thank you!

0reactions
mykola-mokhnachcommented, Aug 13, 2019

What if you provide the full path to the network template instead of just the name

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Appium - iOS] The .trace file gets blank after running a test ...
I'm using Xcode Instruments (Activity Monitor template) along with appium in order to get CPU and Memory usages. When running a the test ......
Read more >
Troubleshooting - Appium
Make sure the app is compiled for the simulator (or real device) as appropriate (e.g., in debug mode for the simulator), or you...
Read more >
UIAutomation (iOS) - Appium
Testing on iOS generates files that can sometimes get large. These include logs, temporary files, and derived data from Xcode runs.
Read more >
XCUITest (iOS) - Appium
Appium's primary support for automating iOS apps is via the XCUITest driver. ... Testing on iOS generates files that can sometimes get large....
Read more >
Mac : Issue with Appium-Instruments trace file - Support
I am trying to get battery usage/memory/CPU usage related trace file using appium-intruments. Below is the command that gets executed while ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found