share Xcode compiled app to other emulator

al404

macrumors 6502
Original poster
Apr 24, 2011
430
19
Novara, Italy
I'm realizing my first phonegap app and i need o share the iOS app with a coworker that has a mac and iPhone emulator woking

I can compile my app in Xcode and see it on iPhone emulator, i guess that the .ipa file is somewhere on my local machine, can i get it and pass the .ipa to coworker so he can see it on his emulator?
 

firewood

macrumors 604
Jul 29, 2003
7,634
869
Silicon Valley
Yes.

You can copy a directory containing your app built for the iOS Simulator from here:
~/Library/Developer/CoreSimulator/Devices/{magic-number}/data/Containers/Bundle/Application/
where each Simulated iOS device has its own magic number.

Best way I've found to find the magic number is to create and run an iOS test app with a unique name, run it on just the one Simulated device of interest (do this for both the source Mac and your coworker's target Mac), then use Spotlight to find in which subdirectory Xcode put the app bundle. Then copy the magic number from the directory path to use for copying apps. You can zip up the app bundle (directory) and then unzip it on the destination Mac.
 
  • Like
Reactions: al404

PBG4 Dude

macrumors 68030
Jul 6, 2007
2,644
1,809
Or.. you could print the app bundle's directory to your log window:

print("Path = \(Bundle.main)") // Swift 4
 

kage207

macrumors 6502a
Jul 23, 2008
961
8
Why would you want to compile to another simulator? Why not have the person clone the project and compile it themselves? That's generally the best way.
 

firewood

macrumors 604
Jul 29, 2003
7,634
869
Silicon Valley
Why would you want to compile to another simulator? Why not have the person clone the project and compile it themselves? That's generally the best way.
This assumes you want to give that person access to the repository, project and/or source code, and that that person knows how to build and run a project, as opposed to merely how to run a Simulation (which can be launched by merely tapping an icon).
 

kage207

macrumors 6502a
Jul 23, 2008
961
8
This assumes you want to give that person access to the repository, project and/or source code, and that that person knows how to build and run a project, as opposed to merely how to run a Simulation (which can be launched by merely tapping an icon).
Then they should provide an .ipa file to install it onto an iOS device.
 

firewood

macrumors 604
Jul 29, 2003
7,634
869
Silicon Valley
Then they should provide an .ipa file to install it onto an iOS device.
That only works for Developer registered devices, which are limited in number. iOS Simulator builds can be distributed without restriction to anyone who can download and install Xcode. Even interested parties who have no iOS device.
 

kage207

macrumors 6502a
Jul 23, 2008
961
8
That only works for Developer registered devices, which are limited in number. iOS Simulator builds can be distributed without restriction to anyone who can download and install Xcode. Even interested parties who have no iOS device.
Then ask yourself, does this person really need to be testing?

Also you can build the *.ipa file and have the person install it onto an iOS device using iTunes and this doesn't waste a Developer Registered Device slot.
 

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
This is really what TestFlight is for. You get a very large number of testers (2000) and the apps can be installed on any device. It also avoids messing with adhoc distribution and sharing Simulator builds.
 

firewood

macrumors 604
Jul 29, 2003
7,634
869
Silicon Valley
This is really what TestFlight is for.
Note that the OP's original question specified that the other person had a Mac, not an iOS device. Making TestFlight useless.

Then ask yourself, does this person really need to be testing?
Possibly yes. There are lots of skilled graphics artists (as well as more than a few UI designers, mobile app developers, usability testers, and general app users with insightful opinions) who have Macs, but are Android mobile phone users. The coworker at the next desk over might be one of them.
 
Last edited:

al404

macrumors 6502
Original poster
Apr 24, 2011
430
19
Novara, Italy
What it says firewood is correct, some people have a mac and Android phone ( like me ) so I thought that sharing an .ipa over iPhone simulator could be an easy way to share the app.

I occasionally develop an app via PhoneGap and make my client buy a developer subscription, so we would like to make the purchase when app will be almost ready.
 

kage207

macrumors 6502a
Jul 23, 2008
961
8
Possibly yes. There are lots of skilled graphics artists (as well as more than a few UI designers, mobile app developers, usability testers, and general app users with insightful opinions) who have Macs, but are Android mobile phone users. The coworker at the next desk over might be one of them.
Then they should learn Git and have Xcode installed if they are so skilled.

That's what my designers have done while we were busy setting up automating distribution.

EDIT: I'm really not trying to be rude here but the facts are the facts. You can't distribute the .ipa file from the simulator. You can setup read access to the Git repository to ensure that a designer doesn't accidentally make changes.

Also, you really should have a good README to have anyone be able to setup the code to at least get the project built / simulator going. Otherwise the project isn't going to be maintainable.

Invest into some test iOS devices, otherwise you're just providing another barrier into the development process. Remove these as much as possible so you can get back to doing what you do best, writing code.
 
Last edited:

firewood

macrumors 604
Jul 29, 2003
7,634
869
Silicon Valley
You can't distribute the .ipa file from the simulator.
No, but you can distribute a pre-built for Simulator iOS app bundle. (I know because I've done it. Required because portions of the source code in a project had legal or contract restrictions on distribution. Thus, no repository access allowed outside the core development team.)
 

firewood

macrumors 604
Jul 29, 2003
7,634
869
Silicon Valley
The method you describe above has been deprecated from what I'm finding.
But it still works. I just dragged a pre-built-for-Simulator app bundle into:
~/Library/Developer/CoreSimulator/Devices/{magic-number}/data/Containers/Bundle/Application/
and the app ran on the new Simulated iOS device just fine. Xcode 8.3.3 Simulator 10.0 latest Mac App Store latest release.