Can Appium run against applications already installed on the iOS Emulator?

2,383 views
Skip to first unread message

Wulf

unread,
Jun 3, 2013, 3:09:28 PM6/3/13
to appium-...@googlegroups.com
I'm having no luck generating a .app package or a zipped .app package that Appium can run on an iOS Emulator. See my previous post on this issue here

Is there any way to run Appium against an application that is already installed on the iOS Emulator? 

If so, how would I point Appium at this application in my capabilities code block?

Any feedback would be deeply appreciated!

Thanks,

Wulf

bootstrap online

unread,
Jun 3, 2013, 3:16:37 PM6/3/13
to Wulf, appium-...@googlegroups.com
You should have a build target that's able to produce .app which can
then be used by Appium.
> --
> http://appium.io
> ---
> You received this message because you are subscribed to the Google Groups
> "Appium-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to appium-discus...@googlegroups.com.
> Visit this group at http://groups.google.com/group/appium-discuss?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Jonathan Lipps

unread,
Jun 3, 2013, 3:22:10 PM6/3/13
to bootstrap online, Wulf, appium-...@googlegroups.com
You can't run Appium against apps that are already on the simulator, though you can run it against apps that are already on a real device.

Your .app should simply be one that is built for the simulator.

From there, right-click on the .app and click "Compress". The resulting zip file should work well.

Wulf

unread,
Jun 3, 2013, 4:22:27 PM6/3/13
to appium-...@googlegroups.com, bootstrap online, Wulf
Thanks guys!

Well, I haven't tried writing actual automation of my test.app gui yet but I was finally able to get Appium to launch my Test.app which was already installed on the emulator. Here's what I did:

1) My app is called Test.app, so with the help of one of the other Devs here I ran the following command on my Mac--which hosts the Xcode IDE and runs the emulator:

mdfind -name Test.app

This returned the following:

/Users/wulf/GitRepos/QA_Family_Repo/qa/projects/story/appium/ZipArchives/Test.app.zip

/Users/wulf/Library/Developer/Xcode/DerivedData/TestApp-fjekoxkdvajqnvafhsdyxtcguxad/Build/Products/Debug-iphonesimulator/Test.app

/Users/wulf/Library/Developer/Xcode/DerivedData/TestApp-fjekoxkdvajqnvafhsdyxtcguxad/Build/Products/Debug-iphonesimulator/Test.app.dSYM

/Users/wulf/Library/Application Support/iPhone Simulator/5.1/Applications/EABBA4BF-D259-40C3-9D09-8B1636B029F7/Test.app

/Users/wulf/Library/Developer/Xcode/DerivedData/TestApp-fjekoxkdvajqnvafhsdyxtcguxad/Build/Products/Release-iphonesimulator/Test.app

/Users/wulf/Library/Developer/Xcode/DerivedData/TestApp-fjekoxkdvajqnvafhsdyxtcguxad/Build/Products/Release-iphonesimulator/Test.app.dSYM

/Users/wulf/Library/Application Support/iPhone Simulator/6.0/Applications/0B349B86-5274-4B9A-8F16-920D00B181EC/Test.app

/Users/wulf/GitRepos/QA_Family_Repo/qa/projects/story/appium/ZipArchives/Test.app

/Users/wulf/Library/Developer/Xcode/DerivedData/TestApp-fjekoxkdvajqnvafhsdyxtcguxad/Build/Intermediates/ArchiveIntermediates/TestApp QA/BuildProductsPath/Release-iphoneos/Test.app.dSYM

/Users/wulf/Library/Developer/Xcode/DerivedData/TestApp-fjekoxkdvajqnvafhsdyxtcguxad/Build/Products/Release-iphoneos/Test.app

/Users/wulf/Library/Developer/Xcode/DerivedData/TestApp-fjekoxkdvajqnvafhsdyxtcguxad/Build/Products/Release-iphoneos/Test.app.dSYM

2) I chose:

/Users/wulf/Library/Developer/Xcode/DerivedData/TestApp-fjekoxkdvajqnvafhsdyxtcguxad/Build/Products/Release-iphonesimulator/Test.app 

ad the app (already installed on the emulator) as the app that I wanted to launch and automate.

3) In the Appium interface, I checked the "App Path" box and then clicked on Choose and navigated to:

/Users/wulf/Library/Developer/Xcode/DerivedData/TestApp-fjekoxkdvajqnvafhsdyxtcguxad/Build/Products/Release-iphonesimulator/Test.app

and then clicked the LAUNCH button.

4) In my Java code I commented out (did not use):

cap.setCapability("app", "/Users/wulf/Library/Developer/Xcode/DerivedData/TestApp-fjekoxkdvajqnvafhsdyxtcguxad/Build/Products/Release-iphonesimulator/Test.app");


@Before

public void setup() throws Exception

{

    DesiredCapabilities cap = new DesiredCapabilities();

    cap.setCapability("device", "iPhone Simulator");

    //cap.setCapability("app", "/Users/wulf/Library/Developer/Xcode/DerivedData/TestApp-fjekoxkdvajqnvafhsdyxtcguxad/Build/Products/Release-iphonesimulator/Test.app");

        

    driver = new RemoteWebDriver(new URL("http://localhost:4723/wd/hub"), cap);


}


5) And then in my Eclipse/Java/Appium/WebDriver project I right-clicked and selected run-as JUnit, and poof! The emulator launched and my application launched!

So, the next step of course is to see if I can get any automation working and barring that, implement what has been kindly suggested above!

Thanks for the feedback and help!

Wulf


Dan Cuellar

unread,
Jun 4, 2013, 3:26:57 PM6/4/13
to appium-...@googlegroups.com, bootstrap online, Wulf
You can run against apps already on the emulator, just provide the app path from ~/Library/Application Support/iPhone Simulator/6.1/Applications/GUID FOLDER NAME/App.app

This does not work for apps that come with the OS like Settings, Photos, etc. only non-apple apps.

Jonathan Lipps

unread,
Jun 4, 2013, 3:43:11 PM6/4/13
to Dan Cuellar, appium-...@googlegroups.com, bootstrap online, Wulf
Actually it does work for apple apps. Examples of starting safari and the preferences app are in the tests/ folder for Appium.

On Jun 4, 2013, at 12:26 PM, Dan Cuellar <dancu...@gmail.com> wrote:

You can run against apps already on the emulator, just provide the app path from ~/Library/Application Support/iPhone Simulator/6.1/Applications/GUID FOLDER NAME/App.app

This does not work for apps that come with the OS like Settings, Photos, etc. only non-apple apps.

Dan Cuellar

unread,
Jun 4, 2013, 3:50:07 PM6/4/13
to appium-...@googlegroups.com, Dan Cuellar, bootstrap online, Wulf
The technique I described cannot work for those apps. They do not exist in ~/Library/Application Support/iPhone Simulator/6.1/Applications/

Jlipps, The examples you reference use a different technique, not by supplying the full path to the .app in the simulator applications folder.


Jonathan Lipps

unread,
Jun 4, 2013, 3:54:52 PM6/4/13
to Dan Cuellar, appium-...@googlegroups.com, bootstrap online, Wulf
Hmm. Check out app/helpers.js:53. You're right they're not in ~/Library but they are in /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/Applications/.

On Jun 4, 2013, at 12:50 PM, Dan Cuellar <dancu...@gmail.com> wrote:

The technique I described cannot work for those apps. They do not exist in ~/Library/Application Support/iPhone Simulator/6.1/Applications/

Jlipps, The examples you reference use a different technique, not by supplying the full path to the .app in the simulator applications folder.



Dan Cuellar

unread,
Jun 4, 2013, 3:57:36 PM6/4/13
to appium-...@googlegroups.com, Dan Cuellar, bootstrap online, Wulf
Looks like the common apps and the apps for the user are in two different locations. This is good to know. 
Reply all
Reply to author
Forward
0 new messages