Giter Club home page Giter Club logo

fastbot_ios's Introduction

Introduction

Fastbot is a model-based testing tool for modeling GUI transitions to discover app stability problems. It combines machine learning and reinforcement learning techniques to assist discovery in a more intelligent way.

Related: Fastbot_Android

***More detail see at Fastbot architecture

update 2022.1

  • update Fastbot Revised License
  • release AnyTrace, the Fastbot test management assistant: supports one-click Fastbot test start, crash analysis, etc. (AnyTrace User Manual)

Prepare test environment

  • cd Fastbot-iOS && pod install --repo-update
  • Open Fastbot-iOS.xcworkspace, Set FastbotRunner Signing & Capabilities and Bundle ID
  • USB connected the device & trust the device, if you're using a simulator, start up the simulator
  • Open FastbotRunner network permission (unnecessary for simulator), a sample on device 00008030-001054A80C82802E:
BUNDLEID=com.apple.Pages duration=240 throttle=300 xcodebuild test  -workspace Fastbot-iOS.xcworkspace -scheme FastbotRunner  -configuration Release  -destination 'platform=iOS,id=00008030-001804563E44802E' -only-testing:FastbotRunner/FastbotRunner/testPingNetwork
    • By tapping FastbotRunner on the device, the screen of the device would go black for about one minute. During the black screen interval, users should press the home button on the device to go back to the main screen. Wait patiently until the network setting dialog window pops up. Users should allow the pop up request in order to continue.
    • If "ping network success" appears in the console log, that means get network permission successful

Run Test

  • Ensure that your application can run on the device. (Installed and trusted)
  • Environment Variables should be setted in command line or Xcode IDE/Scheme/Test
key note sample
BUNDLEID Test App's Bundle ID com.apple.Pages
duration Test duration, units of minutes 300
launchenv Start arguments for Test APP, can be empty or key-values separated with ":" isAutoTestUI=1:channel=AutoTest
throttle Throttle for operate, units of millisecond 300
  • A sample run test on device 00008030-001054A80C82802E. if IDE scheme Env Vars changed , command Env Var would be void:
BUNDLEID=com.apple.Pages duration=240 throttle=300 xcodebuild test  -workspace Fastbot-iOS.xcworkspace -scheme FastbotRunner  -configuration Release  -destination 'platform=iOS,id=00008030-001804563E44802E' -only-testing:FastbotRunner/FastbotRunner/testFastbot

More detail see at 中文手册


Advanced Extension

Stub mode: Target dynamic library fastbot_stub. Stub mode requires injection of fastbot_stub into the test app. The library captures GUI structure by parsing the app under test for fastbot. More customized features (eg. hook callback, cut View) can be constructed by users for additional abilities such as blocking certain view from being clicked, customized ViewControllers, etc.

We highly appreciate any contribution from the community !!!

Usage: After injecting fastbot_stub to app, you need:

key sample
launchenv stubPort=9797
dataport 9797

Analytics

To prioritize and improve Fastbot-iOS, FastbotRunner collects usage data and uploads it to Google Analytics. FastbotRunner collects the md5 hash of the test app's Bundle ID, this information allows us to measure the volume of usage. If they wish, users can choose to disable the Analytics by skip step Open FastbotRunner network permission or change FastbotRunner's Wireless Data to off in System Preference.


Support

  • Public technical discussion on github is preferred.

  • Q&A:

    Q: Get Error when pod install --repo-update
    A: install pod firstly sudo gem install cocoapods -v=1.8.1

    Q: Get Error: Assert Fail Timed out while evaluating UI query
    A: Restart test or Replug USB or Change a USB line or Restart iPhone

    Q: Get Error when use simulator
    A: Change to Debug Mode in scheme setting

    Q: Get unkown install Error:com.apple.dt.MobileDeviceErrorDomain
    A: Check your signing certificate or Replug USB or Change a USB line or Restart iPhone


License

Copyright©2021 Bytedance

Licensed under Fastbot Revised

Fastbot-iOS required some features are based on or derives from projects below:

Publications

If you use our work in your research, please kindly cite us as:

  1. Lv, Zhengwei, Chao Peng, Zhao Zhang, Ting Su, Kai Liu, Ping Yang (2022). “Fastbot2: Reusable Automated Model-based GUI Testing for Android Enhanced by Reinforcement Learning”. In proceedings of the 37th IEEE/ACM International Conference on Automated Software Engineering (ASE 2022). ACM, To appear. [pdf]
@inproceedings{fastbot2,
  title={Fastbot2: Reusable Automated Model-based GUI Testing for Android Enhanced by Reinforcement Learning},
  author={Lv, Zhengwei and Peng, Chao and Zhang, Zhao and Su, Ting and Liu, Kai and Yang, Ping},
  booktitle={Proceedings of the 37th IEEE/ACM International Conference on Automated Software Engineering (ASE 2022)},
  year={2022}
}
  1. Peng, Chao, Zhao Zhang, Zhengwei Lv, Ping Yang (2022). “MUBot: Learning to Test Large-Scale Commercial Android Apps like a Human”. In proceedings of the 38th International Conference on Software Maintenance and Evolution (ICSME 2022). IEEE, To appear. [pdf]
@inproceedings{mubot,
  title={MUBot: Learning to Test Large-Scale Commercial Android Apps like a Human},
  author={Peng, Chao and Zhang, Zhao and Lv, Zhengwei and Yang, Ping},
  booktitle={Proceedings of the 38th International Conference on Software Maintenance and Evolution (ICSME 2022)},
  year={2022}
}
  1. Cai, Tianqin, Zhao Zhang, and Ping Yang. “Fastbot: A Multi-Agent Model-Based Test Generation System”. In Proceedings of the IEEE/ACM 1st International Conference on Automation of Software Test. 2020. [pdf]
@inproceedings{fastbot,
  title={Fastbot: A Multi-Agent Model-Based Test Generation System},
  author={Cai, Tianqin and Zhang, Zhao and Yang, Ping},
  booktitle={Proceedings of the IEEE/ACM 1st International Conference on Automation of Software Test},
  pages={93--96},
  year={2020}
}

fastbot_ios's People

Contributors

bytedance-se-research avatar geron-cn avatar zhangzhao4444 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fastbot_ios's Issues

和fastmonkey功能上的区别是什么?什么时候能支持登录的配置,黑白名单等功能呢?

现在我的fastbot_ios跑起来,目前使用起来好像和之前的fastmonkey功能差不多,什么时候能够支持更多的配置功能。另外能不能提供一下更多的参数命令,目前,我用tidevice xctest -B com.hikvison.FastbotRunner.xctrunner -e BUNDLEID:com.xxxx -e duration:5 --debug 可以跑起来,不知道是否有其他模式或者更多命令,期待更多的功能开放哦~

App crash 之后,一直循环出现网络未连接

执行命令
tidevice xctest -B bytedance.FastbotRunnermenmen.xctrunner -e BUNDLEID:com.xiaomi.mihome.dailybuild -e duration:5 --debug

app crash 之前一切正常,app crash 之后提示如下
命令窗口消息

