How to run a fresh install of the application every time unit tests are run?

后端 未结 2 1515
南旧
南旧 2021-02-05 13:16

I\'ve setup some XCTest unit tests for my application and would like every time I run tests for it to run in a brand new install of the application. Currently when

相关标签:
2条回答
  • 2021-02-05 13:39

    In addition to @rintaro's answer, if you set "Provide build settings from" to your app, you can add a generic command, which will keep working when your bundle id changes:

    xcrun simctl uninstall booted ${PRODUCT_BUNDLE_IDENTIFIER}
    
    0 讨论(0)
  • 2021-02-05 13:42

    Maybe this works, but only for Simulator.

    In Product > Scheme > Edit Scheme...

    enter image description here

    xcrun simctl is command line utility to control the iOS Simulator. This uninstalls com.yourcompany.AppName application from booted simulator before running tests.

    I don't know how to do like this for real device :(

    0 讨论(0)
提交回复
热议问题