How do I uninstall iOS App via command line?

Mobile Testing, Android App Testing.
tvu
Posts: 195
Joined: Tue Apr 07, 2015 10:47 pm

How do I uninstall iOS App via command line?

Post by tvu » Thu Oct 08, 2015 10:53 pm

How do I go about uninstalling an iOS app via command line? I tried looking around the site and the forum, but I can't seem to find an obvious place for it.

This is what I want to do:
1. Create an IPA (via command line on a Mac)
2. Instrument the IPA file (via Ranorex.Instrumentation.exe)
3. For each mobile device:
3a. Uninstall current app
3b. Install new instrumented IPA file (via "Deploy iOS App action in a recording")

I figured out everything except step 3a. I know you can instrument an IPA, uninstall and deploy your app using Ranorex.Instrumentation.exe all in one step. But, I want to save some time and instrument the IPA once. Then use that single file to install on multiple devices.

Thanks in advance.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: How do I uninstall iOS App via command line?

Post by Support Team » Fri Oct 09, 2015 1:51 pm

Hi tvu,

In order to uninstall the application from your device you have to use the Instrumentation Wizard in combination with the appid (ai): flag.

The application Id (bundle identifier of the app) is required so that an application can be uninstalled prior to installing the new archive. It can be set to '[auto]' to resolve it automatically during instrumentation.

Since iOS is a very restricted system, it is unfortunately not possible to uninstall the application directly from the command line.Therefore, the following workaround should solve your problem

Use the Ranorex.Instrumentation Wizard with the following command

"C:\Program Files (x86)\Ranorex 5.4\Bin\Ranorex.Instrumentation.exe" /pagename:ios /devicename:"YOURDEVICE" /deploymode:Usb /inputpath:"PATH_TO_INSTRUMENTED_IPA" /keypath:"PATH_TO_P12_FILE" /password:"PASSWORD_FOR_P12_FILE" /provisionpath:"PATH_TO_mobileprovision" /appid:"APP_ID" /skipinstrumentation:true

This will uninstall the old version of your application and install the new (already instrumented) version. There is no need to instrument the application in every iteration if you set the /skipinstrumentation to true.

Hope this helps.

Regards,
Markus (S)

tvu
Posts: 195
Joined: Tue Apr 07, 2015 10:47 pm

Re: How do I uninstall iOS App via command line?

Post by tvu » Fri Oct 09, 2015 11:29 pm

Thanks Markus!

tvu
Posts: 195
Joined: Tue Apr 07, 2015 10:47 pm

Re: How do I uninstall iOS App via command line?

Post by tvu » Mon Oct 12, 2015 10:36 pm

There seems to be some type of bug with the Instrumentation Wizard. I can not reliably install an instrumented IPA with this method. I've notice that it will delete the app and then says it install the new one when it actually has not.

I found this same issue when I tried to do it in Ranorex Studio. I would instrument and install a new app. During this process, an instrumented IPA file will be created and saved in "\Documents\Ranorex\InstrumentedIpa" directory. I would then delete my app and try to install the instrumented ipa (with the Instrument the App under test option unchecked). The Wizard would tell me it was installed, but it hasn't.

I have however observed that I can reliably instrument and install an IPA if I do it in one step instead of breaking it down into two.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: How do I uninstall iOS App via command line?

Post by Support Team » Tue Oct 13, 2015 10:08 am

Hi tvu,

Thanks for the feedback, but unfortunately I was not able to reproduce the mentioned behavior.

I've tried this command with several applications on my device and it was removed and installed as expected.
May I ask you which version of Ranorex you are currently using?

Regards,
Markus (S)

tvu
Posts: 195
Joined: Tue Apr 07, 2015 10:47 pm

Re: How do I uninstall iOS App via command line?

Post by tvu » Tue Oct 13, 2015 4:57 pm

I am using Ranorex 5.4.2.25689.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: How do I uninstall iOS App via command line?

Post by Support Team » Wed Oct 14, 2015 8:39 am

Hi tvu,

Thank you for the information. Since I'm also using 5.4.2 and the command works as expected on my machine, I'd like to ask you to get in touch with us by email to discuss additional steps.
Thank you.

Regards,
Markus (S)

tvu
Posts: 195
Joined: Tue Apr 07, 2015 10:47 pm

Re: How do I uninstall iOS App via command line?

Post by tvu » Wed Oct 14, 2015 10:45 pm

The issue I am facing in the link before is stopping me from reproducing the issue. Once that is fix, I will retest this and contact you via email.

http://www.ranorex.com/forum/instrument ... t8610.html

tvu
Posts: 195
Joined: Tue Apr 07, 2015 10:47 pm

Re: How do I uninstall iOS App via command line?

Post by tvu » Tue Oct 27, 2015 9:09 pm

I can no longer reproduce this issue. It appears this was related to my other issue I posted here: http://www.ranorex.com/forum/instrument ... t8610.html

Thank you very much for all the help!