I want to launch an already installed app on iPhone/iOS simulator without providing .app or .zip path. Since I do not have those files with me now. Is it possible? Can I launch by just providing bunddle Id. Thanks in advance
3 Answers
YES! You can pass in the bundleId and it will find the application if it is already installed on the iPhone. You do not need to have the .app or .ipa file if the app is already installed on the device.
Sidenote, it seems you may not have access to another copy of the app....
If you are running on the simulator:
You can find the app in the ~/Library/Application Support/iPhone Simulator/7.1/Applications/
folder. By default, Appium will delete everything in that folder if the --no-reset
flag is not set when you start the Appium server. You should move the .app file to another folder like ~/projects/automation/app
if you do not have another copy of it!

- 3,097
- 2
- 16
- 42
-
Thanks @sheeptest. I am bit new to iOS and appium automation. For example I have candy crush installed on my iPhone , I will need UDID for it or something like that? – Changdeo Jadhav Jul 01 '14 at 14:39
-
The UDID is the unique device id of your iPhone. It it used to tell Appium which device to automate or install an app on. The bundle-id is what you would need to tell Appium which app you're talking about. I'm not an iOS dev, but I don't believe that's public information. Something you might look into is building a robot like [Tapster](https://github.com/hugs/tapsterbot/) with some camera or something that can see what's on the screen. That would be a *very* big project, though. – Jess Jul 01 '14 at 14:58
-
Thanks for info about UDID. I downloaded one open source game code , built it for iOS. Now I got .app file. Actually I am automating tests for an iOS app which measures battery usage and gives suggestion to user. There is one test case to launch game application use it for sometime , then go back to application and check if it has reflected the updated battery stats. – Changdeo Jadhav Jul 01 '14 at 15:27
-
Huh, interesting. I don't know if that will work because you need to have your phone plugged in for Appium, which will inadvertently charge it -- unless you figure out how to disable that. Also, I don't know if UIAutomation will make the phone use significantly more battery. But yeah, good idea using an open source game. That's probably the best solution. – Jess Jul 01 '14 at 15:40
-
hehe then I will have execute these tests on only simulator. Real device will not give accurate results. – Changdeo Jadhav Jul 02 '14 at 12:02
-
@ChangdeoJadhav : am also doing similar kind of thing. i want to open calendar app and add an event using appium. Is it possible? – Mak13 Oct 03 '16 at 12:01
-
I think so if you use the bundleId to open the app. Another fun little trick, tho: you can open the calendar app by going to a URL in safari. calendar:// -- you might even be able to create an event using their URL schemes. – Jess Oct 03 '16 at 12:04
So it sounds like you want to automate playing games on your iPhone to measure the battery usage while an arbitrary game is being played right?
There are many problems that could make this difficult, but one is that whatever tool you use to automatically play the game will consume additional power on the device, you could probably take some baseline measurements to correct for this, but that's additional work. Also like @sheeptest mentioned, most test frameworks require a USB connection to command the device and USB will charge the phone.
Another thing to consider is that batteries, being chemical devices, do wear out over time. Wha you really want to know is how many watts the phone is drawing while playing the game, and then from that you can calculate how long an ideal iPhone battery can power the phone while supplying that many watts. This will be difficult to calculate if you just measure how long the battery lasts due to battery wear.
Here's what I would consider if I had to measure the battery consumption while playing an arbitrary game on an iPhone:
- Hire a temp worker from a temp agency or craigslist to play the game for you. Much cheaper than trying to build an automated system to play arbitrary games.
- Power the phone via USB and connect a logging multimeter to the power leads within the USB cable.
- Set the multimeter to measure amps.
- Start capturing data from the multimeter.
- Tell your temp worker to live the dream and get payed to play candy crush
- While the game is being played you'll be able to monitor and log the current being drawn by the phone.
- When the phone dies you should be able to use the tools that came with the multimeter to find out how many watts of electricity were used during the test.

- 12,039
- 14
- 58
- 71
-
-
Hey Thanks @Mike Akers battery test is done manually only. We wanted to test our app which helps user to know about battery stats. Anyway we have dropped idea of automating this test for now :(. Thanks for your inputs. – Changdeo Jadhav Jul 03 '14 at 12:02
Due to my knowledge only accepts paths to .app files. BUT:
When an *.app is installed on the simulator device it is stored at:
~/Library/Application Support/iPhone Simulator/User/Applications/
So, just pass a link to the .app there will launch the application too.

- 11,765
- 7
- 42
- 85
-
This is incorrect. The app parameter accepts bundleids and is used when interacting with hardware devices and the simulator if the app is already on the device. – Jess Jun 30 '14 at 13:24
-
A very dumb question. Can I install apps from App store to my iOS simulator?? – Changdeo Jadhav Jul 01 '14 at 14:45
-
And will that also create .app file for the installed app in /User/Applications file? – Changdeo Jadhav Jul 01 '14 at 14:47
-
1Nope. I mean, it sounds like you want to build an automation tool to automate playing Candy Crush, and you're wondering if it's possible to scrape applications from the App Store for what's on the screen via Appium. Which sounds like a cool project, but I don't believe Appium can do that. You may have more options if you jailbreak your device, but I'm not familiar with that realm of stuff. – Jess Jul 01 '14 at 14:55