Ask a Question

iOS app Restart

slecault
Contributor

iOS app Restart

Is there a way to "restart" of an instrumented iOS app?

 

I use the following command with Android:

Mobile.Device.Process('com.myapp.abc').Restart;

 

 

Win10 / Server 2016 - Testing Delphi Application, Dynamic AX, Web, XamarinForms Mobile app iOS and Android over Appium, TC 15 and TestExecute
9 REPLIES 9
Marsha_R
Champion Level 3

Yes, I do have the process... the Restart is not one of its methods...

It does not appear with the autocomplete while the app is running on a connected device. If I force the ".restart" , I get "Undeclared identifier: Restart".

 

my code under iOS:

Mobile.Device.Process('myApp').Restart;

Win10 / Server 2016 - Testing Delphi Application, Dynamic AX, Web, XamarinForms Mobile app iOS and Android over Appium, TC 15 and TestExecute

my code under iOS:

Mobile.Device.Process('myApp').Restart;

----------------------------------------------

 

The examples at the link I posted all have a different format than you are using

 

Mobile.Device(mydevice).Process(myapp)

 

Try that and see if Restart shows up?

Hi,

 

What does 'Restart' mean?

You may press Home button one or more times until the main application's window is not visible.

However, to my understanding, this does not guarantee that the application is terminated.

For Android, the code to terminate the application looks like this:

device.ShellExecute('am force-stop ' + cPackageName);

I think that something like this should exist for iOS as well...

 

Regards,
  /Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================

Marsha,

 

My understanding is that when no device name is provided, the Current one is used.

Same result with:

Mobile.Device('iPhone de iPod').Process('myApp').Restart;

 

 

 

Win10 / Server 2016 - Testing Delphi Application, Dynamic AX, Web, XamarinForms Mobile app iOS and Android over Appium, TC 15 and TestExecute

Alex,

 

I do use the Android ShellExecute... but did not find an iOS equivalent yet.

 

The restart "closes" the app and restarts it without reinstalling the package.

When my scripts it a problem, I restart the app and move on to the next script.

 

My app does not behave the same after installing vs restarting.  Installing is a lot longer.

 

Might have a good idea using TestedApp. "kill" or ."Restart" with iOS

Win10 / Server 2016 - Testing Delphi Application, Dynamic AX, Web, XamarinForms Mobile app iOS and Android over Appium, TC 15 and TestExecute

Hi,

 

> Might have a good idea using TestedApp. "kill" or ."Restart" with iOS

Might be, indeed.

However, with the quick google search, it looks like this is just near to impossible in iOS (highly not recommended, at least):

http://iphonedevsdk.com/forum/iphone-sdk-development/32188-quit-and-restart-my-app-programatically.h...

https://forums.xamarin.com/discussion/16932/can-an-ios-app-restart-itself

https://developer.apple.com/library/content/qa/qa1134/_index.html

 

Regards,
  /Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
slecault
Contributor

I did open a support case for this issue.  Support response is:  "It's not possible to restart and/or close iOS apps from TestComplete. This is the limitation of the iOS support."

 

I have opened a "feature request".

 

Win10 / Server 2016 - Testing Delphi Application, Dynamic AX, Web, XamarinForms Mobile app iOS and Android over Appium, TC 15 and TestExecute

Just an FYI, there are some things that TestComplete can't do on iOS not because of the lack of features in TC but because of the limits that iOS has imposed.  

cancel
Showing results for 
Search instead for 
Did you mean: