简体   繁体   English

尝试从 Android Studio 运行应用程序时出现“未知来源”错误

[英]"unknown source" error when trying to run app from Android studio

When installing new application from Android studio, the phone cancels the installation showing a notification that it's from unknown sources.从 Android Studio 安装新应用程序时,手机会取消安装并显示来自未知来源的通知。

How can I authorize Android Studio app install on my device?如何授权在我的设备上安装 Android Studio 应用程序?

Notice: the device used is vivo y97 (Funtouch OS_9) connected to android studio using USB cable.注意:使用的设备是vivo y97(Funtouch OS_9)通过USB线连接到android studio。

for running on real device you should follow these steps first:要在真实设备上运行,您应该首先执行以下步骤:

Run Android App on Real device在真实设备上运行 Android 应用程序

You need to follow these steps to make your Android Device ready so that you can test your App.您需要按照以下步骤准备好您的 Android 设备,以便您可以测试您的应用程序。

Enable Developer Option Enable USB Debugging Install USB Drivers Connect the Device to Computer Enabling Developer Option启用开发者选项 启用 USB 调试 安装 USB 驱动程序 将设备连接到计算机 启用开发者选项

To Enable USB Debugging, First, we need to enable Developer Option on the phone.要启用USB调试,首先,我们需要在手机上启用开发者选项。 Google since Android Version 4.2 has disabled the Developer Option.谷歌自 Android 4.2 版起禁用了开发者选项。 This was done so that people do not enable the USB Debugging Mode accidentally.这样做是为了防止人们意外启用 USB 调试模式。 Enabling USB Debugging Mode puts your device into the security risk.启用 USB 调试模式会使您的设备面临安全风险。

For the devices with Android Version lower than 4.,2 the developer Option is already enabled.对于 Android 版本低于 4.,2 的设备,已启用开发者选项。

To Enable the Developer Option to follow the steps启用开发人员选项以按照以下步骤操作

  1. Go to settings and tap on About Phone / About Device or About Tablet Option转到设置并点击关于手机/关于设备或关于平板电脑选项

  2. Tap on Software Info Option点击软件信息选项

  3. Locate Build Number and Tap on it seven times.找到内部版本号并点击它七次。 You will see the message “You are now a developer” message.您将看到“您现在是开发人员”消息。 If the developer mode is already enabled then you will see the message “No need, developer mode has already been enabled”如果开发者模式已经开启,那么你会看到“不需要,开发者模式已经开启”的消息

Disable Developer option禁用开发者选项

In case you wish to disable the developer option you can go to Settings -> Application Manager.如果您希望禁用开发人员选项,您可以转到设置 -> 应用程序管理器。 Select the Settings App.选择设置应用程序。 Select the Storage Option and clear the data.选择存储选项并清除数据。 Note this will also reset your preferences within the settings menu.请注意,这也会在设置菜单中重置您的首选项。

Enable USB debugging启用 USB 调试

To enable USB Debugging, follow these steps要启用 USB 调试,请按照下列步骤操作

Go to Settings Go to Developer Options Goto USB Debugging Option and enable it转到设置转到开发人员选项转到USB调试选项并启用它

Disable Developer option禁用开发者选项

In case you wish to disable the developer option you can go to Settings -> Application Manager.如果您希望禁用开发人员选项,您可以转到设置 -> 应用程序管理器。 Select the Settings App.选择设置应用程序。 Select the Storage Option and clear the data.选择存储选项并清除数据。 Note this will also reset your preferences within the settings menu.请注意,这也会在设置菜单中重置您的首选项。

Enable USB debugging启用 USB 调试

To enable USB Debugging, follow these steps要启用 USB 调试,请按照下列步骤操作

Go to Settings Go to Developer Options Goto USB Debugging Option and enable it Connecting Over Wi-Fi转到设置转到开发人员选项转到USB调试选项并启用它通过Wi-Fi连接

Connect your device on the same wifi network as that of PC将您的设备连接到与 PC 相同的 wifi 网络上

Find out the IP Address of the Device.找出设备的 IP 地址。 There are two ways you can find out the IP address.有两种方法可以找到 IP 地址。

Goto settings -> About Device Tap on Status.转到设置 -> 关于设备 点击状态。 Or或者

Goto settings -> Wi-Fi Tap on the Wifi Network connected Locate the adb.exe.转到设置 -> Wi-Fi 点击连接的 Wifi 网络找到 adb.exe。 The adb is known as Android Debug Bridge is the tool that lets us communicate with a device. adb 被称为 Android Debug Bridge,是让我们与设备进行通信的工具。 This tool is located under the platform-tools folder under the Android SDK folder.此工具位于 Android SDK 文件夹下的 platform-tools 文件夹下。

The Android SDK folder can be found out by type SET ANDROID_HOME command. Android SDK 文件夹可以通过键入 SET ANDROID_HOME 命令找到。 goto the folder The adb is already running and listening on the USB port for the devices.转到文件夹 adb 已经在运行并监听设备的 USB 端口。 To make it to listen to the TCP/IP Port number 5555 run the following command要使其侦听 TCP/IP 端口号 5555,请运行以下命令

adb tcpip 5555 

Now, to connect the device run the following command现在,要连接设备,请运行以下命令

adb connect 192.168.0.103:5555

Replace the IP 192.168.0.103 with the IP Address of your device.将 IP 192.168.0.103 替换为您设备的 IP 地址。

To disable TCP/IP and enable the USB, run the command要禁用 TCP/IP 并启用 USB,请运行以下命令

adb usb

To Find out the available devices找出可用的设备

adb devices

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 尝试运行应用时出现Android Studio错误 - Android Studio error when trying to run app 尝试运行 Android Studio 应用程序时出错 - Error when trying to run an Android Studio app 尝试在Nexus 6上从Android Studio运行项目时出错 - Error when trying to run project from Android Studio on my Nexus 6 尝试在Android Studio中运行模拟器时出错 - Error when trying to run Emulator in Android Studio 从Android Studio运行应用程序时出错 - Error when i run app from android studio 我正在尝试在 android studio 中运行 AR 应用程序,但是在添加片段时出现错误“缺少约束和未知片段” - I am trying to run AR app in android studio but, while adding fragment i am getting error "missing constraint and unknown fragment" 我运行应用程序时出现Android Studio错误 - Android Studio Error when i run the app Android Studio:尝试在第0行上运行App,Supply_width属性时出错? - Android Studio: Error when trying to run App, Supply_width attribute on line 0? 尝试在设备上运行应用程序时出现Android Studio IDE内部错误:“ NoClassDefFoundError com / jcraft / jsch / JSchException” - Android Studio IDE Internal error occurence when trying to run app on device: “NoClassDefFoundError com/jcraft/jsch/JSchException” 尝试通过 usb 调试在 android 工作室上运行应用程序时,有没有办法清除错误消息? - Is there a way to clear the error message when trying to run an app on android studio via usb debugging?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM