Running xcode iOS simulator build - ios

I developed an iOS app with Facebook integration. I need to send an iOS simulator build for Facebook to review how the Facebook integration works on my app.
The link provides the instructions on how to create the iOS Simulator build.
https://developers.facebook.com/docs/ios/creating-ios-simulator-build-for-review/
The said link provides code that creates the iOS simulator build
xcodebuild -arch i386 -sdk iphonesimulator{version}
What I wanted to do is to run the app iOS Simulator Build. I want to test if iOS simulator build works.
I searched and found this:
Launch an iOS app in the simulator without XCode
which asked me to use this code to run the iOS simulator build.
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app/Contents/MacOS/iPhone\ Simulator -SimulateApplication ${PROJECT}/build/Debug-iphonesimulator/<yourapp>.app/<yourapp>
Yes, the iOS simulator runs however it does not launch my app.
How should I run the iOS simulator build on the simulator? Need help on this. Thanks!
Addition Note:
I am using Xcode 5.1.1

I had success using ios-sim. Then run with ios-sim launch <yourproject>.app

Update instructions for Xcode 6.x and later using simctl:
xcrun simctl install booted /path/to/your/built/simulator.app
xcrun simctl launch booted com.your.app.identifier

Related

Facebook review build must work on Xcode 7.3 simulator?

Facebook has rejected a simulator build created with Xcode 9.4.1, targeting iOS 11+, that was submitted for review with the message:
Please ensure that the Simulator Build provided works with Xcode Version 7.3, as this is the software our team uses in review. More information about creating simulator builds can be found here.
Is it possible to create such a build with Xcode 9?
I have tried installing the build I submitted on the Xcode 7.3.1 simulator like this:
DEVELOPER_DIR=/path/to/Xcode-7.3.1.app/Contents/Developer\
&&\
xcrun simctl install booted \
/Path/to/Xcode/DerivedData/App-Identifier/Build/Products/Release-iphonesimulator/App.app
but when I try to launch the app it crashes immediately, leaving an assertion failed: message with some hex digits in the system log. I suspect this is because it does not support iOS 9.3, which the simulator is running, but there could have been other changes to the simulator that are causing it to fail.
The link facebook provided says to run in the Xcode iPhone 5 simulator, but my version of Xcode only seems to have simulators going back to the 5s.
Do I need to make my app run under iOS 9.3? Or re-write it in swift 2.2 so I can build it using xcode 7.3?

Test app on iOS 7.1

