vigossjjj / CrashMonkey4IOS

iOS Monkey Test Tool.
MIT License
344 stars 135 forks source link

真机没问题,使用ios模拟器的时候报错:Invalid device, Please given a vaild device! #59

Closed yanzisucheng closed 7 years ago

yanzisucheng commented 8 years ago

IOS模拟器使用报错

现象:

1、启动模拟器,直接使用smart_monkey -a com.lao.lao2,界面一直停留在{:app_path=>"com.lao.lao2", :run_count=>1, :time_limit_sec=>nil, :detail_event_count=>50}

2、启动模拟器,使用smart_monkey -a com.lao.lao2 -w 'iPhone 6 948F2886-233D-4D28-A6B7-6C9B6808C7E7' 报错:grep: invalid character range.Invalid device, Please given a vaild device!

3、启动模拟器,使用smart_monkey -a com.lao.lao2 -w 948F2886233D4D28A6B76C9B6808C7E7 报错提示 :grep: invalid character range.Invalid device, Please given a vaild device!

真机可以正常使用。

ytlvy commented 8 years ago

smart_monkey -a com.lao.lao2 -w '948F2886-233D-4D28-A6B7-6C9B6808C7E7' 这样写 不过这样写我也保错:

2016-04-21 14:05:59.160 instruments[26796:341423] WebKit Threading Violation - initial use of WebKit from a secondary thread. Invalid device, Please given a vaild device!

cnrting commented 8 years ago

iPhone6、6s模拟器均报错,提示invalid device,试过给UUID加冒号,也试过使用“iPhone 6 (9.3)” 这样的格式,都不行,真机没问题。没启动instruments的话,smart_monkey --list-devices会卡住

finallyopen123 commented 8 years ago

执行时候报错如下 =================================== Start Test (1/1) ======================================= 2016-07-12 20:29:26.808 instruments[2690:4585024] WebKit Threading Violation - initial use of WebKit from a secondary thread. sh: -c: line 0: syntax error near unexpected token (' sh: -c: line 0:idevicecrashreport -u 99C1F477-10AC-48D7-BB37-E82DA3AB12E3 (Simulator) -e -k /Users/abc-123/Downloads/CrashMonkey4IOS/bin/smart_monkey_result/report_20160712202924/crash_1' Attempting iOS device system log capture via deviceconsole. Stop iOS system log capture. Invalid device, Please given a vaild device! 2016-07-12 20:29:33.539 instruments[2748:4585390] WebKit Threading Violation - initial use of WebKit from a secondary thread. ^C/Users/abc-123/Downloads/CrashMonkey4IOS/lib/smart_monkey/monkey_runner.rb:225:in `': Interrupt from /Users/abc-123/Downloads/CrashMonkey4IOS/lib/smart_monkey/monkey_runner.rb:225:infind_device' from /Users/abc-123/Downloads/CrashMonkey4IOS/lib/smart_monkey/monkey_runner.rb:199:in device' from /Users/abc-123/Downloads/CrashMonkey4IOS/lib/smart_monkey/monkey_runner.rb:86:inblock in run_a_case' from /Users/abc-123/Downloads/CrashMonkey4IOS/lib/smart_monkey/monkey_runner.rb:605:in watch_syslog' from /Users/abc-123/Downloads/CrashMonkey4IOS/lib/smart_monkey/monkey_runner.rb:81:inrun_a_case' from /Users/abc-123/Downloads/CrashMonkey4IOS/lib/smart_monkey/monkey_runner.rb:48:in block in run' from /Users/abc-123/Downloads/CrashMonkey4IOS/lib/smart_monkey/monkey_runner.rb:45:intimes' from /Users/abc-123/Downloads/CrashMonkey4IOS/lib/smart_monkey/monkey_runner.rb:45:in run' from ./smart_monkey:58:in

'

helenakeep commented 7 years ago

smart_monkey --list-devices我也会卡住,同求

yanzisucheng commented 7 years ago

边学ruby边调试变排查,终于查出monkey_runner.rb下的find_device函数,没有针对后面的“] (Simulator)”后缀处理(以前是没有这个后缀的),所以这里需要修改下,不然所有模拟器都不能用(真机可以)。改好了打算提pull request的,没想到已经有前辈提了还给出具体原因。请大家移步。哎,我咋不早点去看看呢,重复造了轮子后才知道这个问题早就解决了。。。。