Skip to content

Missing native logs in the process input stream #432

Closed
@4hartman

Description

@4hartman

Hello there,

A while ago, before updating ios-deploy (we are not sure which version caused the issue) we were running an app (via the command: ios-deploy --id myDeviceId --bundle /path/to/my/app.app -m -I -W) and were able to read the full process output stream by the Java BufferedReader.

However, nowadays the output (from bufferReader) stops after the last lldb output. Running the same command in the console works as expected and shows the full logs (see below). This causes us a problem once we are expecting some output from the app (after the lldb output).

Can somebody help us to understand what the problem could be and how to fix it?

Expected behavior

Having the same output in the server process stream as when running the command in the terminal.
It should not hang up when trying to stdAll.readLine()

Actual behavior

Incomplete process input stream.

Steps to reproduce the problem

running the command in the console vs running the command by java process builder:

Command: ios-deploy --id myDeviceId --bundle /path/to/my/app.app -m -I -W
Java part:

		try (BufferedReader stdAll = new BufferedReader(new InputStreamReader(process.getInputStream()))) {
			String readLine;

			int lineNumber = 0;
			while ((readLine = stdAll.readLine()) != null) {  //  <- it gets stuck here: stdAll.readLine()
				streamReader.stream(lineNumber++, readLine);

				// Stop reading if the thread was requested to stop
				if (!running.get()) {
					break;
				}
			}
		} catch (IOException e) {
			LOGGER.error("Failed to run process", e);
		} finally {
			freed.set(true);
		}

server output:

15:00:43.361  (lldb) command source -s 0 '/tmp/C53B8863-56CF-47E6-964B-5FC2D486E101/fruitstrap-lldb-prep-cmds-myDeviceId'
15:00:43.361  Executing commands in '/tmp/C53B8863-56CF-47E6-964B-5FC2D486E101/fruitstrap-lldb-prep-cmds-myDeviceId'.
15:00:43.362  (lldb)     platform select remote-ios --sysroot 'Library/Developer/Xcode/iOS DeviceSupport/12.4 (16G77)/Symbols'
15:00:43.362    Platform: remote-ios
15:00:43.362   Connected: no
15:00:43.362    SDK Path: "Library/Developer/Xcode/iOS DeviceSupport/12.4 (16G77)/Symbols"
15:00:43.362  (lldb)     target create "/path/to/my/app.app"
15:00:46.402  Current executable set to 'path/to/my/app.app' (arm64).
15:00:46.402  (lldb)     script fruitstrap_device_app="/private/var/containers/Bundle/Application/9FCAD917-5F88-47EE-AD8A-EE8A0433FB50/ProductName.app"
15:00:46.403  (lldb)     script fruitstrap_connect_url="connect://127.0.0.1:61146"
15:00:46.404  (lldb)     script fruitstrap_output_path=""
15:00:46.404  (lldb)     script fruitstrap_error_path=""
15:00:46.405  (lldb)     target modules search-paths add /usr "/usr/Library/Developer/Xcode/iOS DeviceSupport/12.4 (16G77)/Symbols/usr" /System "/usr/Library/Developer/Xcode/iOS DeviceSupport/12.4 (16G77)/Symbols/System" "/private/var/containers/Bundle/Application/9FCAD917-5F88-47EE-AD8A-EE8A0433FB50" "/usr/Path/path/Payload" "/var/containers/Bundle/Application/9FCAD917-5F88-47EE-AD8A-EE8A0433FB50" "/usr/Path/path/Payload" /Developer "/usr/Library/Developer/Xcode/iOS DeviceSupport/12.4 (16G77)/Symbols/Developer"
15:00:46.419  (lldb)     command script import "/tmp/C53B8863-56CF-47E6-964B-5FC2D486E101/fruitstrap_myDeviceId.py"
15:00:46.422  (lldb)     command script add -f fruitstrap_myDeviceId.connect_command connect
15:00:46.423  (lldb)     command script add -s asynchronous -f fruitstrap_myDeviceId.run_command run
15:00:46.423  (lldb)     command script add -s asynchronous -f fruitstrap_myDeviceId.autoexit_command autoexit
15:00:46.423  (lldb)     command script add -s asynchronous -f fruitstrap_myDeviceId.safequit_command safequit
15:00:46.423  (lldb)     connect
15:00:46.449  (lldb)     run
15:00:47.302  success
15:00:47.302  (lldb)     autoexit

command line output:

