1. Run on a real machine (recommended)
-
Connect your phone to the computer and find :
HBuilderX
in the menu bar运行
:After opening, both operating modes require certificates for cloud packaging installation. Please pay attention to the certificate details:
Copy the above
iPhone UDID
. If it is not displayedUDID
, you can see it through Dandelion ,爱思助手
, andXcode
so on. -
The copied device
UDID
needs to be added to the Apple Developer Center and Device Management . Note that the person logged in here is an Apple developer account. Otherwise, these configuration options will not be available. You can register as a developer on Baidu for money:Then there is the normal
iOS
certificate creation process, which needs to go throughBundle ID(例如:com.dzm.test)
:1. Create an identifier (
com.dzm.test
).2. Add test equipment (
刚才拷贝的 UDID
). If it is a new device, you need to update or createprofiles
a configuration file to add the new device.3. Create a test certificate (
发布就正式证书
), download the certificate for later use, and the push certificate is also created here.4. Create
profiles
a file, check测试证书
and测试设备
, and then download thisprofiles
configuration file for later use.5.
uniapp
The requiredp12
certificate is the certificate created in the first3
step of creation.cer
..cer
The certificate only contains the public key..p12
The certificate may contain both the public key and the private key..cer
p12
There are many ways to do this :方式一
: Installmac
on the computer.cer
, find the certificate in the keychain and export it, double-click to install the certificate into the keychain. If it shows that the certificate is not trusted, you can go to the Apple PKI website, downloadG3 或 G4
the certificate and install it. If it still shows that it is not trusted, , you can delete the installed.cer
certificate and reinstall it.Details: When exporting the keychain, you cannot select
p12
the certificate method to export because the entry method is incorrect:方式二
.cer
: You can convert to certificate format through the command linep12
, download and install OpenSSL , and then use it to execute the command to convert:$ openssl pkcs12 -export -in certfile.cer -inkey privateKey.key -out certificate.p12
Among them , represents the certificate file
certfile.cer
just created and represents the private key file. is the certificate file to be generated. After executing the command, you will be prompted for a password to protect the certificate. Remember this password as you will need it to access and use the certificate in the future..cer
privateKey.key
certificate.p12
P12
P12
P12
-
After you have all the certificates, open them
HBuilderX
and select here方式一
to conduct a real machine test:方式一
: Through the run in the menuiOS App 基座
, fill in the above certificate information, followed by the identifier, and the cloud package will be installed on the mobile phone.方式二
: Customize the base through the release in the menu. The things you fill in are basically the same, there is no difference, and then you caniOS App 基座
choose to automatically use the base when running. -
APP
After the test is successfully installed on the phone, click to open and it will prompt that you need to be in开发者模式
before it can be used.Find
设置 -》隐私与安全性 -》开发者模式 -》启用开发者模式
and then restart the phone. After restarting, you will be prompted to enter a password to enable developer mode, and then you can open the installed oneapp
.After the mobile phone is connected to the computer, you can always see the adjustment effect by modifying the code to support hot updates.
2. Run to the simulator
-
Download ,
Xcode
you can download the latest version from the official website and other versions from the official website .App Store 下载
-
方式一:
OpenXcode
, upper left cornerXcode -> Open Developer Tool -> Simulator
, if you don’t have this option, follow方式二
the steps:In the open simulator, you can switch to other models or versions at any time:
-
方式二:
OpenXcode
and create a new empty project:After entering the project, select the simulator you want to start, click Start, and then wait for the simulator to come out:
After the simulator comes out, you can stop the current project and close it, leaving the simulator window:
-
After the simulator starts, you can open
uniapp
the project, turn oncpu x86
support, and then run toiOS模拟器基座
: