2

I am currently working on automated testing of Qt-Applications on devices running iOS. So far I am able to install and run these Applications fine, but I am unable to read their output. As far as I understood, reading this issue, Qt uses the gdb server to deliver the output of std::out and std::err to the Qt Creator but I can not get my head around on how to use this information. Besides the bundle identifier, I am given the .ipa-file of the application only. I have access to the applications code but I must not change it.

I use the libmobiledevice libraries to handle all tasks like connection, installation and execution of and on the device.

To summarize: I want to read the debug output of a Qt-written application displayed on my console, like it would be in the "Application output" window of my Creator.

T3 H40
  • 2,326
  • 8
  • 32
  • 43
  • When building for iOS, I have also ran the qmake generated project file directly in XCode. So this question may be more generic... and may be, how to automate tests in XCode with iOS, or redirect std err std out in XCode for iOS. – phyatt Sep 01 '15 at 19:21
  • Probably the simplest way would be to queue all debug output as slot calls into a debug interface object. The object would live in a helper thread and send the debug output out via a network connection. – Kuba hasn't forgotten Monica Sep 01 '15 at 19:55
  • @phyatt displaying the output in XCode is not really what I need. What I want, is to access all prompts from the command line, as I developed some python software to handle all infrastructural means. – T3 H40 Sep 01 '15 at 19:59
  • @Kuba Ober, that sounds like a solution that works, but as stated in the question, I can not edit the codebase of the application – T3 H40 Sep 01 '15 at 20:00
  • 2
    Well, Qt Creator comes with full source code. Build a copy for yourself (under Qt Creator, of course), run it, and see what it does when it displays the output. – Kuba hasn't forgotten Monica Sep 01 '15 at 20:02
  • already thought about that as well, though it seems quite a big effort for such a seemingly small task, but I might get some Ideas from looking at the source. Thank you! – T3 H40 Sep 01 '15 at 20:07

2 Answers2

1

I found a way using the imobiledevice libraries. By calling Idevicedebug -u <uuid> run de.foo.app I was able to execute the application. The qDebug output was prompted to std::out.

As the app crashed when started with a locked screen, I had to check for the display being idle by examining the output of idevicediagnostics ioreg IOPower first.

T3 H40
  • 2,326
  • 8
  • 32
  • 43
1

Now, half a year later, I found a solution that worked both elegant and stable.

I installed the ios-deploy tool using node:

npm install -g ios-deploy

Using this, I was able to install the app and listen to it's output via:

ios-deploy --debug --bundle path/to/my.app

I recieved the full qDebug, std::out and std::err output perfectly fine.

To uninstall the app, I simply added the -9 or --uninstall_only option:

ios-deploy --debug --bundle path/to/my.app --uninstall_only

Using this solution the app could be started reliably, without crashing with a locked screen

T3 H40
  • 2,326
  • 8
  • 32
  • 43