set up device for development (???????????? no permissions)

后端 未结 26 2292
再見小時候
再見小時候 2020-11-22 12:27

I am using a Samsung galaxy nexus phone (Android 4.0 platform) .

I am developing Android app on Ubuntu linux OS. I would like to run my application

26条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-22 13:17

    Anyway, what I did to solve this problem(on Ubuntu).

    1. Defined in what cases I need to run these commands. For most ubuntu users there is a home folder (hidden file .bashrc).

      In which you can record the launch of these commands. But these commands will be triggered when you enter the bash command in the console.

    2. Since I have a shell .zshrc then I did the following:

      open console: gedit .zshrc

    When the file opens, add the following line:

    ./.add_device_permissions.sh
    

    After or before, we need to create this file: .add_device_permissions.sh in which we write the following:

    #!/bin/bash
    # Add permissions
    ADB="/home/vadimm/Android/Sdk/platform-tools/adb"
    $ADB devices
    $ADB kill-server
    cat .permissions_redmi_note | sudo -S $ADB devices
    $ADB kill-server
    cat .permissions_redmi_note | sudo -S $ADB devices
    

    Also we need create .permissions_redmi_note where we need to hardcode our password.

    1. Not to add to the file .zshrc unnecessary we can specify the path when starting the system itself: Startup Applications Preferences

    Where we press on "Add" and write our command: /home/vadimm/.add_device_permissions.sh

    1. Also u can tried use in command line next commands: ./adb devices ./adb kill-server sudo ./adb devices ./adb kill-server ./adb devices

提交回复
热议问题