error: "OpenGLESApp6" requires a provisioning profile. Select a provisioning profile in the Signing & Capabilities editor. (in target 'OpenGLESApp6' from project 'OpenGLESApp6.iOS.Application')
真机调试(模拟器正常)时出现此错误需要到macos中操作
在xcode中先添加开发者账户: 菜单xcode->Preferences…
普通apple id也可以,但限制2个证书(还不能删,换电脑就卡在里面了),记得在钥匙串中备份证书.
然后打开该项目文件,设置好team签名
Undefined symbols for architecture arm64: "_OBJC_CLASS_$_AppDelegate", referenced from: objc-class-ref in main.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
原因是AppDelegate类只进行了声明 没有实现导致了.
而vs2019/2022中的模板文件AppDelegate.mm是空白的.
解决方式是为AppDelegate.mm文件添加代码
#import "AppDelegate.h" @interface AppDelegate () @end @implementation AppDelegate @end
visual studio 201x提示错误
Unable to start debugging. Unexecpted failure trying to reach vcremote: NotFound
vcremote提示错误
GET /debug/appRemotePath?package=com.bt_ios&deviceUdid=00008030-001305293E840000 404 1172.145 ms – 2
此处错误相关的js代码在以下文件
vcremote\node_modules\vcremote-lib\debugger\ios-debug.js
相关代码:
function getAppRemotePath(req, res) { var packageId = req.param("package"); var udid = req.param("deviceUdid", ""); var command = "ideviceinstaller -l -o xml"; if (udid.length > 0) { command = command + " -u " + udid; } Q.nfcall(child_process.exec, command + "> /tmp/$$.ideviceinstaller && echo /tmp/$$.ideviceinstaller").then(function (args) { // First find the path of the app on the device var filename = args[0].trim(); if (!/^\/tmp\/[0-9]+\.ideviceinstaller$/.test(filename)) { throw new Error("WrongInstalledAppsFile"); } var list = pl.parseFileSync(filename); fs.unlinkSync(filename); for (var i = 0; i < list.length; ++i) { if (list[i].CFBundleIdentifier == packageId) { var path = list[i].Path; return path; } } throw new Error("PackageNotInstalled"); }).then(function (remotePath) { res.status(200).send(remotePath); }).fail(function (reason) { res.status(404).json(reason); }).done(); }
实际上执行的就是这个命令: 列出所有的包信息.后面是手机udid.
ideviceinstaller -l -o xml -u 00008030-001305293E840000
udid在vcremote输出的的url能看到
或者使用命令 idevice_id -l
查看
如果以上命令不能执行,则解决相关库问题,如果以上能正常输出,就是包名问题了.
AppRemotePath是由url路径中的package参数去匹配手机所有app包信息中的CFBundleIdentifier字段.
自己判断即可,
CFBundleIdentifier字段其实就是在xcode中设置代码签名的Bundle Identifier,而此参数不能使用下划线
所以新建vs工程名时不要使用下划线
经测试,无法修改vs工程中的包名前缀,只能是com-_-.
Bundle Identifier 命名
Bundle Identifier:采用反域名命名规范,全部采用小写字母,以域名后缀+公司顶级域名+应用名形式命名,例如:app.eatm.test