我正在使用xcodebuild install -alltargets -iphoneos4.2 -activeconfiguration provisioning_profile=path_of_my_provisioningprofile code_sign_identity=identity
。 这个命令正在构建我的应用程序,我也得到构建文件(.app)。 但是如何从命令行安装应用程序到设备。 请帮我解决这个问题。通过命令行在iPhone设备上安装应用程序
回答
使用这个美丽的脚本:http://gamua.com/blog/2012/03/how-to-deploy-ios-apps-to-the-iphone-via-the-command-line/ - 然后通过USB连接iPhone设备到Mac上运行此命令
要在命令行启动应用程序:
instruments -w 4xxxxxxxx9 -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate NITC -e UIASCRIPT Launch-App.js
格式:instruments -w <deviceid> -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate <applicationname> -e UIASCRIPT Launch-App.js
我启动-App.js只有一行 - var target = UIATarget.localTarget();
This mus t足以使用命令行在设备上启动应用程序
四处张望发现https://github.com/benvium/libimobiledevice-macosx。这是从libimobiledevice到MAC-OS X的一个端口。它非常有用,不需要越狱。 :P
谢谢@santiagoRodriguez:p –
Fruitstrap
已不再维护,对于更新的项目结帐,PhoneGap的分支名为ios-deploy
。
要安装运行:npm install -g ios-deploy
这里是如何使用它的一些例子:推动应用或IPA到设备时提到
// deploy and debug your app to a connected device
ios-deploy --debug --bundle my.app
// deploy and launch your app to a connected device, but quit the debugger after
ios-deploy --justlaunch --debug --bundle my.app
// deploy and launch your app to a connected device, quit when app crashes or exits
ios-deploy --noninteractive --debug --bundle my.app
// Upload a file to your app's Documents folder
ios-deploy --bundle_id 'bundle.id' --upload test.txt --to Documents/test.txt
谢谢!我的工作设置使用iOS 9.3.1和OS X 10.11.3 – Jespertheend
一个现代化的工作答案经常过时的世界,干杯! – mix3d
我不相信它,它可以工作,开箱即用,无需设置,令人惊叹。 –
- 1. 通过命令行安装设备驱动程序
- 2. 从iOS设备通过命令行卸载应用程序
- 3. 如何在iPhone设备上安装rhomobile应用程序
- 4. 在设备上安装iPhone应用程序时出错
- 5. 在设备上安装应用程序(iPhone/iPod)
- 6. 在MacOSX上通过命令行连接到蓝牙设备(iPhone)
- 7. 转:命令行应用程序安装
- 8. 通过安装程序文件的命令行安装目录
- 9. 无法通过iPhone配置实用程序在设备上安装应用程序
- 10. 命令行安装程序
- 11. iPhone:3.1.2可以在3.0/3.1设备上安装iPhone应用程序吗?
- 12. XCode 4.6应用程序不会通过ipa安装到设备
- 13. 通过命令行应用程序
- 14. 在我的设备中安装iPhone应用程序
- 15. 在iPhone设备中打开已安装的应用程序
- 16. 通过wifi在设备上安装Android应用程序 - 无USB或模拟器
- 17. 如何通过命令行删除iPhone应用程序
- 18. 通过命令行在模拟器上删除应用程序
- 19. 通过iPhone本身或iTunes安装在iPhone上的应用程序列表
- 20. 激活设备应用程序安装
- 21. 通过以太网在设备上运行Android应用程序
- 22. 通过命令行更改变量NSIS安装程序
- 23. 在设备上的应用程序上运行泄漏命令行工具
- 24. Phonegap运行android命令挂在试图将设备安装到设备上
- 25. 安装后,应用程序将自动启动设备-iPhone
- 26. 为5000多台设备安装企业iPhone应用程序
- 27. 限制用户在设备上安装应用程序
- 28. 更新安装在用户设备上的BlackBerry应用程序
- 29. 应用程序安装在Xcode失败iPhone 6设备上的6
- 30. 为何adhoc分布的iPhone应用程序未安装在设备上?
哇,我从来没有见过的仪器 - +1 。有没有办法让仪器列出使用'-w'的设备ID? – jww
@noloader +1如何列出设备ID,我很想知道。 –
Fruitstrap(该链接使用的)现在已被放弃,并且不适用于iOS 7 :( – sheeptest