简体   繁体   中英

Compiling for iOS 4.0 on Xcode 4.0?

I have an iOS 4.0 device that's not mine but mainly for testing. I have xcode 4 installed and I have set the deployment target to 4.0 in project settings. The app doesn't seem to be copying over to the device. Any ideas on how to get it work? I see in the scheme that it says "iPod (4.0, overriding Base SDK 4.3)" if that helps.

Did you select the "Schema on the top left (right to the run button) to "Project Name" | iOS Device? If so then open the Organizer window and make sure that the device is listed there and that you have a valid provisioning profile.

Can you run your app in the simulator? If so then set the scheme to iOS Device and run again. Then it should install.

Can you tell more details? There are some possible issues that you should check:

  1. Have you installed the appropriate provisioning profiles on your test devices?
  2. What exactly is the error message or something like that?

Do your executable names depend on your build configuration, ie whether you're building a 'debug' or a 'release' executable? If this is the case, perhaps XCode tries to copy the wrong (or not existing) executable to your device. Assume your debug executable is called my_app_debug.app and your release executable is called my_app_release.app .

Select your desired scheme in the 'Scheme' drop-down and click 'Edit Scheme...'. In the scheme editor, select 'Run...' on the left. Within the 'Info' tab on the right, make sure that the selected value in 'Build configuration' corresponds to the related app executable. If 'Release' is selected in 'Build configuration', my_app_release.app has to be selected as 'Executable'. Switching to 'Debug' does not automatically change the executable. If eg my_app_release.app does not yet exist, first build your scheme without trying to run it. Then, the executable is created and can easily be selected.

Hope this helps, took some time for me to figure out why the app was not running in the first place.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM