I have an iphone simulator running on my Mac.
I have a .ipa file, can you please tell me how can I install it on the simulator?
You can't. If it was downloaded via the iTunes store it was built for a different processor and won't work in the simulator.
I found an .ipa file that I wanted using iTunes and copied it over to my desktop.
After that I changed the extension to .zip and extracted it.
Next I found the Payload folder and moved the application inside to my desktop.
Finally I moved that application to my iPhone simulators applications folder found at:
HD
> Applications
> Xcode.app (right click - Show Package Contents)
> Contents
> Developer
> Platforms
> iPhoneSimulator.platform
> SDKs
> iPhoneSimulator6.0.sdk
> Applications
(Note: Some apps crash more often than others.)
In Xcode 6+ and iOS8+ you can do the simple steps below
Paste .app file on desktop.
Open terminal and paste the commands below:
cd desktop
xcrun simctl install booted xyz.app
Open iPhone simulator and click on app and use
For versions below iOS 8, do the following simple steps.
Note: You'll want to make sure that your app is built for all architectures, the Simulator is x386 in the Build Settings and Build Active Architecture Only set to No.
Path: Library->Application Support->iPhone Simulator->7.1 (or another version if you need it)->Applications
Create a new folder with the name of the app
Go inside the folder and place the .app file here.
Update for Xcode 9.4.1+
Hope my answer is getting seen down here as this took me a while to figure out but I just got it working.
First of all you need to build and run the App on your simulator. Then you open the Activity Monitor. Double click the name of your App to find its content.
In the next screen open the Open Files and Ports tab and find the line with MyAppName.app/MyAppName.
Copy the link but make sure to stop at the MyAppName.app. Do not copy the path following it.
Control click onto the finder icon and select Go to folder.
]
Paste the path and click enter. You will see your MyAppName.app file.
Copy it to the Desktop and zip it. Move it to your desired 2nd computer and unzip the file. Build a random project to have a simulator open.
Lastly: Literally drag and drop the App from your Desktop into your Simulator. You will see the install and the App opens and does not crash.
You cannot run an ipa file in the simulator because the ipa file is compiled for a phone's ARM architecture, not the simulator's x86 architecture.
However, you can extract an app installed in a local simulator, send it to someone else, and have them copy it to the simulator on their machine.
In terminal, type:
open ~/Library/Application\ Support/iPhone\ Simulator/*/Applications
This will open all the applications folders of all the simulators you have installed. Each of the applications will be in a folder with a random hexadecimal name. You can work out which is your application by looking inside each of them. Once you have found out which one you want, right click it and choose "Compress ..." and it will make a zip file that you can easily copy to another computer and unzip to a similar location.
UPDATE: For Xcode 8.0+ you need to follow below Steps:
Download application from iTunes
Select downloaded app, right click show in finder
Copy .ipa file to Desktop, rename it to .zip file
Extract that .zip file and you will get directory with application name
Check that directory you will find app file in Payload folder, copy this app file
Go to ~/Library/Developer/CoreSimulator/Devices
FYI: Library folder is hidden by default in mac, you can see hidden file using below command.
defaults write com.apple.finder AppleShowAllFiles YES;
killall Finder /System/Library/CoreServices/Finder.app
Now here you'll see many directories with long hexadecimal names, these all are simulators.
To find your desired simulator, sort these directories using "Arranged By > Date Modified".
Select that simulator file and go to below location.
<HEXADECIMAL-SIMULATOR-STRING>/data/Containers/Bundle/Application/
Create new folder name with <download-app-name> and paste app file in that folder
Open Terminal and run below command to install this application
xcrun simctl install booted <APP_FILE_PATH>
Example <APP_FILE_PATH> will be looks like below:
~/Library/Developer/CoreSimulator/Devices/<HEXADECIMAL-SIMULATOR-STRING>/data/Containers/Bundle/Application/<APP_NAME>
First of all, IPAs usually only have ARM slices because the App Store does not currently accept Simulator slices in uploads.
Secondly, as of Xcode 8.3 you can drag & drop a .app bundle into the Simulator window and it will be installed. You can find the app in your build products directory ~/Library/Developer/Xcode/DerivedData/projectname-xyzzyabcdefg/Build/Products/Debug-iphonesimulator if you want to save it or distribute it to other people.
To install from the command line use xcrun simctl install <device> <path>.
device can be the device UUID, its name, or booted which means the currently booted device.
For Xcode 10, here's an easy way that worked for me for a debug IPA (development profiles)
Unzip the IPA to get the Payload folder.
Within the Payload folder is the app executable.
Drag and drop the app to an open simulator. (You might see a green add button when you drag it over the simulator)
It should install that app on that simulator.
You can run the application file of project in simulator - not .ipa file.
You can get it from:
Libraries-->Applicationsupport-->iphone simulator-->4.3(its ur simulator version)-->applications-->then u can see many files like 0CD04F.... find out your application file through open it.
You can copy the file to your system(which system simulator u need run ) location Libraries-->Applicationsupport-->iphone simulator-->4.3(its your simulator version)-->applications-->
Then open the simulator 4.3 (its your simulator version where you pasted). You can see the application installed there.
Getting from other people:
Please tell them to find out Libraries-->Applicationsupport-->iphone simulator-->4.3(its ur simulator version)-->applications-->then you can see many files like 0CD04F.... from their system and receive that file from them.
After they have got the file, please copy and paste the file in to your system `Libraries-->Applicationsupport-->iphone simulator-->4.3(its your simulator version)-->applications-->(paste the file here).
Then you can see the app is installed in your system simulator and you can run it after clicking the file.
Copy From Here:
- Run the application in the Xcode.
- Select Finder go to Go and click on select Library Library/Application Support/iPhone Simulator/7.0.3-64/Applications
- Select 32 bit folder Copy your application.
Paste To Here:
- /Applications/Xcode-Beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhone Simulator. SDK/Applications
- Paste here and run the simulator.
With Xcode 6:
It's very possible to build and install on a simulator.
I did it by copying the debug build configuration (I called it SimRelease for my example below) in the project settings. I changed the architectures to i386 and x86_64 (not sure how necessary this was), but key difference to change between the copied build configuration is build for active architecture set to NO. After that a couple simple command line tools will do the rest!
xcodebuild -scheme YOUR_SCHEME -configuration SimRelease -sdk iphonesimulator8.1
Depending on where you have your DerivedData set you need to go find the outputted .app folder. Once you've found it you can simply install it on any simulator device. To find the device UUID's open Xcode and go to Window->Devices you'll see the list of the device instances and you can grab the UUID's. For a trivial script you could grab all of them from: ~/Library/Developer/CoreSimulator/Devices/ and install on every device.
From there the simple command to install on a device is:
xcrun simctl install DEVICE_ID APP_FOLDER_LOCATION
Here's a simple shell script to take the app and install it on every device:
app_dir=$1
current_dir=$(pwd)
cd ~/Library/Developer/CoreSimulator/Devices/
devices=$(ls -d */)
cd "$current_dir"
for device in $devices
do
device_id=${device%/}
xcrun simctl install "$device_id" "$app_dir"
done
Hope this helps! Took me a while to figure out the best way to do it.
Step to run in different simulator without any code repo :-
First create a .app by building your project(under project folder in Xcode) and paste it in a appropriate location (See pic for more clarity)
Download Xcode
Create a demo project and Start simulator in which you want to run the app.
Copy the .app file in particular location(ex :- Desktop).
cd Desktop and Run the command (xcrun simctl install booted appName.app),
App will be installed in the particular booted simulator.
Tested on iPod touch (7th generation) Simulator 13 (iOS 15.0)
Xcode and Xcode Command Line tools are already installed
Since we have an .ipa file, we can get the .app file from it
Rename .ipa file as .zip and extract the contents
Once the zip file is extracted, we can find the Payload folder which contains App_Name.app file
Open Terminal or iTerm2 app
Navigate to the folder which contains .app file
To list all iOS connected devices & iPhone simulators -> Also shows the UDID of all devices
xcrun xctrace list devices
Boot the simulator
xcrun simctl boot <UDID>
Launch the simulator
open -a simulator
Install the .app file
xcrun simctl install booted <App_Name>.app
Just drag and drop .app file to simulator it will install app automatically.
I have checked in iPhone simulator 13(iOS 15.4)
Related
I am uploading ios build on testflight till now. But I am getting the following error on uploading any build (I also tried uploading the previous build again which I already uploaded on it).
Invalid IPA: Couldn't find executable specified in Info.plist - check the value of your CFBundleExecutable key.
I need to upload the build. Can someone suggest me a site other than testflight where I may upload the ios build or ipa file?
The other site you can use is http://diawi.com, i use it on my project now, very helpfull.
We had a problem with CFBundleExecutable ${EXECUTABLE_NAME}. Our iOS app was for example called OurAppName.
Ran fine in Simulator but when archived and deployed via organizer said CFBundleExecutable was not an executable file.
We checked the plist and the value for CFBundleExecutable was 'ourappname'. we unzipped the ipa > app folder (see how below) and there was a fie called ourappname but it was smaller than expected and not a exe (USE:ls -l should have x at end of -rwxr-xr-x ).
Bug was caused by a text file called 'ourappname' and when archive was built it took that as the exe and not OurAppName. Answer was to rename and or delete the file with same name as our exe. Do full clean build. and recheck final ipa.
To see contents of OurAppName.ipa :
Rename to OurAppName_ipa.zip (ignore warnings):
DOUBLE CLICK on OurAppName_ipa.zip to open (creates Payload folder containing OurAppName.app):
rename OurAppName.app to OurAppName_app (ignore warnings will change app bundle to folder).
Open OurAppName_app folder look for ...info.plist for app.
Check CFBundleExecutable is pointing to OurAppName.
Find OurAppName in folder do ls -l make sure it executable (USE:ls -l should have x at end of -rwxr-xr-x).
TIP FOR TEST FLIGHT:
If testflight download fails after 80% with UNABLE TO DOWNLOAD then drag the archive you built to a iOS device using Organizer.
Click on Device > applications and + at the bottom (i think dragging the ipa to the device in the organizer installs it as well).
in your info.plist file open as source code form and check CFBundleExecutable key is there or not and make sure it is written as
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
I've read about this argument here: UUID mismatch detected with the loaded library
The most voted solution didn't work for me, because I'm sure in my case the problem is Spire.
When I try to run my App [iOS 5.0 targeted] in Xcode 4.2 onto my iPhone 4 [iOS 5.0.1 JB] the output in the console is:
warning: UUID mismatch detected with the loaded library - on disk is:
/Users/myusername/Library/Developer/Xcode/iOS DeviceSupport/5.0.1 (9A405)/Symbols/System/Library/Frameworks/CoreLocation.framework/CoreLocation
unable to load symbol file: warning: Unable to read symbols for /Library/MobileSubstrate/MobileSubstrate.dylib (file not found).
warning: No copy of MobileSubstrate.dylib found locally, reading from memory on remote device. This may slow down the debug session.
Before installing Spire I didn't have any Xcode problem. I've read that somebody already found a solution: https://stackoverflow.com/a/8930742/1203837 but I'm not so practical in approaching the proposed one that I'm going to report also here:
If you have Spire installed and you updated to 5.0.1 you need to uninstall Spire or update dyld_shared_cache which Spire is using...Spire dyld cache is at /var/spire. You need to extract cache appropriate to your current firmware from ipsw.
I really would NOT uninstall Spire, so please help me to find out how to "update dyld_shared_cache which Spire is using" .
EDIT: thanks to kexik I've tested a fully working workaround for the problem.
Whatever device you have installed Spire in, here is the step-by-step guide (Mac OS):
download the original iPhone 4S ipsw ( link )
rename it from .ipsw to .zip
extract it (normally, by double-clicking it in Mac OS X)
download vfdecrypt ( link ) ed unzip it into the same extracted folder of the ipsw.
Open Terminal and navigate into the ipsw extraxted folder (tip: type cd then drag-and-drop directly the folder into the Terminal window)
Run the command:
./vfdecrypt -i 038-3763-001.dmg -o decrypted.dmg -k a31ffd506c6711c5a0c52c9f0a2f7208a2f63ad9dd40506e70d80ea20a981eb1312bc774
NOTE:
-i 038-3763-001.dmg
Is relative to the biggest .dmg in all the ones you can find into the extracted ipsw folder (referred to the Root File System)
-o decrypted.dmg
Is relative to the name of the output decrypted file, I called "decrypted" (the extension .dmg is fixed)
-k a31ffd506c6711c5a0c52c9f0a2f7208a2f63ad9dd40506e70d80ea20a981eb1312bc774
Is relative to the VFDecrypt Key exactly for iPhone 4S iOS 5.0.1 and 038-3763-001.dmg image. Source is theiPhoneWiki
Wait until the process terminates (You'll see a new prompt line)
Open (mount) decrypted.dmg (double-click it) and here it is the iPhone 4S root file system.
Navigate into the folder
/System/Library/Caches/com.apple.dyld
Make a copy of the (only) file dyld_shared_cache_armv7 (i.e. on your desktop) and rename it to dyld_shared_cache_armv7.new
Copy it (I used DiskAid) into your iDevice file system at the path
/var/spire
Navigate into that path (I used iFile Cydia App directly on my iPhone) and rename the original dyld_shared_cache_armv7 in dyld_shared_cache_armv7.bak. Rename now the recently copied dyld_shared_cache_armv7.new in dyld_shared_cache_armv7. Check that the new dyld_shared_cache_armv7 has the same properties than the dyld_shared_cache_armv7.bak (I had to add the execute property to the new file), than delete dyld_shared_cache_armv7.bak (I suggest also to backup that file before deleting it in case of problems).
Save, exit iFile, unplug from your Mac and reboot your device.
Reopen XCode and plug your device in. It probably won't be automatically detected. In this case open the Organizer (Window -> Organizer) and delete the current iPhone (or iPod touch, or iPad) profile (mine one had the the yellow light instead of the green one near the name), unplug it, reboot Xcode, reopen Organizer and wait your device profile auto installation process.
NOW your device should be fully working debugging your Apps! My iPhone 4 GSM iOS 5.0.1 JB with Spire installed does.
Hope this guide will help whoever have the same problem.
Thanks again kexik for his suggestions!
Find an ipsw for which there is the decryption key. Then uzip that ipsw and search iphone wiki for that particular firmware - there you will find a key as well as the name of .dmg file with root filesystem. Extract that dmg (using vfdecrypt or dmg decryptor) in extracted filesystem look for /System/Library/Caches/dyld.../dyld_shared_cache and copy that file to the place on the device I mentioned.
Sorry for not giving exact instructions, I wrote it from my memory. If needed, let me know and I will prepare more exact step-by-step. ;)
so I've developed an app. Now I manually placed the .app file into the /Applications folder of my iphone (root). Than I did:
It sounds like the application isn't
signed. Download ldid from Cydia and
then use it like so: ldid -S
/Applications/AccelerometerGraph.app/AccelerometerGraph
Also be sure that the binary is marked
as executable: chmod +x
/Applications/AccelerometerGraph.app/AccelerometerGraph
(via)
Than I used UICache to make the app visible. And if I run it it shows a black screen for a 1/4 second and then it closes...(I'm not a member of the iphone dev program).
Did I something wrong?
Is there a better way?
Thank you very much! :)
I just spent a perfect Saturday afternoon looking for a solution to the exact same problem. It is a code signing problem.
Here is what I was using Xcode4 and iOS 4.3 SDK . I was building to a test device an iphone 3G running iOS 3.1.2 (jailbroken)
NOTE: ldid method did not work for me and kept on throwing the following error (Some Details on why its not working I tried using armv6 architecture through xcode4 but ldid still gave the same error):
codesign_allocate: object: MyAppName.app/MyAppName malformed object (unknown load command 4)
util/ldid.cpp(582): _assert(0:WEXITSTATUS(status) == 0)
Here is what worked for me:
Step 1. Create a Self Signed Certificate.
1- Launch Keychain Access.app. With no items selected, from the Keychain menu select Certificate Assistant, then Create a Certificate.
Name: iPhone Developer
Certificate Type: Code Signing
Let me override defaults: Yes
2- Click Continue
Validity: 3650 days
3- Click Continue
4- Blank out the Email address field.
5- Click Continue until complete.
You should see "This root certificate is not trusted". This is expected.
via (note: you dont need to be a member of the iphone dev program to make this work even though the title of the accepted answer in the link might suggest that)
Step 2. Set xCode to allow the self-signed certificate to be used
You have to edit the Info.plist file under /Developer/Platforms/iPhoneOS.platform/Info.plist
(I have installed xcode at a different location so that path for me was xcode4/Platforms/iPhoneOS.platform/Info.plist)
1- You will not be able to edit the file in its current location so just copy it to the desktop and open it in a text editor.
2- You need to Replace all instance of XCiPhoneOSCodeSignContext with XCCodeSignContext and save the file.
3- Then drag and drop the edited file back to iPhoneOS.platform folder and replace the old file. (Make sure xcode is not running if it is then restart it)
Step 3. Change the Code Signing Identity setting in your project
Change the code signing identity for your project and your target to iPhone Developer
1- In xcode4 you have to select your project (from the left navigator panel) -> Select you Project from the center under (PROJECTS) -> Build Settings -> Code Signing (expand the menu) and change all options to iPhone Developer
2- In xcode4 with your project selected from the left panel in the center of the screen you will see PROJECT and TARGETS. Now select the targets and do that same: Targets -> Build Settings -> Code Signing (expand the menu) and change all options to iPhone Developer
Step 4. Build the App and Deploy
1- Make Sure at the top of xcode next to the run and stop buttons under Scheme you have iOS Device (your device name) selected and NOT Simulator (this is how its done in xcode4)
2- Open the Scheme menu and with the iOS Device Scheme selected click edit scheme. Select Run from the left menu and under the Info tab set Build Configuration to Release
3- Now make sure you have your iOS device connected and its scheme is selected and hit Run (note: you will get some warnings but as along as the build succeeds you are okay)
if all goes well you should be able to see YourApp.app under the Products folder on the left side now select YourApp.app open it in Finder. Your app should be in a folder called Release-iphoneos Copy it to /Applications dir on your iOS device and respring or UICache to make it appear. (note: you dont need to use ldid now)
Hopefully your app will launch fine. I have only tried this with xcode4 so not sure if it will work for older versions.
Trying to debug app. The trouble is I cannot find this program.
symbolicatecrash.sh
sudo cp /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Plug-ins/iPhoneRemoteDevice.xcodeplugin/Contents/Resources/symbolicatecrash /usr/local/bin/
Is it a separate download? I am using XCode 3.2.3
Thanks.
EDIT :: XCode 4.3
You will want to follow the same steps as outlined in the original answer (below) with a few exceptions.
First, you need to fix the Xcode path. Open a terminal and run:
/usr/bin/xcode-select -print-path
If it displays "/Developer" or anything but "/Applications/Xcode.app/Contents/Developer/" then it is wrong. To fix this run the command:
sudo /usr/bin/xcode-select -switch
/Applications/Xcode.app/Contents/Developer/
You can now run all the steps below, with the exception that the symbolicatecrash command is in a new spot (again). This is because Xcode now installs as an app. To find symbolicatecrash run this from the terminal:
find /Applications/Xcode.app -name symbolicatecrash -type f
This should return:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/symbolicatecrash
Before running symbolicatecrash you may wish to go to this directory like:
cd
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/
Original Answer :: Xcode < 4.3
Path for symbolicatecrash
Search from a terminal using:
find /Developer -name symbolicatecrash -type f
For me this returned:
/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/symbolicatecrash
How to Manually Symbolicate a Crash Log
Run the symbolicatecrash command with the crash log as the first argument and your dSYM file as your second argument. Note that if you will be running symbolicatecrash from the current directory that you MUST put ./ in front like ./symbolicatecrash unless your PATH environment variable includes the directory that the command resides in.
I changed to the directory that had the symbolicatecrash command in it first (note: will be different for Xcode 4.3, see top):
cd
/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/
Then I executed the following command:
./symbolicatecrash /somePath/MyCrashLogFile.crash
/somePath/MyAppName.app.dSYM
How to Find the dSYM file:
You must have the archive that was used to create the build with the crash to get the dSYM file.
Here are the steps:
Right click (or ctrl click) the archive from organizer and choose "Show in Finder".
From the xcarchive file in finder, right click (or ctrl click) this file and choose "Show Package Contents". You will then see a "dSYMs" folder.
Inside the "dSYMs" folder you will find "YourAppName.app.dSYM" file that you will need to symbolicate files.
A plugin is available for Xcode under the Product menu. This plugin is available through Alcatraz package manager or can be directly downloaded from github.
This plugin internally incorporates a shell script that does the set up of running the following commands for manual crash symbolication.
Set an alias to symbolicatecrash.pl perl script
alias
symbolicatecrash='/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/symbolicatecrash'
To find symbolicatecrash, should it differ from the alias above:
find /Applications/Xcode.app -name symbolicatecrash -type f
Set the DEVELOPER_DIR variable:
export DEVELOPER_DIR='/Applications/Xcode.app/Contents/Developer'
With the dSYM the crash can be symbolicates as:
symbolicatecrash /path/to/MyApp_2012-10-01_Device.crash
/path/to/MyApp.app.dSYM.
One way to symbolicate a crash log is to run the following command on terminal:
xcrun atos -o MyApp.app/MyApp -arch armv7 -l 0xb7000 -f MyApp.crash
Replace the example hexadecimal number(0xb700) in the command above with the base load address. Base load address is the first memory address in the line immediately after
"Binary Images:"
To get the .app file:
Right click on the xcarchive file and select Show Package Contents
The .app file is in the Products/Applications directory.
I just wrote a post on debugging crash log 5 min ago here: http://just2us.com/2010/10/reading-iphone-crashlog/
You might not need symbolicatecrash.sh anymore if drag and drop the logs to Xcode is good enough for your purpose. I am using 3.2.4, and I can't find the script too.
As Apple explains, Xcode will try to symbolicate automatically. It uses symbolicatecrash and spotlight to do that. However if the app wasn't built locally or it was deleted, then the necessary .app and .dsym files are not available.
So keep around the dsym file and the app of released versions. Build tools will often zip the .dsym file to a .dsym.zip and package the .app as an .ipa. You can unzip both and copy .app and .dsym to the same folder. Then Xcode will be able to find them using spotlight.
Here is a simple method I use:
Open Xcode 6
Plug in your dev device
Within Xcode, go to Window > Devices > Select your device
Press 'View Device Logs'
Drag your report into the window to view it
I'd like to develop and run my iPhone applications from the command line and my personal editor instead of having to use Xcode.
So far I've been able to edit all the files in Emacs and run xcodebuild in the project to compile/link/etc.
The next step would be to create a Makefile task to launch the iPhone Simulator with my current application. Any ideas of how can I do that?
Update: I'm not interested in XCode calling my editor, I just want to forget about the IDE as much as I can.
All you need to do is copy the built .app from wherever XCode puts it to ~/Library/Application Support/iPhone Simulator/[some version]/Applications/[somefolder]/.
Then, launch /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iOS Simulator.app. Not sure how to get it to launch a specific application, but that'll take you to the home screen.
Note also that you can set up XCode to use external editors, even for source code. In this setting, you'd open XCode to look at the treeview displaying the files and other items making up your project, but once you double-click a sourcecode file it would open in e.g. Emacs.
There's a screencast over at Mac Developer Network demonstrating this: link
I doubt it. If you jailbreak your phone and install SSH on it you could set up something to >>copy the .app over wifi, but that's a fair bit of work. – Noah Witherspoon Jan 13 '09 at 5:24
I did all of my beginning iphone development work this way. Just ssh'ing over the binary executable and whatever other files you might need (after you locate the App folder on your phone) is actually much faster than installing the application from xCode. Note that I wasn't running the debugger.