简体   繁体   中英

How to install cordova(phonegap) ios app to device via cli and not via xcode

I am trying to create a simple project with last phonegap version:

$ phonegap create my-project
$ phonegap build ios
$ phonegap install ios

All works perfectly and I see emulator with my simple application.

But I can't find documentation on how to run my application on device (iphone, for example) and not on a simulator.

All documentation by cordova / phonegap based on examples with cordova's template for xcode. But last cordova's version don't have template for xcode and all that I need - cli, if I understand correctly?

I already registered as IOS developer and I have a valid iPhone development certificate. When I connect my device - I can see it in xcode and I can run native application on my device. But only via xcode.

I will be grateful to any advice.

If the cordova app builds and runs on the simulator, try running cordova run ios --device

This worked for me, when before it was only hitting the simulator.

Alternatively, if that STILL doesn't work for you, when you run codova build ios , to just build the app, you could use itunes to sync the generated .app file in <project_folder>/platforms/ios/build/device/AppName.app

There is an Apple CLI tool canned xcodebuild , as well as this wrapper around it by Facebook. I'd suggest trying out either that or look at the build-in xcodebuild shipped with xcode.

Hopefully one of them will work.

如果您使用Cordova CLI,您应该能够这样做:cordova run ios

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