I want to create a mobile app on iPhone that uses Particle.io's iOS Cloud SDK to read a variable from my Internet Button's Photon.
Particle's Getting Started documentation says to download the Particle iOS Cloud SDK example app. I did this, opened the project's .xcworkspace, it builds on Xcode 7.3.1 on MacBook Pro running OS X, but "Run" command is dimmed out for iPhone6+ actual or simulator.
The menu item Product > Run is dimmed out, even after Clean and Build.
In Project Manager, the file "ParticleSDKTests.xctest" is shown in red.
By default, the project's framework target is selected. Because it's only a framework, there's nothing to "run". You'll need to click the scheme selector and pick the application target (called "Spark-SDK") to have anything to run. See the screenshot below:
Related
I generated a build on an app for the App Store awhile back. Now I am making some changes but when I try to Run the app in Xcode v7.3.1 I see an alert saying "A build only device cannot be used to run this target. No supported iOS devices are available. Connect a device to run your application or choose a simulated device as the destination."
I can build the app and run it on my iPhone but my emulators have disappeared from the dropdown list of run targets.
I tried cleaning the build and setting Build Settings > iOS Deployment Target to 7.1 as suggested by others but to no avail.
How can I can get my emulators back in the list of run targets?
Xcode has been buggy lately, try to close out Xcode and re-run the project, If that doesn't work make sure your root folder which holds your project contains your project name an make sure the project names are exactly the same, this happened to me yesterday!
I have the iOS 9.3 beta installed on a testing device as I'm running a few 9.3-compiled apps, but I also have an old app that is compiled in Xcode 7.2. I can run the app on any iOS 9.2 device with ease, but if I try to run it on the one iOS 9.3 beta device, I get the "could not find Developer Disk Image" error.
Xcode 7.3 includes some updates to Swift, so I'd have to change a great deal of my files, and I just want to test to see if it's working fine. Is there any way to do this without having to change a lot of Swift code? It's on the App Store compiled for 9.2 and I can run it on my 9.3 device, so I don't understand why it's so difficult.
If you want to avoid the beta version of Xcode from potentially altering your original project, just make a copy of the project and then just open it up in the beta version. If you have an app running in Swift 2.1.1 (Xcode 7.2), the differences to Swift 2.2 (Xcode 7.3) are pretty modest. And if you do this with a copy, you can be confident that your original project won't be altered.
If you don't want to do that for some reason you can install apps from a production version of Xcode on a device running a beta version of iOS:
First, you want to make sure you have the profiles installed on your beta iOS device. The easiest way to do this is to run some "Hello World" app on your beta device from the beta Xcode. If prompted to add a team/profile onto your device, you should go ahead and do so, like usual.
Quit the beta Xcode and start the production Xcode and open the project for the app you want to install. Select "Generic iOS Device" where you choose the active scheme in jump bar and then build the app. You should then see the .app file (not in red) in the Products folder in the "Project Navigator" tree in the left panel.
Install the app on the device by opening the devices window (shift+command+2) and selecting the device in question. In the right panel (or top right panel if you're showing the console, too), you'll find a "Installed Apps" section. Just drag the .app file from the Products folder into this installed apps section.
Clearly, if you have other apps you want to install, you can just repeat steps 2 and 3 as appropriate.
There are a bunch of different ways to install an app on a device, but I find this is the easiest for one-off installs with a device sitting in front of me. You won't be able to debug if you do it this way, but you can at least fire it up, run it through its paces, watch the device console for any debugging messages you may be NSLog'ing, etc.
I'm sure it used to be possible to do this but I don't seem to be able to run the Xcode project generated by Titanium in Xcode. The app installs in the simulator and starts but immediately stops with the following runtime error:
Could not find the file app.js
I'm running Xcode 7.2.1 with appc cli 5.1.0 / ti CLI 5.0.5. The app is built with 5.1.2.GA.
Running the app in Xcode would provided access to instruments and perhaps better insight in native level crashes etc.
What you are trying to do isn't officially supported, but it is possible.
First, do a clean build of your Titanium app from Appcelerator Studio (or the command line). Then open the Xcode project from the build/iphone directory.
Next, open Xcode's preferences and go to the "Locations" tab. Click the "Advanced" button under the "Derived Data" field. Set the build location to "Custom" and "Relative to Workspace". Lastly set the "Products" location to build/Products and the "Intermediates" location to build/Intermediates. Click "Done" and close the preferences dialog. You only need to do this once.
You can now build your app from Xcode, but there are a few gotchas:
You cannot clean the Xcode project. You'll nuke all your app resources.
You can only build for the same target as you built the Titanium app for in Appcelerator Studio. In other words, you will probably have issues building the Titanium app for iOS simulator, then try building it for device from Xcode. Don't do this.
Again, this is currently not supported. I'm working on greatly improving this developer experience, but it's going to take a while. In the meantime, I hope the above helps.
When you create a fresh Cordova project it's called HelloCordova, which is also the app icon name. If I rename the project in XCode it will no longer run in the iPad simulator.
I am running Cordova 3 and Xcode 4.6.3 on OS X 10.8.4
Steps to reproduce
In terminal:
cordova create Survey com.domain.mysurveyap
cd Survey
cordova platform add ios
cordova build
This creates the XCode project in platforms/ios/. I then open it in XCode. The project is called HelloCordova. I hit run with the target set to iPad 6.0 Simulator.
Running HelloCordova on iPad 6.0 Simulator. No issues
Good. I get the Hello World app up.
Next I rename the project by changing the Project Name in the Identity panel. I'm doing this
a) because I don't want my project to be called 'HelloCordova'.
b) because the name here seems to dictate what the App Icon is labelled as on the device.
I rename it to 'Survey':
Xcode prompts me to rename related project content items for me. I click 'Rename'
After renaming, I go to run in the simulator again. Now it won't run. I see a 'Build succeeded' overlay for a moment. But in the status panel at the top it says:
Finished running Survey.app on iPad 6.0 Simulator. No issues.
I notice that it still shows 'HelloCordova' in the scheme selector. I have tried running 'Clean' and also restarting XCode.
This is a completely fresh PhoneGap project with no modifications. Any ideas where I'm going wrong?
I don't know why the renaming was failing, and I can't explain that "Finished running... No issues" problem. But: cordova create takes an extra argument that was missing.
This solves the problem:
cordova create Survey com.domain.mysurveyap "Survey"
The final "Survey" there sets the project name on creation, thus avoiding the need to rename the project in the first place.
How can I attach to an application currently running in iOS Simulator 6, or start an application using Automation in Xcode Instruments?
I'm using Xcode 4.5. I see my app is running in the Simulator.
If I launch Instruments, I select the "iOS Simulator -> Automation" template.
However, the drop down on top tells me under "Attach to process" that "Current Instrumentation disallows attach" and when using "Choose target", I'm presented a list of Apps from my Applications folder, but none of them is iOS Simulator, since it is inside the Xcode.app bundle.
It is working just fine on the device.
Any ideas?
"Attach to process" gives me the same result: "Current Instrumentation disallows attach." So I can't answer that part of your question.
To run your app in simulator from Instruments:
Be sure your mac is selected in the "Choose target" drop-down
In the Choose target drop-down, select Choose target -> Choose target
You will see that list of apps in your application folder -- you got this far
Now click the down-pointing triangle next to Applications to close Applications folder or simply scroll down farther to reveal the rest of the top-level folders on your mac
Browse to your app
Find it in a path like this: /Users/YOUR-USER-NAME/Library/Application Support/iPhone Simulator/5/Applications/GUID/YOUR-APP-NAME
Oddly, the file browser does not display folder "extensions," so iOS version 5.0 and 5.1 both show up as "5" in the folder list