(lldb) command source -s 0 '/tmp/2DDCEB03-3B2E-4CA4-A1D5-915CD498B657/fruitstrap-lldb-prep-cmds-myDeviceId'
Executing commands in '/tmp/2DDCEB03-3B2E-4CA4-A1D5-915CD498B657/fruitstrap-lldb-prep-cmds-myDeviceId'.
(lldb)     platform select remote-ios --sysroot '/usr/Library/Developer/Xcode/iOS DeviceSupport/12.4 (16G77)/Symbols'
  Platform: remote-ios
 Connected: no
  SDK Path: "/usr/Library/Developer/Xcode/iOS DeviceSupport/12.4 (16G77)/Symbols"
(lldb)     target create "/usr/Path/path/Payload/ProductName.app"
Current executable set to '/usr/Path/path/Payload/ProductName.app' (arm64).
(lldb)     script fruitstrap_device_app="/private/var/containers/Bundle/Application/724C35AA-EAB0-4CD2-AF0E-8E44AD526959/ProductName.app"
(lldb)     script fruitstrap_connect_url="connect://127.0.0.1:55254"
(lldb)     script fruitstrap_output_path=""
(lldb)     script fruitstrap_error_path=""
(lldb)     target modules search-paths add /usr "/usr/Library/Developer/Xcode/iOS DeviceSupport/12.4 (16G77)/Symbols/usr" /System "/usr/Library/Developer/Xcode/iOS DeviceSupport/12.4 (16G77)/Symbols/System" "/private/var/containers/Bundle/Application/724C35AA-EAB0-4CD2-AF0E-8E44AD526959" "/usr/Path/path/Payload" "/var/containers/Bundle/Application/724C35AA-EAB0-4CD2-AF0E-8E44AD526959" "/usr/Path/path/Payload" /Developer "/usr/Library/Developer/Xcode/iOS DeviceSupport/12.4 (16G77)/Symbols/Developer"
(lldb)     command script import "/tmp/2DDCEB03-3B2E-4CA4-A1D5-915CD498B657/fruitstrap_myDeviceId.py"
(lldb)     command script add -f fruitstrap_myDeviceId.connect_command connect
(lldb)     command script add -s asynchronous -f fruitstrap_myDeviceId.run_command run
(lldb)     command script add -s asynchronous -f fruitstrap_myDeviceId.autoexit_command autoexit
(lldb)     command script add -s asynchronous -f fruitstrap_myDeviceId.safequit_command safequit
(lldb)     connect
(lldb)     run
success
(lldb)     autoexit
2019-12-19 11:18:55.169191+0100 ProductName[771:154473] Built from '2018.4/release' branch, Version '2018.4.12f1 (59ddc4c59b4f)', Build type 'Development', Scripting Backend 'il2cpp'
2019-12-19 11:18:55.178663+0100 ProductName[771:154473] -> registered mono modules 0x106cbee40
-> applicationDidFinishLaunching()
PlayerConnection initialized from /var/containers/Bundle/Application/724C35AA-EAB0-4CD2-AF0E-8E44AD526959/ProductName.app/Data (debug = 0)
PlayerConnection initialized network socket : 0.0.0.0 55000
Multi-casting "[IP] 172.XX.XXX.XX [Port] 55000 [Flags] 2 [Guid] 2860918101 [EditorId] 910975862 [Version] 1048832 [Id] iPhonePlayer(Core-iPhone-6S):56000 [Debug] 0 [PackageName] iPhonePlayer" to [225.X.X.XXX:XXXXX]...
Started listening to [0.0.0.0:55000]
PlayerConnection already initialized - listening to [0.0.0.0:55000]
2019-12-19 11:18:55.457935+0100 ProductName[771:154473] [Warning] Trying to set delaysTouchesBegan to NO on a system gate gesture recognizer - this is unsupported and will have undesired side effects
-> applicationDidBecomeActive()
GfxDevice: creating device client; threaded=1
Initializing Metal device caps: Apple A9 GPU
Initialize engine version: 2018.4.12f1 (59ddc4c59b4f)
UnloadTime: 1.642333 ms
MobileDevice IP:172.XX.XXX.XX

System Specs

Please run the commands below in your Terminal.app and include it in the issue. Check when done and include results below.

  • 1. system_profiler SPSoftwareDataType
  • 2. ios-deploy -V
  • 3. xcodebuild -version
  • 4. xcode-select --print-path
  • 5. gcc --version
  • 6. lldb --version
sw_vers -productVersion
10.15.1
ios-deploy -V
1.10.0
xcodebuild -version
Xcode 11.3
Build version 11C29
xcode-select --print-path
/Applications/Xcode.app/Contents/Developer
gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 11.0.0 (clang-1100.0.33.16)
Target: x86_64-apple-darwin19.0.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
lldb --version
lldb-1100.0.30.11
Apple Swift version 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions