Is it possible to build an xcode project for iPhone and have it install the result on a connected device without actually running the application? I'm currently using Build & Run, but I'm debugging a peer to peer game, so I have to build & run for two different devices, stop tasks on each of those and then build & run on the simulator so all three have the latest build. I'd love to not have to wait for the application to run on the two devices in this process.
You can drag and drop the built app (in your project build directory) into the Applications list of your device in the Organizer window.
Things have changed a little since this answer...
For simulator, you can drag/drop your recently-built app product from the Products folder in the Project Navigator straight onto the simulator window.
For a device, drag and drop the app product into "Installed Apps" when viewing the device in the "Devices" window.
If you're not quite sure where the built app is (the project build directory):
Xcode → Preferences → Locations tab → Derived Data will show the location.
There's more information in this question:
Xcode 4 - build output directory
There's another way to get it to install automatically without launching. Maybe not as useful for the OP's situation, but in my case I'm trying to profile app load times so I want to start the app without the debugger attached (which can slow down execution.)
Under the target scheme, right click and select "Edit Scheme". Make sure the run configuration is selected, and then look in the info panel. There's an option that says "Launch" - set this to "Wait for executable to be launched."
Now once it's installed it will wait for you to launch the app before attaching the debugger. However, you can just hit "Stop" in Xcode and then launch the app manually. It seems to crash the first time but on second run seems to work OK. Maybe a little hacky but less manual steps than the other methods. Tested on Xcode 7.
Related
The flutter app was working completely fine. After few days when i tried to run in ios device it said like this "open xcode and try product -> run and try fixing it . After doing this and still showed me the same error".
Product -> run ,
flutter clean ,
flutter packages get ,
open ios/Runner.xcworkspace ,
signing in General(target) ->select team
If anyone had their app running before and faced this error, what worked for me was (note I am using a Macbook pro), was to open up the terminal first.
Then navigate to the project folder and typing in open ios/Runner.xcworkspace.
This command will open up your xcode. From there you can select you device on the top (emulator or physical ios device), and click on run.
Once it builds and runs successfully, it will fix the issue you are facing, now you can go to VS code or android studio and try flutter run and it should work.
If you see this error when trying to run your app on your iPhone for the first time, it's because your xCode signing identifier contains a default one and needs updating.
Here's how to solved this issue:
In VsCode, right click the ios folder and click Xcode.
In XCode, click Runner , The top option on the left then 'Signing & Capabilities'
Click 'Automatically manage signing'
Select your Team, if you don't have one setup, click 'Add an account' and continue to the next step.
Select "Add your Apple ID"
Click Manage Certificates then click the '+' button located in the corner , then click 'Apple Development' to add a signing certificate.
Click Done. Signing Certificate should display 'Apple Development: yourAppleID..."
Select your connected iPhone from the build destination dropdown - see screenshot
Click the big play button to run the build in xCode
Trust your iPhone - Open your iPhone settings > General > Device Management or VPN & Device Management > Under Developer APP, select Apple Development : your appleID > Click Trust "Apple Development: "your apple id...."
Open vsCode and run flutter clean && flutter run.
To Fellow up with Harsh, if you have no paid Apple Developer license, your certificate runs out after a week.
In my case, I needed again to trust my developer certificate on my iPhone, again. Before that, I also received your error. If you open up your app with Xcode, you will see the real error message.
Building for iOS, but the linked and embedded framework 'App.framework' was built for iOS Simulator. (in target 'Runner' from project 'Runner')
You are encountering this error because com.example hasn't been registered as a Bundle ID on your developer account. I encountered this error while trying to use platform methods. I rectified the issue by creating a new Bundle ID on my Apple Developer Account - something like com.abc.appName. Here, abc is the name of my company. And then created a new project with this Bundle ID. Open up Xcode and under Runner -> Runner Target -> Signing and Capabilities add your Team name and make sure the automatically manage signing option is turned on
My issue was that I added the exclusion of arm64 in Xcode because my simulator was not running due to some dependency (google map?). When i deleted this arm64 exclusion for ios sdk (left it for simulator) inside xcode, runner, build settings, excluded architecture. The app could run again on physical device.
The default signing identifier is com.example.
Sounds like you haven't changed it.
My iOS project installs fine on the iPhone but the application won't launch automatically for debugging.
I'm using Xcode 4.2 (Build 4C199), the latest version for Snow Leopard (10.6.8).
I've already tried deleting the app from the iPhone, restarting the device, cleaning the project and reinstalled xCode.
Any ideas on how to solve this problem?
In Xcode click on where the project name/Device or simulator version is (On the right of the Stop Button), and select Edit Scheme, on the Run Tab select Build Configuration -> DEBUG, and select a DEBUGGER -> GDB.
In my case, I created a new target and a new scheme by duplicating the existing ones, in order to test my app on devices with on older iOS version.
However, the copied scheme had as executable selected "None":
As soon as I selected the right executable there from the drop-down menu, the app launched.
I was having this problem as well. I removed the option Launch due to a background fetch event in Edit Scheme -> Run Debug -> Options and Xcode started launched the app again.
Hope that helps.
Can you confirm you are signing the app with a development certificate? This issue happens when you sign the app with a distribution certificate.
I've been able to solve this problem by Changing Debugger to LLDB, instead of GDB, on the Run Tab, using Build Configuration -> DEBUG, by selecting Edit Scheme (On the right of the Stop Button).
I am getting the following error whenever I try to install my Cocos2d game on an iPhone device.
Failed to get the task for process 1640
I am using xCode 4.0.2 which I really hate as it is simply too complicated. I have set the build settings for my target but when I click on the project it says no build settings have been configured as shown in the screenshot below:
Although the app fails to run on the device but when I use my iPhone and click on the app it does run without using xCode.
Make sure you are using a debug configuration and not a release or ad hoc configuration to deploy to the device.
Go to the Build select box at the upper left of the Xcode main window. Select the "Scheme" that isn't building and select Edit Scheme.
In the next dialog select Run on the left hand side and Info on the right. Make sure Build Configuration is set to Debug.
Via Xcode is there a quick way to deploy an app you've just compiled to an attached iPhone without actually launching it on the phone?
My scenario is that I've tested it out my app just fine in the simulator, now I just want to deploy it to my provisioned iPhone, grab the device and go without running it then and there. Sure, I can just hit build & run after I've set the target settings to release & device, but that attempts to initiate a GDB session and it even complains if my phone is in screen lock mode.
Not a huge problem of course, and I'm not really asking how to deploy the same app to a lot of other testers who weren't involved in the development and aren't running Xcode, just if I might have missed some kind of 'build & deploy' option that doesn't attempt to run the app.
You could always build and archive, save it somewhere and copy it via iTunes... I doubt it is much faster or any more convenient. I'll use Build'n'Run all the time and stop with stop button or home button. At least you make sure that it actually runs and starts on the device. :-)
I have only started getting this error.
The application works perfectly when working on the iPhone simulator, and there are now errors like the one above.
The application is being put on a 3.0 iPhone if that is any help.
Have you rebooted? You could try restarting XCode and maybe even power off and back on your iPhone device. If that doesn't work, try rebooting the desktop you're debugging from.
I frequently (well, pretty frequently at least) have weird connectivity issues between XCode and my iPhone and rebooting the phone (power off, back on) will generally solve these.
Check that all paths in your project don't contain '#' simbol.
for example, my project at this path: "/User/alex/Projects/prj_MMH/branches/#19/" causes same error.
I had the same problem. Cleaning the build directory helped.
The answer for me was that it was running with the wrong build configuration. Go to the 'Scheme' at the top of the window, click on the 'App' at the left and Edit Schemas from the menu and select the 'Run Name.App'. Under the Info tab, there is the Build Configuration dropdown. It should be set to 'Debug' - I had it set to 'Ad Hoc Distribution' I think.
The other part which might be needed too, was that under the main project target 'App' in tab Build Settings section Code Signing Identity, the Debug setting should be set to "Don't Code Sign" and the 'Any iOS SDK' set to "iPhone Developer"
Is this in the XCode Debugger console?
You could be running the Release version.
Only the Debug build can pipe stdout/stderr back to XCode.