[D 210804 11:01:09 _instruments:606] Ignore notification from server: 2189, 0x2, ('outputReceived:fromProcess:atTime:', ['2021-07-07 01:36:30.981371+0800 FastbotRunner-Runner[360:16170] Task .<156> HTTP load failed (error code: -1009 [1:50])\n2021-07-07 01:36:30.981845+0800 FastbotRunner-Runner[360:16170] Task .<156> finished with error - code: -1009\n', 360, 50461342180])
[D 210804 11:01:09 _instruments:591] DTXMessage: expects_reply:0 flags:2 ('outputReceived:fromProcess:atTime:', ['2021-07-07 01:36:30.982993+0800 FastbotRunner-Runner[360:16170] error Error Domain=NSURLErrorDomain Code=-1009 "似乎已断开与互联网的连接。" UserInfo={NSUnderlyingError=0x280555aa0 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, NSErrorFailingURLStringKey=http://www.bytedance.com/, NSErrorFailingURLKey=http://www.bytedance.com/, _kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=50, NSLocalizedDescription= 似乎已断开与互联网的连接。}\n', 360, 50461395943])
[D 210804 11:01:09 _device:944] logProcess: 2021-07-07 01:36:30.982993+0800 FastbotRunner-Runner[360:16170] error Error Domain=NSURLErrorDomain Code=-1009 "似乎已断开与互联网的连接。" UserInfo={NSUnderlyingError=0x280555aa0 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, NSErrorFailingURLStringKey=http://www.bytedance.com/, NSErrorFailingURLKey=http://www.bytedance.com/, _kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=50, NSLocalizedDescription=似乎已断开与互联网的连接。}
[D 210804 11:01:09 _instruments:606] Ignore notification from server: 2190, 0x2, ('outputReceived:fromProcess:atTime:', ['2021-07-07 01:36:30.982993+0800 FastbotRunner-Runner[360:16170] error Error Domain=NSURLErrorDomain Code=-1009 "似乎已断开与互联网的连接。" UserInfo={NSUnderlyingError=0x280555aa0 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, NSErrorFailingURLStringKey=http://www.bytedance.com/, NSErrorFailingURLKey=http://www.bytedance.com/, _kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=50, NSLocalizedDescription=似乎已断开与互联网的连接。}\n', 360, 50461395943])
[D 210804 11:01:09 _instruments:591] DTXMessage: expects_reply:0 flags:2 ('outputReceived:fromProcess:atTime:', ['2021-07-07 01:36:30.984414+0800 FastbotRunner-Runner[360:13910] By tapping FastbotRunner on the device, the screen of the device would go black for about one minute. During the black screen interval, users should press the home button on the device to go back to the main screen. Wait patiently until the network setting dialog window pops up. Users should allow the pop up request in order to continue.\n', 360, 50461417931])
[D 210804 11:01:09 _device:944] logProcess: 2021-07-07 01:36:30.984414+0800 FastbotRunner-Runner[360:13910] By tapping FastbotRunner on the device, the screen of the device would go black for about one minute. During the black screen interval, users should press the home button on the device to go back to the main screen. Wait patiently until the network setting dialog window pops up. Users should allow the pop up request in order to continue.
[D 210804 11:01:09 _instruments:606] Ignore notification from server: 2191, 0x2, ('outputReceived:fromProcess:atTime:', ['2021-07-07 01:36:30.984414+0800 FastbotRunner-Runner[360:13910] By tapping FastbotRunner on the device, the screen of the device would go black for about one minute. During the black screen interval, users should press the home button on the device to go back to the main screen. Wait patiently until the network setting dialog window pops up. Users should allow the pop up request in order to continue.\n', 360, 50461417931])
[D 210804 11:01:10 _instruments:591] DTXMessage: expects_reply:0 flags:2 ('outputReceived:fromProcess:atTime:', ['2021-07-07 01:36:31.990096+0800 FastbotRunner-Runner[360:14491] TIC TCP Conn Failed [157:0x283f7f9c0]: 1:50 Err(50)\n', 360, 50485545444])
[D 210804 11:01:10 _device:944] logProcess: 2021-07-07 01:36:31.990096+0800 FastbotRunner-Runner[360:14491] TIC TCP Conn Failed [157:0x283f7f9c0]: 1:50 Err(50)
[D 210804 11:01:10 _instruments:606] Ignore notification from server: 2192, 0x2, ('outputReceived:fromProcess:atTime:', ['2021-07-07 01:36:31.990096+0800 FastbotRunner-Runner[360:14491] TIC TCP Conn Failed [157:0x283f7f9c0]: 1:50 Err(50)\n', 360, 50485545444])
[D 210804 11:01:10 _instruments:591] DTXMessage: expects_reply:0 flags:2 ('outputReceived:fromProcess:atTime:', ['2021-07-07 01:36:31.995081+0800 FastbotRunner-Runner[360:14491] Task <30591829-C23E-450E-AC2E-B403C7F2F43B>.<157> HTTP load failed (error code: -1009 [1:50])\n', 360, 50485664947])
[D 210804 11:01:10 _device:944] logProcess: 2021-07-07 01:36:31.995081+0800 FastbotRunner-Runner[360:14491] Task <30591829-C23E-450E-AC2E-B403C7F2F43B>.<157> HTTP load failed (error code: -1009 [1:50])
[D 210804 11:01:10 _instruments:606] Ignore notification from server: 2193, 0x2, ('outputReceived:fromProcess:atTime:', ['2021-07-07 01:36:31.995081+0800 FastbotRunner-Runner[360:14491] Task <30591829-C23E-450E-AC2E-B403C7F2F43B>.<157> HTTP load failed (error code: -1009 [1:50])\n', 360, 50485664947])
[D 210804 11:01:10 _instruments:591] DTXMessage: expects_reply:0 flags:2 ('outputReceived:fromProcess:atTime:', ['2021-07-07 01:36:31.995464+0800 FastbotRunner-Runner[360:14491] Task <30591829-C23E-450E-AC2E-B403C7F2F43B>.<157> finished with error - code: -1009\n2021-07-07 01:36:31.996000+0800 FastbotRunner-Runner[360:14491] error Error Domain=NSURLErrorDomain Code=-1009 "似乎已断开与互联网的连接。" UserInfo={NSUnderlyingError=0x28055d860 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, NSErrorFailingURLStringKey=http://www.bytedance.com/, NSErrorFailingURLKey=http://www.bytedance.com/, _kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=50, NSLocalizedDescription=似乎已断开与互联网的连接。}\n', 360, 50485678231])
[D 210804 11:01:10 _device:944] logProcess: 2021-07-07 01:36:31.995464+0800 FastbotRunner-Runner[360:14491] Task <30591829-C23E-450E-AC2E-B403C7F2F43B>.<157> finished with error - code: -1009
2021-07-07 01:36:31.996000+0800 FastbotRunner-Runner[360:14491] error Error Domain=NSURLErrorDomain Code=-1009 "似乎已断开与互联网的连接。" UserInfo={NSUnderlyingError=0x28055d860 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, NSErrorFailingURLStringKey=http://www.bytedance.com/, NSErrorFailingURLKey=http://www.bytedance.com/, _kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=50, NSLocalizedDescription=似乎已断开与互联网的连接。}
[D 210804 11:01:10 _instruments:606] Ignore notification from server: 2194, 0x2, ('outputReceived:fromProcess:atTime:', ['2021-07-07 01:36:31.995464+0800 FastbotRunner-Runner[360:14491] Task <30591829-C23E-450E-AC2E-B403C7F2F43B>.<157> finished with error - code: -1009\n2021-07-07 01:36:31.996000+0800 FastbotRunner-Runner[360:14491] error Error Domain=NSURLErrorDomain Code=-1009 "似乎已断开与互联网的连接。" UserInfo={NSUnderlyingError=0x28055d860 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, NSErrorFailingURLStringKey=http://www.bytedance.com/, NSErrorFailingURLKey=http://www.bytedance.com/, _kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=50, NSLocalizedDescription=似乎已断开与互联网的连接。}\n', 360, 50485678231])
[D 210804 11:01:10 _instruments:591] DTXMessage: expects_reply:0 flags:2 ('outputReceived:fromProcess:atTime:', ['2021-07-07 01:36:31.996585+0800 FastbotRunner-Runner[360:13910] By tapping FastbotRunner on the device, the screen of the device would go black for about one minute. During the black screen interval, users should press the home button on the device to go back to the main screen. Wait patiently until the network setting dialog window pops up. Users should allow the pop up request in order to continue.\n', 360, 50485701026])
[D 210804 11:01:10 _device:944] logProcess: 2021-07-07 01:36:31.996585+0800 FastbotRunner-Runner[360:13910] By tapping FastbotRunner on the device, the screen of the device would go black for about one minute. During the black screen interval, users should press the home button on the device to go back to the main screen. Wait patiently until the network setting dialog window pops up. Users should allow the pop up request in order to continue.

pod install --repo-update 失败


Error loading the plugin cocoapods-byted-dependency-1.2.47.

NameError - uninitialized constant Informative
/Users/heyalu/.rvm/gems/ruby-2.6.3/gems/cocoapods-byted-dependency-1.2.47/lib/byted-dependency.rb:14:in compatibility_check' /Users/heyalu/.rvm/gems/ruby-2.6.3/gems/cocoapods-byted-dependency-1.2.47/lib/byted-dependency.rb:46:in <top (required)>'
/Users/heyalu/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in require' /Users/heyalu/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in require'
/Users/heyalu/.rvm/gems/ruby-2.6.3/gems/cocoapods-byted-dependency-1.2.47/lib/cocoapods_plugin.rb:1:in <top (required)>' /Users/heyalu/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in require'
/Users/heyalu/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in require' /Users/heyalu/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/claide-1.0.3/lib/claide/command/plugin_manager.rb:94:in block in safe_activate_and_require'
/Users/heyalu/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/claide-1.0.3/lib/claide/command/plugin_manager.rb:94:in each' /Users/heyalu/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/claide-1.0.3/lib/claide/command/plugin_manager.rb:94:in safe_activate_and_require'
/Users/heyalu/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/claide-1.0.3/lib/claide/command/plugin_manager.rb:31:in block in load_plugins' /Users/heyalu/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/claide-1.0.3/lib/claide/command/plugin_manager.rb:30:in map'
/Users/heyalu/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/claide-1.0.3/lib/claide/command/plugin_manager.rb:30:in load_plugins' /Users/heyalu/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:326:in block in run'
/Users/heyalu/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:325:in each' /Users/heyalu/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:325:in run'
/Users/heyalu/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52:in run' /Users/heyalu/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.10.1/bin/pod:55:in <top (required)>'
/Users/heyalu/.rvm/gems/ruby-2.6.3/bin/pod:23:in load' /Users/heyalu/.rvm/gems/ruby-2.6.3/bin/pod:23:in '
/Users/heyalu/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in eval' /Users/heyalu/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in '


Error loading the plugin cocoapods-mbox-support-1.6.0.5.

Gem::ConflictError - Unable to activate cocoapods-mbox-support-1.6.0.5, because cocoapods-1.10.1 conflicts with cocoapods (< 1.7.0)
/Users/heyalu/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/specification.rb:2298:in raise_if_conflicts' /Users/heyalu/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/specification.rb:1415:in activate'
/Users/heyalu/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/claide-1.0.3/lib/claide/command/plugin_manager.rb:93:in safe_activate_and_require' /Users/heyalu/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/claide-1.0.3/lib/claide/command/plugin_manager.rb:31:in block in load_plugins'
/Users/heyalu/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/claide-1.0.3/lib/claide/command/plugin_manager.rb:30:in map' /Users/heyalu/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/claide-1.0.3/lib/claide/command/plugin_manager.rb:30:in load_plugins'
/Users/heyalu/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:326:in block in run' /Users/heyalu/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:325:in each'
/Users/heyalu/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:325:in run' /Users/heyalu/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52:in run'
/Users/heyalu/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.10.1/bin/pod:55:in <top (required)>' /Users/heyalu/.rvm/gems/ruby-2.6.3/bin/pod:23:in load'
/Users/heyalu/.rvm/gems/ruby-2.6.3/bin/pod:23:in <main>' /Users/heyalu/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in eval'
/Users/heyalu/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `'

Command

/Users/heyalu/.rvm/gems/ruby-2.6.3/bin/pod install --repo-update

Stack

   CocoaPods : 1.10.1
        Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin19]
    RubyGems : 3.0.8
        Host : Mac OS X 10.15.7 (19H524)
       Xcode : 12.4 (12D4e)
         Git : git version 2.27.0
Ruby lib dir : /Users/heyalu/.rvm/rubies/ruby-2.6.3/lib
Repositories : ***

Error

NameError - uninitialized constant Informative
/Users/heyalu/.rvm/gems/ruby-2.6.3/gems/cocoapods-byted-dependency-1.2.47/lib/byted-dependency.rb:14:in `compatibility_check'
/Users/heyalu/.rvm/gems/ruby-2.6.3/gems/cocoapods-byted-dependency-1.2.47/lib/byted-dependency.rb:29:in `parse'
/Users/heyalu/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:330:in `run'
/Users/heyalu/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52:in `run'
/Users/heyalu/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.10.1/bin/pod:55:in `<top (required)>'
/Users/heyalu/.rvm/gems/ruby-2.6.3/bin/pod:23:in `load'
/Users/heyalu/.rvm/gems/ruby-2.6.3/bin/pod:23:in `<main>'
/Users/heyalu/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `eval'
/Users/heyalu/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `<main>'

stub模式可以写个文档吗

对于新手小白,能可以写个stub模式的注入还有比如登陆脚本怎么搞吗?或者有个指导方向。

建议屏蔽AirDrop功能

应用有分享功能, Fastbot经常触发AirDrop功能, 手机中已经把蓝牙关闭了, 但是Fastbot会触发启用蓝牙功能!!! 然后分享出去...
screenshot

使用tidevice执行Fastbot iOS, 支持Windows上执行

  • 执行命令(Fastbot的参数使用-e 指定)
tidevice xctest -B fastbot的bundle_id -e BUNDLEID:被测应用的bundle_id -e duration:测试时长 -e throttle:300
  • 实际例子(基于QQ音乐)
tidevice xctest -B bytedance.FastbotRunner -e BUNDLEID:com.tencent.QQMusic -e duration:5 --debug

放到Jenkins上执行报错

image
/usr/bin/codesign --force --sign 4D2F77F076A50438CE3E071A1042C5090B2540FB --deep --preserve-metadata=identifier,entitlements,flags --timestamp=none /Users/mobileqa/Library/Developer/Xcode/DerivedData/Fastbot-iOS-ftlwwegzexsvdhdubsndhwljhbbo/Build/Products/Release-iphoneos/FastbotRunner-Runner.app/Frameworks/libXCTestSwiftSupport.dylib
/Users/mobileqa/Library/Developer/Xcode/DerivedData/Fastbot-iOS-ftlwwegzexsvdhdubsndhwljhbbo/Build/Products/Release-iphoneos/FastbotRunner-Runner.app/Frameworks/libXCTestSwiftSupport.dylib: replacing existing signature
/Users/mobileqa/Library/Developer/Xcode/DerivedData/Fastbot-iOS-ftlwwegzexsvdhdubsndhwljhbbo/Build/Products/Release-iphoneos/FastbotRunner-Runner.app/Frameworks/libXCTestSwiftSupport.dylib: errSecInternalComponent
Command /usr/bin/codesign failed with exit code 1

Test session results, code coverage, and logs:
/Users/mobileqa/Library/Developer/Xcode/DerivedData/Fastbot-iOS-ftlwwegzexsvdhdubsndhwljhbbo/Logs/Test/Test-FastbotRunner-2021.08.20_18-27-25-+0800.xcresult

Testing failed:
FastbotRunner:
Command /usr/bin/codesign failed with exit code 1
Testing cancelled because the build failed.

** TEST FAILED **

The following build commands failed:
CodeSign /Users/mobileqa/Library/Developer/Xcode/DerivedData/Fastbot-iOS-ftlwwegzexsvdhdubsndhwljhbbo/Build/Products/Release-iphoneos/FastbotRunner-Runner.app/Frameworks/libXCTestSwiftSupport.dylib
(1 failure)
Build step 'Execute shell' marked build as failure
Finished: FAILURE

Fastbot -iOS在如图界面停留了超过半小时还不出来,好不容易出来,没几分钟,又再次进去,又玩半个小时,绝望。。。

我的 app 主页有 5 个按钮作为入口,这个入口在右上角(如图二),Fastbot -iOS在(如图一)界面停留了超过半小时还不出来,好不容易出来,没几分钟,又再次进去,又玩半个小时,绝望。。。不知道为什么进入这里的频率和时长这么久。

这个页面需要点击四个CheckBox(或者 CheckBox 后面的文本也是点击区域)才能出去到主页面,Fastbot -iOS有时候也把这四个CheckBox点击出去了,但是没过两分钟,又进去了,我真的是气死了。

希望Fastbot -iOS能处理这种情况,不要在这里停留太久,就算停留很久,也不要再次进入了,否则完全无法起到遍历的效果啊。

IMG_8805

image

运行出现报错无法截图

2021-08-04 13:40:41.317466+0800 FastbotRunner-Runner[447:28160] get desc failed 0
t = 478.07s Pressing Home button
t = 480.18s Open com.ihoment.GoVeeSensor
t = 480.18s Activate com.ihoment.GoVeeSensor
t = 480.19s Wait for com.ihoment.GoVeeSensor to idle
:0: error: -[FastbotRunner testFastbot] : Failed to get screenshot: Timed out while requesting screenshot.
t = 481.21s Tear Down
Test Case '-[FastbotRunner testFastbot]' failed (484.085 seconds).

运行报错,APP卡住

image

运行4次出现一次,xcode:Version 12.5.1 (12E507)、Mac os:11.4、iOS:14.4

APP页面截图:
image

运行testPingNetWork报错

iOS: 14.4.2
Xcode: Version 10.2.1 (10E1001)

根据文档执行 testPingNetWork 时报错,应该是调用了高版本的 API

image

无法安装(通过升级xocde以及重新拉取项目,可以正常使用了)

Details

Unable to install "FastbotRunner-Runner"
Domain: com.apple.dtdevicekit
Code: -402620415

App installation failed
Domain: com.apple.dtdevicekit
Code: -402620415
Failure Reason: An unknown error has occurred.
User Info: {
DVTRadarComponentKey = 487927;
"com.apple.dtdevicekit.stacktrace" = (
0 DTDeviceKitBase 0x00000001250566e7 DTDKCreateNSError + 109
1 DTDeviceKitBase 0x0000000125056de9 DTDK_AMDErrorToNSError + 792
2 DTDeviceKitBase 0x000000012509656a __90-[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:]_block_invoke + 164
3 DVTFoundation 0x000000010b16b156 DVTInvokeWithStrongOwnership + 73
4 DTDeviceKitBase 0x0000000125096301 -[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:] + 1589
5 IDEiOSSupportCore 0x0000000124f2fa25 __118-[DVTiOSDevice(DVTiPhoneApplicationInstallation) processAppInstallSet:appUninstallSet:installOptions:completionBlock:]_block_invoke.352 + 4523
6 DVTFoundation 0x000000010b29c3ba DVT_CALLING_CLIENT_BLOCK + 7
7 DVTFoundation 0x000000010b29da92 __DVTDispatchAsync_block_invoke + 809
8 libdispatch.dylib 0x00007fff796a85f8 _dispatch_call_block_and_release + 12
9 libdispatch.dylib 0x00007fff796a963d _dispatch_client_callout + 8
10 libdispatch.dylib 0x00007fff796af8e0 _dispatch_lane_serial_drain + 602
11 libdispatch.dylib 0x00007fff796b0396 _dispatch_lane_invoke + 385
12 libdispatch.dylib 0x00007fff796b86ed _dispatch_workloop_worker_thread + 598
13 libsystem_pthread.dylib 0x00007fff798e3611 _pthread_wqthread + 421
14 libsystem_pthread.dylib 0x00007fff798e33fd start_wqthread + 13
);
}

运行几分钟后,app卡住

2021-08-04 16:09:46.635034+0800 FastbotRunner-Runner[18686:948823] block in page, force back happend
t = 484.95s Terminate com.XXXXX 18740
[fastbot] : select new action from unvisited Unsaturated

控制台显示block in page, force back happend 然后app重启是什么问题?

run test时,运行一段时间后,线程被kill

xcode log:[fastbot] : build state cost: 0.000s action cost: 0.000s total cost 0.000s
2021-08-04 05:14:08.915766+0800 FastbotRunner-Runner[696:369904] ticker shot desc cost 0.059585 netact 0.000556 second, left 18108.826298s
t = 25099.91s Open com.bilibili.bilianime
t = 25100.01s Activate com.bilibili.bilianime
/Users/wangshaoce/bilibili_test/Fastbot_iOS/Fastbot-iOS/FastbotRunner/FastbotRunner.m:73: error: -[FastbotRunner testFastbot] : Failed to launch com.bilibili.bilianime: 未能完成该操作。Unable to launch com.bilibili.bilianime because the device was not, or could not be, unlocked.
/Users/wangshaoce/bilibili_test/Fastbot_iOS/Fastbot-iOS/FastbotRunner/FastbotRunner.m:73: error: -[FastbotRunner testFastbot] : Failed to activate application 'com.bilibili.bilianime' (current state: Running Background Suspended)
t = 25160.18s Wait for com.bilibili.bilianime to idle
t = 25161.29s Tear Down
2021-08-04 05:15:16.453698+0800 FastbotRunner-Runner[696:178321] state g0s5590 action SCROLL_TOP_DOWN pos[4,19,410,70] throttle 0.10
Test Case '-[FastbotRunner testFastbot]' failed (25166.559 seconds).
Test Suite 'FastbotRunner' failed at 2021-08-04 05:15:16.560.
Executed 1 test, with 2 failures (0 unexpected) in 25166.559 (25166.560) seconds
Test Suite 'FastbotRunner.xctest' failed at 2021-08-04 05:15:16.563.
Executed 1 test, with 2 failures (0 unexpected) in 25166.559 (25166.563) seconds
Test Suite 'Selected tests' failed at 2021-08-04 05:15:16.572.
Executed 1 test, with 2 failures (0 unexpected) in 25166.559 (25166.573) seconds
[fastbot] : select new action from unvisited Unsaturated
[fastbot] : total visit count is 52568
[fastbot] : state visited: 3
[fastbot] : action first visited, get reward 1.000000
[fastbot] : got reward: 18.1485
[fastbot] : build state cost: 0.000s action cost: 0.000s total cost 0.000s
2021-08-04 05:15:18.738365+0800 FastbotRunner-Runner[696:178321] state g0s3586 action SCROLL_RIGHT_LEFT pos[2,2,410,926] throttle 0.10
FastbotRunner-Runner(696,0x16d197000) malloc: *** error for object 0x2825de390: pointer being freed was not allocated
FastbotRunner-Runner(696,0x16d197000) malloc: *** set a breakpoint in malloc_error_break to debug
(lldb)

启动命令:
image

Where can I get the test report?

Very appreciate your great tools. The tool is very convenient to use, too.
I tried to create some crashes in my app, and then test it with Fastbot for two minutes. The app did crash, but Fastbot will restart it. When the time runs out, it will show that the test was successful.
How can I get a report of how many times my app crashed during the test time and where did the crash occur?

ios monkey执行failed,帮忙看下是什么原因导致的

[fastbot] : build state cost: 0.000s action cost: 0.000s total cost 0.000s
2021-09-14 18:04:42.297691+0800 FastbotRunner-Runner[273:79023] ticker shot desc cost 0.039769 netact 0.000741 second, left 35060.206984s
2021-09-14 18:04:42.454325+0800 FastbotRunner-Runner[273:4394] state g0s46 action SCROLL_RIGHT_LEFT pos[0,480,374,812] throttle 0.30
2021-09-14 18:04:42.946799+0800 FastbotRunner-Runner[273:96294] ticker shot desc cost 0.000004 netact 0.000023 second, left 35059.557825s
2021-09-14 18:04:42.946995+0800 FastbotRunner-Runner[273:96294] get desc failed 0
:0: error: -[FastbotRunner testFastbot] : Failed to get screenshot: Not authorized for performing UI testing actions.
t = 8147.12s Tear Down
Test Case '-[FastbotRunner testFastbot]' failed (8147.335 seconds).
Test Suite 'FastbotRunner' failed at 2021-09-14 18:04:43.169.
Executed 1 test, with 1 failure (0 unexpected) in 8147.335 (8147.337) seconds
Test Suite 'FastbotRunner.xctest' failed at 2021-09-14 18:04:43.170.
Executed 1 test, with 1 failure (0 unexpected) in 8147.335 (8147.338) seconds
Test Suite 'Selected tests' failed at 2021-09-14 18:04:43.172.
Executed 1 test, with 1 failure (0 unexpected) in 8147.335 (8147.342) seconds
2021-09-14 18:04:43.356 xcodebuild[21444:864516] [MT] IDETestOperationsObserverDebug: 8153.789 elapsed -- Testing started completed.
2021-09-14 18:04:43.356 xcodebuild[21444:864516] [MT] IDETestOperationsObserverDebug: 0.000 sec, +0.000 sec -- start
2021-09-14 18:04:43.356 xcodebuild[21444:864516] [MT] IDETestOperationsObserverDebug: 8153.789 sec, +8153.789 sec -- end
2021-09-14 18:04:43.662 xcodebuild[21444:864516] [MT] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-18212/IDEFoundation/Execution/Schemes/IDETestSchemeAction.m:537
Details: Error saving invocation record to resultBundlePath:Error Domain=IDEFoundationErrorDomain Code=12 "The scheme actions invocation record could not be saved due to an error." UserInfo={NSLocalizedDescription=The scheme actions invocation record could not be saved due to an error., NSUnderlyingError=0x7f893fd82690 {Error Domain=(extension in IDEFoundation):__C.IDESchemeActionTestAttachment.Error Code=0 "failed to import attachment at path /Users/zhangyajuan/Library/Developer/Xcode/DerivedData/Fastbot-iOS-eiifnnvhwfvbmjbrajpflbvwxeto/Logs/Test/Test-FastbotRunner-2021.09.14_15-48-48-+0800.xcresult/Staging/1_Test/Attachments/Screenshot_0D91D00F-C42A-4C7F-9978-718A457A49D6.jpg, underlying error: noEntry"}}

Object: <IDETestSchemeAction: 0x7f893d0a4510>
Method: -testOperationWithSchemeOperationParameters:testManager:buildOperation:buildParameters:schemeCommand:actionRecord:testRunSpecificationGroups:coverageBuildableInfos:deviceAvailableChecker:outError:actionCallbackBlock:
Thread: <NSThread: 0x7f8937c19280>{number = 1, name = main}
Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.

Test session results, code coverage, and logs:
/Users/zhangyajuan/Library/Developer/Xcode/DerivedData/Fastbot-iOS-eiifnnvhwfvbmjbrajpflbvwxeto/Logs/Test/Test-FastbotRunner-2021.09.14_15-48-48-+0800.xcresult

Failing tests:
FastbotRunner:
-[FastbotRunner testFastbot]

** TEST FAILED **

执行testPingNetwork报错,麻烦看下。

Ld /Users/hspcadmin/Library/Developer/Xcode/DerivedData/Fastbot-iOS-ecjlnosjaifznhcycjsrnhjqvewf/Build/Products/Debug-iphoneos/FastbotRunner-Runner.app/PlugIns/FastbotRunner.xctest/FastbotRunner normal (in target 'FastbotRunner' from project 'Fastbot-iOS')
cd /Users/hspcadmin/Desktop/Fastbot_iOS/Fastbot-iOS
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target arm64-apple-ios9.0 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.5.sdk -L/Users/hspcadmin/Library/Developer/Xcode/DerivedData/Fastbot-iOS-ecjlnosjaifznhcycjsrnhjqvewf/Build/Products/Debug-iphoneos -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib -F/Users/hspcadmin/Library/Developer/Xcode/DerivedData/Fastbot-iOS-ecjlnosjaifznhcycjsrnhjqvewf/Build/Products/Debug-iphoneos -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks -F/Users/hspcadmin/Desktop/Fastbot_iOS/Fastbot-iOS/Pods/../fastbot -iframework /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks -iframework /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks -iframework /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks -iframework /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.5.sdk/Developer/Library/Frameworks -filelist /Users/hspcadmin/Library/Developer/Xcode/DerivedData/Fastbot-iOS-ecjlnosjaifznhcycjsrnhjqvewf/Build/Intermediates.noindex/Fastbot-iOS.build/Debug-iphoneos/FastbotRunner.build/Objects-normal/arm64/FastbotRunner.LinkFileList -Xlinker -rpath -Xlinker @loader_path/Frameworks -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/hspcadmin/Library/Developer/Xcode/DerivedData/Fastbot-iOS-ecjlnosjaifznhcycjsrnhjqvewf/Build/Intermediates.noindex/Fastbot-iOS.build/Debug-iphoneos/FastbotRunner.build/Objects-normal/arm64/FastbotRunner_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -fobjc-arc -fobjc-link-runtime -ObjC -lxml2.2 -framework FastbotLib -framework XCTAutomationSupport -framework XCTest -framework fastbot_cv -framework fastbot_native -framework XCTest -lPods-FastbotRunner -Xlinker -no_adhoc_codesign -Xlinker -dependency_info -Xlinker /Users/hspcadmin/Library/Developer/Xcode/DerivedData/Fastbot-iOS-ecjlnosjaifznhcycjsrnhjqvewf/Build/Intermediates.noindex/Fastbot-iOS.build/Debug-iphoneos/FastbotRunner.build/Objects-normal/arm64/FastbotRunner_dependency_info.dat -o /Users/hspcadmin/Library/Developer/Xcode/DerivedData/Fastbot-iOS-ecjlnosjaifznhcycjsrnhjqvewf/Build/Products/Debug-iphoneos/FastbotRunner-Runner.app/PlugIns/FastbotRunner.xctest/FastbotRunner

ld: library not found for -lPods-FastbotRunner

clang: error: linker command failed with exit code 1 (use -v to see invocation)

使用命令行运行,duration等参数未生效

命令:BUNDLEID=com.xxx duration=30 throttle=300 xcodebuild test -workspace Fastbot-iOS.xcworkspace -scheme FastbotRunner -configuration Release -destination 'platform=iOS,id=00008101-xx' -only-testing:FastbotRunner/FastbotRunner/testFastbot

运行时,duration是30分钟,但是实际运行是5分钟,后来发现,我在xcode里面配置的scheme是5分钟,这个命令行参数未生效

fastbot-stub遍历配置

不好意思哈,英语不太好。有两个问题请教下:

  1. 我看那个fastbot-stub的文档说,要先把fastbot-stub注入到测试app里?这是怎么操作注入的呢?
  2. 第二步,取消注释,shceme里新增两个参数launchenv和dataport
    这样就可以进行遍历了吗??

iOS monkey运行经常中断

iOS monkey运行经常中断,中断后查看大多数是设备掉线
想咨询一下平时你们跑monkey,跑之前或执行完成后有没有一些初始化操作,来增加稳定性呢
还有iOS usb连接稳定性这块,有什么好的经验可以分享吗?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.