IOS Simulators -not Installing Apps - ios

I followed the below process in order to install apps in IOS simulators
1.I have Test.app file with me go to Library->application support->iPhone simulator->6.1->Application->i created new folder and i placed my test.app file in that folder as of i knew after when we open the simulator we can able to see that particular app in the simulator it doesn't happened in my case
2.i followed the cd in terminal window xcrun simctl install booted (my test.app path ) it showing error that
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
and i tried with different methods which i had read in internet but nothing is working
so guide me how to install the app in IOS simulators and how to work with them.

Related

How to install ipa file on simulator or real device?

I have ipa file and I can extract the app file if I dragged and drop the app file to simulator it's crashing in the landing page,
Whenever I'm dragging the ipa file to device and simulator manager I'm unable to install it for both simulator and real ios
However, when I am using same ipa file with BrowserStack it's installing the ipa without any problem and its working fine.
I am not sure what I'm missing
What is the correct follow of installing the ipa/app file for both emulator and simulator?
To install the app on iOS Simulator:
xcrun simctl install <Simulator ID> <Path to .ipa>

Is it possible to install a ".app" build file to an iPad from within Xcode, without loading the actual project file?

Without actually loading my .xcodeproj into Xcode, is it possible, from the Xcode app, to start an app install to my iPad using the .app file only, which was generated in an earlier build?
This is my last line of inquiry... I'm just looking at potential options because I don't have a paid developer account (yet) and might try to use Teamviewer to log into the remote client Mac to install via Xcode, but do not wish to reveal my project file/code on the remote machine. Installing from within Xcode purely using the .app file would solve my problem, if possible.
I managed to work out a way to do it using this, this, and this. You will need the XCode command line tools, which come as part of the App Store XCode install, or you can get the command line tools only from here.
First up, download and install npm. Then install ios-deploy from the terminal,
sudo npm install -g ios-deploy --unsafe-perm --allow-root
If you need to build from the command line, make sure you have a working XCode project which builds as you want, open a terminal and go to the directory with your .xcodeproj inside, then type:
xcodebuild -list -project <NAME>.xcodeproj/
xcodebuild -scheme <SCHEME NAME> build
Then, or if you've already built in XCode and just want to deploy your .app file to the iOS device, type:
ios-deploy debug --bundle <APP PATH>
You can change debug to release, or either way it will use whatever you set your XCode build configuration to be I think. The <APP PATH> location depends on your XCode install, but the most recent location (I think) is
~/Library/Developer/Xcode/DerivedData/{app name}/Build/Products/Deployment/
This will install your .app onto the iOS device from the command line, and you don't need to load XCode up, or expose your source files. Just requires the .app file. For me, this is a potentially useful way to install an app remotely on a client's device without the need for a paid developer account.

How do I solve Xcode's "This app could not be installed at this time." error

Sometimes, Xcode will not install Apps in the simulator, giving nothing more than the message "This app could not be installed at this time.".
The simulator writes a log for the events that occur while installing an App.
To access it, list the available simulators by typing this in the terminal:
instruments -s devices
this will give you a list with entries like
iPad Pro (10.5-inch) (11.4) [75DE3247-4641-4D71-BAC1-3EC3B019FC87] (Simulator)
Copy the uuid between the brackets for the simulator you are using.
Then type
cd ~/Library/Logs/CoreSimulator/<THE-UUID-YOU-JUST-COPIED>/MobileInstallation
You are now in a directory, that contains the installation logs.
Open the newest log and look for errors of your installation (most likely at the end of the log).
First Reset the simulator by following option:
Hardware -> Erase All content and settings...
and then clean your project by following commands:
shift+cmd+K
shift+opt+cmd+K
If you still want to know what exactly causing the issue, you can check at log files from below location:
~/Library/Logs/CoreSimulator/

Find iOS simulator where specific app is installed?

I have a ton of iOS simulators on my machine and I know that one of them has a certain app installed on it that I want to run again (and I can't easily rebuild this app on a different simulator). How can I find which simulator has a certain app installed on it?
I was able to get what I wanted by running the following commands in Terminal:
cd ~/Library/Developer/CoreSimulator/Devices
find . -name MyAppName.app
Then I went into the folder for the device with the app and opened device.plist which has name and iOS version of that simulator, which I could then open from the Simulator app Hardware > Device menu.

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.

Resources