calabash / calabash-ios

Calabash for iOS
Other
1.81k stars 369 forks source link

calabash can't dismiss iPhone Activation springboard alert #1371

Closed abardallis closed 6 years ago

abardallis commented 6 years ago

calabash-cucumber: 0.21.2 run-loop: 2.6.4 ruby 2.3.4 iPhone 8/iOS 11.0

Doesn't look like Calabash is able to dismiss the "iPhone not Activated" springboard alert.

[35mDEBUG: HTTP: post http://192.168.1.78:27753/1.0/dismiss-springboard-alerts {:retries=>1200, :timeout=>120}[0m

  Expected status code < 400, found 500.

  Server replied with:

  {"title"=>"iPhone is not Activated", "buttons"=>["Dismiss"], "tries"=>20, "error"=>"A SpringBoard alert is blocking test execution and it cannot be dismissed."}

This is occurring when using libimobiledevice to restart the device prior to test execution. If there is a sim card in the device, I see this springboard alert shortly after the tests start executing (even when in airplane mode as others have suggested elsewhere).

The other route is to pull the sim cards however, I then see the "No SIM Card Installed" springboard alert immediately after the device restarts. Because of this alert, I cannot get the app launched or get connection to the test server in order to send any dismiss-springboard-alert commands.

Pulling all the SIM cards would be a solution if the SIM card alert that shows immediately is easier to handle, and putting deactivated SIMs in all the devices would be another solution if the Activation alert that shows up shortly after execution is easier to handle. Unfortunately, putting active SIMs in all the devices to bypass all alerts is not an option due to budget constraints.

jmoody commented 6 years ago

I can add this to DeviceAgent.

However, if a SpringBoard alert is showing before DeviceAgent is launched, the alert will block SpringBoard.

jmoody commented 6 years ago

The change is on the develop branch. There will be a release when Xcode 9.3 drops.

Look through the issues for SpringBoard alerts for ways to manually dismiss this alert.

abardallis commented 6 years ago

As always, much appreciated.

abardallis commented 6 years ago

Just to help anyone who may stumble on this in the future:

As of this date, inserting a not-yet-activated SIM card from one of those "bring your own phone" or prepaid type plans (you can get these for a couple dollars at most grocery stores, at least in the US), will keep the No SIM Card Installed popup from showing and will also prevent the phone from showing the iPhone is not Activated springboard alert.

I hope this won't change in future versions of iOS as this is an easy and inexpensive fix if either of these springboard alerts appear before DeviceAgent is able to launch.