I need to test my app on iOS 7.1 but ran out of options.
My setup:
MacBook running El Capitan Xcode 7
No physical devices running iOS 7
I cant run the iOS 7 simulator - the simulator says that the runtime cannot be found and I cannot download iOS 7 from "downloads.
Do you have any suggestions?
My advice:
(Remind: my English is limited, my expression is not very good!)
1.We can use Xcode7 to compiler to generate debug app
2.Use the xcode - select switch commandline tool to Xcode6.4
3.Run xcode6.4 iOS7 simulator
4.Using xcrun simctl installed test app to xcode6.4 iOS7 simulator
5.Run to check the effect (can't debugging)

Xcode 6.4 "Could not download and install iOS 8.3 simulator"

I've been trying to install iOS simulators 8.3 & 8.4 on Xcode 6.3.2 an 6.4 beta respectively. In the first case is not even an option to download this simulator while in Xcode 6.4 it shows an error "Could not download and install iOS 8.3 Simulator. Authorization is required to install the packages". I've searched the web but I could not find anything so I tries reinstalling Xcode from Apple developer website as well as from the app store with no change at all. The only simulator I can use is 8.2. I cannot install any other version. Any help would be really appreciated.
This is the error on Xcode 6.4 with no additional option of iOS 8.4 Simulator
These are the simulator options for me to download which result in that error
These are my options in Xcode 6.3.2 with no option for iOS 8.3
I found a workaround on the Apple forums. If you run Xcode using sudo the simulator downloads and installs work just fine:
sudo /Applications/Xcode.app/Contents/MacOS/Xcode
Note: Once the downloads and installs are complete you should quit Xcode and start it normally.
The iOS 8.3 Simulator runtime is includes in Xcode 6.3 (which is why it isn't offered as an additional download).
The iOS 8.3 Simulator runtime should be downloadable from Xcode 6.4, as you show. Your dialog box reports that there was an authentication problem when attempting to install the package. You need to provide administrator credentials when installing the package.
The reason you are getting your "iPhone 6 runs iOS 8.2 which is lower than -project name- minimum deployment target." errors is because you are selecting an iPhone 6 with iOS 8.2 on it and not an iPhone 6 with iOS 8.3 on it.
Use 'xcrun simctl create' or Xcode's Devices window to create the iOS 8.3 devices you need.

Run .app file in iOS 8 simulator

I have a .app file shared from a developer which i would like to run in iOS 8 simulator. I have seen similar questions which has solutions for older versions of iOS which is no longer working for iOS 8. Can someone point out what needs to be done to run the .app file in an iOS 8 simulator without using xcode.
Boot the simulator you want to install it to in the iOS Simulator and then do the following:
xcrun simctl install booted /path/to/Your.app
xcrun simctl launch booted com.yourcompany.yourapp
The "booted" token was not supported on older versions of simctl in Xcode 6.0. If you get an error, please use the full device UDID instead of "booted". You can determine the UDID by running xcrun simctl list
If the application crashes after installing in the simulator using the command,
xcrun simctl install booted /path/to/Your.app
It's probably because the architecture issues, since we used the device build instead of simulator build.
The basic architecture difference between the iphone simulator and iphone device is
iPhone simulator uses the architecture i386 or x86_x64
whereas,
iPhone device uses the architecture arm64 or armv7 or armv7s
We can find each device architectures in this link. So to over come this problem we need to get the simulator build by changing the xcode build location settings.
SOLUTION :
To change the build location settings, Open your xcode and follow the below steps.
Go to xcode preferences.
Choose the locations tab.
In the 'Derived Data:' section click 'advanced', from the resulting screen choose 'legacy'.
Now build the application, after successful build go to 'Your-App-Folder/build/Debug-iphonesimulator' in finder, and copy the build available on the same folder with the extension .app
Copy that and run the above command answered by #jeremy.
xcrun simctl install booted /path/to/Your.app
After running this command, note that your simulator is installed with the build you specified. There you go, run the application in simulator by clicking the corresponding app and use it.
I deliberately write this solution to help the needy, those who are clueless about the architecture issues specified above.
Happy Coding :)
iOS Simulator also supports dragging and dropping for installing .app files
Open Simulator
you can do it through XCode under XCode > Open Developer Tool > Simulator
to open it "without using xcode", see these answers.
Find the .app file in Finder and drag it into your Simulator window
Wait for the app to install and launch it
For developers looking to provide a simulator build to theirs testers, these are the steps that I followed to create and test a build -
Add i386 in valid architectures section of build settings.
Open terminal and navigate to your project folder. Then execute the command -
xcodebuild -arch i386 -sdk iphonesimulator8.1
(This will build the application)
To install the application on simulator, run the command mentioned in the above answer i.e -
xcrun simctl install booted /path/to/Your.app
Now you should be able to run the app by clicking on the installed application in the simulator.
I have followed all the above commands and stuff but none worked. All I was doing is creating .app through archiving the app from Product->Archive and then converting that generated .ipa to .app by changing the extension to .zip.
But the app is crashing as and when it is being launched.
For those facing the same issue, go to
DerivedData/projectname/Build/Products/Debug-iphonesimulator/
folder. There you can find the .app file with app name. You need to use this .app file by dragging and dropping onto the simulator. Product->Archive->.app doesn't work.

iOS app exits before launch

I am new to iOS development and as a newbie I’ve created a very simple Hello World application using Xcode 4.3.3 against iOS 5.0 SDK on my MacBook air. I have set Deployment Target to 3.2 and Base SDK (in build settings) has been set to iOS 5.1
The output build runs fine on iPhone 4.3 simulator but when I copy output HelloWorld.app to my jailbroken iPod using a SSH client the app icon appears however when I run it, the app exits before launch.
My iPod OS version is 4.2.1 and I can run a lot of app from cydia however it sounds like I’m missing something when I build my own app.
Valid Architecture is set to armv6 armv7
Is there anybody help me with that?
The executable that is deployed to the Simulator cannot be just copied to a device. Xcode should do it for you and it needs a development certificate. There is a way, however, to patch Xcode to do it without certificate, but you have to search how to do it.

Resources