testing app on device does nothing - objective-c

I am trying to test an app on my iOS 4.2.1 device using XCode 4.2 and the latest iOS SDK. The application does not have any functionality that is specific to iOS 5.0. When I run on my devide it says "Build successful" and then "Finished running app on device", but nothing is installed on my device and the application never starts. While searching here, I've found several possible solutions, none of which have worked. Here's what I've tried.
Resintalling all certificates and provisioning profiles
Setting the deployment target to the same iOS version as my device (without this, testing on device was not even available).
Set the "Debug" value on the Code Signing section of Build Phases to my developer certificate.
Someone suggested to set "accelerometer" to YES in "Required device capabilities", only I can't find such a section anywhere in my .plist file or the Build Settings.
ANother suggestion was to set target architecture to armv7 instead of having both armv7 and armv6. I tried with both, armv7 only and armv6 only. None worked.
Deleted /Developer folder and reinstalled XCode.
So far, the only "error" message I could find in the logs is this:
Stream error occurred for : Error Domain=kCFErrorDomainCFNetwork Code=2 "The operation couldn’t be completed. (kCFErrorDomainCFNetwork error 2.)" UserInfo=0x133cf0 {kCFGetAddrInfoFailureKey=8}
Any help will be greatly appreciated.

Seems stupidly simple, but I've seen this error quite a few times with the exact setup you outlined and unplugging the iPhone and plugging it back in often seemed to be what fixed the issue. Not sure if this is specific to the iPhone 3G/iOS 4.2.1 but this error seems to be cropping up fairly routinely for me with that device connected to Xcode 4.2.
Addition: This questioner had the exact same error, which was due to a network problem because of DNS issues. You may need to check whether your iPod and/or your Mac are properly set up on your network and can access the internet. Moving on to pure speculation, perhaps there is some 'phone home' required to confirm the device is registered on the developer portal as being provisioned for development that is failing due to networking not being set up correctly, resulting in the build not working?

I finally discovered the problem. In Build settings, Architecture, while I had made sure that both armv7 and armv6 were present in the Valid Architectures section, I did not check in the "Architectures" setting, which by default says "$(ARCHS_STANDARD_32_BIT)". Adding armv6 to this section solved the problem. But I still thank u for taking the time to try and help me, it is much appreciated.

Related

Xcode error when running on connected device: "he executable was signed with invalid entitlements"

Issue Description
I'm working on an app based on ReactNative 0.40, I am using Fastlane for beta deployments and I'm using Match to manage my signing profiles. Most things work as expected, however:
Issue:
When I try to run my app on a physical device directly from Xcode 8, it gives me this error:
This is what I've tried:
[x] Follow Apple's Entitlements Troubleshooting Guide
[x] made sure that the entitlements selected in XCode's "Capabilities" screen match the ones selected in the app id on the developer panel.
[x] Re-ran match. i.e. fastlane match development fastlane match adhoc fastlane match appstore
[x] Ran fastlane match decrypt and then security cms -D -i /path/to/***.mobileprovision. Although I'm not entirely sure what I'm looking for that is missing/extra/invalid.
Questions:
What should these settings be for both the project and the target?
Which signing identity should be used for running the app on a device from xcode during development?
What else can I try to troubleshoot this?
... and, finally fixed this. Just in case some other poor soul out there is spinning their wheels, here's what was broken in my case.
The App ID on the dev portal has 3 options for data protection:
However, Xcode doesn't:
The setting has to match anyway, so I hadn't noticed that the entitlements file was set to NSFileProtectionComplete as opposed to NSFileProtectionCompleteUntilFirstUserAuthentication
Making that change, along with switching to Automatic Signing (which in hindsight might have had no effect), fixed the issue. I may switch back to match-managed development profiles and see what happens.
I got this error due to trying to build with a wrong Scheme.
I used Release config by mistake instead of debug config
So double check whether correct Scheme / Build config is selected

Works on Simulator, fails on device: error: WatchKit App doesn't contain any WatchKit Extensions

I am seeing the following error when trying to run a project on a real device, in the simulator it runs fine.
error: WatchKit App doesn't contain any WatchKit Extensions. Verify that the value of NSExtensionPointIdentifier in your WatchKit Extension's Info.plist is set to com.apple.watchkit
Things which may or may not be relevant
I am using cocoa pods in both the watch and main app target
The project is mostly objective-c but has a few swift files
Xcode 8.1 (8B62)
Device Software Versions: iOS 10.1.1 & WatchOS 3.1
Deployment Info > Deployment Target: iOS 10.0 watchOS 3.0
Things I’ve tried
I have checked several times that all the correct files belong to the watch target. I may have missed something here, but I assume it wouldn’t run on the simulator if this was the case
Bundle identifiers
main app’s identifier: < app id >
watch app’s bundle identifier: < app id >.watchkit
watch app’s WKCompanionAppBundleIdentifier: < app id >
watch extension’s bundle identifier: < app id >.watchkit.extension
watch extension’s NSExtension>NSExtensionAttributes>WKAppBundleIdentifier: < app id >.watchkit
NSExtension>NSExtensionPointIdentifier: com.apple.watchkit
WKWatchKitApp is set to YES in both the Watch Extension and the Watch App
I have removed and re-added the .appex from Build Phases>Embed App Extensions
Ensuring Mach-O Type is set to executable in all targets
Re-installing pods as described in this answer
Clearing derived data
Clearing build folder
Restarting Xcode
I tried an archive and this failed with the same error
In lieu of an answer, advice on debugging / troubleshooting this would be appreciated too.
I've seen this intermittently, but usually rebuilding a second time fixed it. I've never got to the bottom of why.
I've always assumed it's a bug in Xcode.
Sorry can't be more help, but you're not alone in seeing this.
I encountered this error, with 3 other errors.
Turned out the problem is that Valid Architectures is set incorrectly. Under Build Settings, make sure Valid Architectures includes i386 and armv7k.
Once that is fixed, the watch extension will be build, and all errors gone.

Mac App distribution Invalid Binary issue

I am trying to upload my mac xcode project on mac app store, but each-time it shows invalid binary status. I have checked many answers in stack overflow as well. But issue is not resolved. That's why I am posting new question here
I tried some options -
1.. Removed all warnings
2.. Checked by quiting xcode, cleaned container folder
3.. provisioning profile is valid, and matching to the bundle id. I checked by deleting all certificates and provisioning and install required ones again.
4.. Created new provisioning profile and certificate 3 times. But same issue
5.. uploaded 3 times directly through xcode 5.1.1, and 2 times by Application Loader. But showing Invalid binary for all.
6.. App is properly sandboxed with proper permissions
Any idea. Thanks in advance.
Invalid Binary
When you get this error, apple will send you a mail with reason. In my case this was the email:
Dear developer,
We have discovered one or more issues with your recent delivery for
"App-Name". To process your delivery, the following issues must be
corrected:
App sandbox not enabled - The following executables must include the
"com.apple.security.app-sandbox" entitlement with a Boolean value of
true in the entitlements property list. Refer to the App Sandbox page
for more information on sandboxing your app.
App-name Mac.app/Contents/MacOS/app-name
Once these issues have been corrected, you can then redeliver the
corrected binary.
Regards,
The App Store team
Also, you shouldn't be using XCode 5.1.1 itunes connect has changed a lot now.
Please update to 6.0.1 or use the new beta version 6.1
Xcode 6.1 GM seed for OS X Yosemite
hope this helps

Using Testflight does not receive crashes

I've installed Testflight (1.2 B3) as stated in the documentation. Builds are uploading and updating fine. I can see sessions (mostly anonymous :/), I receive the logs (TFLog) - but I do not receive any crash reports. I even introduced a crash-on-event (a method not found thing) - but theres is nothing on Testflight about it.
Provisioning is via a developer profile which embeds several devices.
The problem occurs on iOS6 and iOS5 / iPhone5 and iPad3. The is being build against iOS6.
Any ideas?
UPDATE
I've tested several other frameworks and ways to receive crash reports. Nothing worked so I suspect something in my code (obviously). Are there any other switches that XCode 4.5.1 might have enabled and that way disable any error reporting during a "production environment" like setup?
UPDATE 2
As of now we're using Testflight only for distribution of beta versions and switched to Crashlytics for crash reporting. It's a bit more streamlined and fetches most crashes.
I also do not get any crash reports via TestFlight. This is what the TestFlight people told me:
Our team is currently looking into an issue associated with auto
versioning of the app when uploaded and SDK data not reporting
properly. Looking at the URL you provided it looks like the build
version is not changing before uploading the app to TestFlight and our
auto versioning implementation is causing an issue with general SDK
data reporting.
I will share this with our team and we will contact you when we have
an update available.
I tried to update the build version to avoid auto-versioning, but it did not help me. But maybe this issue is hitting someone else.
Testflight did not satisfy our needs to log crashes. That is why we skipped to Crashlytics (as I said in the original post). The issues with Testflight seem not to be resolved. We still do use it for distribution, that is what it's good at.

Xcode build but not run on device

I was in the process of adding a third party library (GPUImage), I actually managed to get it all in and installed on the device. Woohoo!
Then...well you know the story. It doesn't work anymore.
Now when ever I try to build to my device it will "Build successfully" then immediately go to "Finished running".
My setup:
iPhone 4
iOS 5.1.1
OS X Lion
Xcode 4.3.2
I have:
Tried:
Adding in armv6
-all_load
Restarting xcode
Restarting device
Removing device from the organizer then adding it back.
Restarting computer.
Cleaning project and rebuilding
Removing the "Requirements" (?) from the pList (although this app is for iOS 5.0 or higher).
None of these seem to work. If anyone has had this problem PLEEEASE help! I am about to lose my sanity.
In the mean time I will try archiving and doing and OTA install and see if that works.
Thank you very much for your time,
Cory
P.S - I have already seen all the other post on here so please don't paste links to them :)
Problem of Project, Scheme and Target names. This all must be a same. Try rename to same name
"AppName" and "Appname" is not true. Must be "AppName" and "AppName", or "Appname" and "Appname".
I have the same problem - I have the latest XCode iOS SDK 5.1 - but my iPhone is updated with the latest iOS version 5.1.1
Not sure how to solve this as Apple havent released the new SDK. Pretty shit to be honest, as I can't test on my device.
Not sure what fixed my problem but with the new Xcode version the problem stopped. Thank you everyone for your help.