openstf / ios-minicap

iOS Minicap provides a socket interface for streaming realtime screen capture data out of iOS devices.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

./run.sh When it's finished displaying device's udid, it's stuck.

zhenniuren opened this issue · comments

Steps to reproduce
./build.sh
./run.sh

Expected results
display device's udid, and banner

Actual results
./build.sh no problem
./run.sh When it's finished displaying device's udid, it's stuck.
if continue to open another terminal window to execute command: npm install、node app.js
there's no error but when you open http://localhost:9002 the error appeared.

Environment(version of libraries, mac OS, iOS, etc)
macbook air macOS 10.12.6
iPad Air2 iOS 11.2.6

Make sure you have nothing else such as QuickTime running at the same time. Otherwise it gets stuck waiting for a lock. Also, make sure the screen is on.

i'm sure there is no other app running at same time except ios_minicap terminal and safari

here are whole logs

seirradeMac:~ zhenniuren$ git clone https://github.com/openstf/ios-minicap
Cloning into 'ios-minicap'...
remote: Counting objects: 178, done.
remote: Total 178 (delta 0), reused 0 (delta 0), pack-reused 178
Receiving objects: 100% (178/178), 42.94 KiB | 187.00 KiB/s, done.
Resolving deltas: 100% (96/96), done.
seirradeMac:~ zhenniuren$

seirradeMac:ios-minicap zhenniuren$ ./build.sh
-- The C compiler identification is AppleClang 9.0.0.9000039
-- The CXX compiler identification is AppleClang 9.0.0.9000039
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/zhenniuren/ios-minicap/build
Scanning dependencies of target ios_minicap
[ 14%] Building CXX object CMakeFiles/ios_minicap.dir/src/minicap.cpp.o
[ 28%] Building CXX object CMakeFiles/ios_minicap.dir/src/SimpleServer.cpp.o
[ 42%] Building CXX object CMakeFiles/ios_minicap.dir/src/FrameListener.cpp.o
[ 57%] Building CXX object CMakeFiles/ios_minicap.dir/src/Banner.cpp.o
[ 71%] Building CXX object CMakeFiles/ios_minicap.dir/src/JpegEncoder.cpp.o
[ 85%] Building CXX object CMakeFiles/ios_minicap.dir/src/StreamClient.mm.o
[100%] Linking CXX executable ios_minicap
[100%] Built target ios_minicap
seirradeMac:ios-minicap zhenniuren$

seirradeMac:ios-minicap zhenniuren$ ./run.sh
++ system_profiler SPUSBDataType
++ sed -n -E -e '/(iPhone|iPad)/,/Serial/s/ *Serial Number: *(.+)/\1/p'

  • UDID=***********(hide)*********abcdedfg1234567
  • PORT=12345
  • RESOLUTION=400x600
  • ./build/ios_minicap --udid ***********(hide)*********abcdedfg1234567 --port 12345 --resolution 400x600
    EnableDALDevices
    2018-06-28 12:54:46.967 ios_minicap[1925:32142] Available devices:
    2018-06-28 12:54:46.968 ios_minicap[1925:32142] ***********(hide)*********abcdedfg1234567
    (it's stuck here)

seirradeMac:example zhenniuren$ npm install
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN example No repository field.
npm WARN example No license field.

added 54 packages from 50 contributors and audited 125 packages in 20.793s
found 0 vulnerabilities

seirradeMac:example zhenniuren$

seirradeMac:example zhenniuren$ node app.js
Listening on port 9002
Got a client
{ Error: connect ECONNREFUSED 127.0.0.1:12345
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:14)
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 12345 }
Be sure to run ios-minicap on port 12345
seirradeMac:example zhenniuren$

and the screen is on, but still can't work.

@sorccu thanks for your help, but i still can't make it work

Hi,
I have encountered similar problem.
I have tried several devices, iphone 6(10.3.3), iphone 5s(10.3.3), iphone 8(11.3.1).
The result is that while using iphone 8(11.3.1), I cannot get any screen img on browser.

log: ios-minicap
Allocating 731648 bytes for JPEG encoder
== Banner ==
version: 1
size: 24
pid: 55153
real width: 400
real height: 600
desired width: 400
desired height: 600
orientation:
quirks: 1
banner: 11871d7009010058200901005820001
New client connection

log: example\app.js
Listening on port 9002
Got a client

I just doubt that some compatibility issues come with iOS 11.

Thanks and look for help.

=========================================================
Updated:
Another devices tried. Both iphone X(11.2.1) and iphone 8(11.2.1) work well.
It seems some issues in iOS 11.3.1。

my iPad Air 2 (iOS 11.2.6) has issues too
how about iOS 11.4 ?

when it stuck and can not get banner. lock the screen and then unlock the screen. then it can get the banner. This operation works for me.

Seems on mojave(10.14) the situation more strange - after disaplay UDID it will crash, leaving a Abort trap: 6.
After tried rerun in lldb, a more detail log appears after the abort line:

[access] This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data.

But I don't know how to embed info.plist to a CLI standalone. Have tried LDFLAGS sectcreate method and seems that does not helps, anything same as before.